Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.resources.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.Head;
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.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.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.resources.fluent.DeploymentsClient;
import com.azure.resourcemanager.resources.fluent.models.DeploymentExportResultInner;
import com.azure.resourcemanager.resources.fluent.models.DeploymentExtendedInner;
import com.azure.resourcemanager.resources.fluent.models.DeploymentInner;
import com.azure.resourcemanager.resources.fluent.models.DeploymentValidateResultInner;
import com.azure.resourcemanager.resources.fluent.models.TemplateHashResultInner;
import com.azure.resourcemanager.resources.fluent.models.WhatIfOperationResultInner;
import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete;
import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet;
import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing;
import com.azure.resourcemanager.resources.models.DeploymentListResult;
import com.azure.resourcemanager.resources.models.DeploymentWhatIf;
import com.azure.resourcemanager.resources.models.ScopedDeployment;
import com.azure.resourcemanager.resources.models.ScopedDeploymentWhatIf;
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 DeploymentsClient.
*/
public final class DeploymentsClientImpl implements InnerSupportsGet,
InnerSupportsListing, InnerSupportsDelete, DeploymentsClient {
/**
* The proxy service used to perform REST calls.
*/
private final DeploymentsService service;
/**
* The service client containing this operation class.
*/
private final ResourceManagementClientImpl client;
/**
* Initializes an instance of DeploymentsClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
DeploymentsClientImpl(ResourceManagementClientImpl client) {
this.service
= RestProxy.create(DeploymentsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}
/**
* The interface defining all the services for ResourceManagementClientDeployments to be used by the proxy service
* to perform REST calls.
*/
@Host("{$host}")
@ServiceInterface(name = "ResourceManagementCl")
public interface DeploymentsService {
@Headers({ "Content-Type: application/json" })
@Delete("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}")
@ExpectedResponses({ 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> deleteAtScope(@HostParam("$host") String endpoint,
@PathParam(value = "scope", encoded = true) String scope,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Head("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}")
@ExpectedResponses({ 204, 404 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> checkExistenceAtScope(@HostParam("$host") String endpoint,
@PathParam(value = "scope", encoded = true) String scope,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createOrUpdateAtScope(@HostParam("$host") String endpoint,
@PathParam(value = "scope", encoded = true) String scope,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@BodyParam("application/json") DeploymentInner parameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getAtScope(@HostParam("$host") String endpoint,
@PathParam(value = "scope", encoded = true) String scope,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel")
@ExpectedResponses({ 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> cancelAtScope(@HostParam("$host") String endpoint,
@PathParam(value = "scope", encoded = true) String scope,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/validate")
@ExpectedResponses({ 200, 202, 400 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> validateAtScope(@HostParam("$host") String endpoint,
@PathParam(value = "scope", encoded = true) String scope,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@BodyParam("application/json") DeploymentInner parameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Post("/{scope}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> exportTemplateAtScope(@HostParam("$host") String endpoint,
@PathParam(value = "scope", encoded = true) String scope,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/{scope}/providers/Microsoft.Resources/deployments/")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listAtScope(@HostParam("$host") String endpoint,
@PathParam(value = "scope", encoded = true) String scope, @QueryParam("$filter") String filter,
@QueryParam("$top") Integer top, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/providers/Microsoft.Resources/deployments/{deploymentName}")
@ExpectedResponses({ 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> deleteAtTenantScope(@HostParam("$host") String endpoint,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Head("/providers/Microsoft.Resources/deployments/{deploymentName}")
@ExpectedResponses({ 204, 404 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> checkExistenceAtTenantScope(@HostParam("$host") String endpoint,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/providers/Microsoft.Resources/deployments/{deploymentName}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createOrUpdateAtTenantScope(@HostParam("$host") String endpoint,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@BodyParam("application/json") ScopedDeployment parameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/providers/Microsoft.Resources/deployments/{deploymentName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getAtTenantScope(@HostParam("$host") String endpoint,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/providers/Microsoft.Resources/deployments/{deploymentName}/cancel")
@ExpectedResponses({ 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> cancelAtTenantScope(@HostParam("$host") String endpoint,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/providers/Microsoft.Resources/deployments/{deploymentName}/validate")
@ExpectedResponses({ 200, 202, 400 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> validateAtTenantScope(@HostParam("$host") String endpoint,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@BodyParam("application/json") ScopedDeployment parameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Post("/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> whatIfAtTenantScope(@HostParam("$host") String endpoint,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@BodyParam("application/json") ScopedDeploymentWhatIf parameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Post("/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> exportTemplateAtTenantScope(@HostParam("$host") String endpoint,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/providers/Microsoft.Resources/deployments/")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listAtTenantScope(@HostParam("$host") String endpoint,
@QueryParam("$filter") String filter, @QueryParam("$top") Integer top,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}")
@ExpectedResponses({ 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> deleteAtManagementGroupScope(@HostParam("$host") String endpoint,
@PathParam("groupId") String groupId, @PathParam("deploymentName") String deploymentName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Head("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}")
@ExpectedResponses({ 204, 404 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> checkExistenceAtManagementGroupScope(@HostParam("$host") String endpoint,
@PathParam("groupId") String groupId, @PathParam("deploymentName") String deploymentName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createOrUpdateAtManagementGroupScope(@HostParam("$host") String endpoint,
@PathParam("groupId") String groupId, @PathParam("deploymentName") String deploymentName,
@QueryParam("api-version") String apiVersion, @BodyParam("application/json") ScopedDeployment parameters,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getAtManagementGroupScope(@HostParam("$host") String endpoint,
@PathParam("groupId") String groupId, @PathParam("deploymentName") String deploymentName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel")
@ExpectedResponses({ 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> cancelAtManagementGroupScope(@HostParam("$host") String endpoint,
@PathParam("groupId") String groupId, @PathParam("deploymentName") String deploymentName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate")
@ExpectedResponses({ 200, 202, 400 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> validateAtManagementGroupScope(@HostParam("$host") String endpoint,
@PathParam("groupId") String groupId, @PathParam("deploymentName") String deploymentName,
@QueryParam("api-version") String apiVersion, @BodyParam("application/json") ScopedDeployment parameters,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> whatIfAtManagementGroupScope(@HostParam("$host") String endpoint,
@PathParam("groupId") String groupId, @PathParam("deploymentName") String deploymentName,
@QueryParam("api-version") String apiVersion,
@BodyParam("application/json") ScopedDeploymentWhatIf parameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Post("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> exportTemplateAtManagementGroupScope(
@HostParam("$host") String endpoint, @PathParam("groupId") String groupId,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/providers/Microsoft.Management/managementGroups/{groupId}/providers/Microsoft.Resources/deployments/")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listAtManagementGroupScope(@HostParam("$host") String endpoint,
@PathParam("groupId") String groupId, @QueryParam("$filter") String filter, @QueryParam("$top") Integer top,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}")
@ExpectedResponses({ 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> deleteAtSubscriptionScope(@HostParam("$host") String endpoint,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Head("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}")
@ExpectedResponses({ 204, 404 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> checkExistenceAtSubscriptionScope(@HostParam("$host") String endpoint,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createOrUpdateAtSubscriptionScope(@HostParam("$host") String endpoint,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@BodyParam("application/json") DeploymentInner parameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getAtSubscriptionScope(@HostParam("$host") String endpoint,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel")
@ExpectedResponses({ 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> cancelAtSubscriptionScope(@HostParam("$host") String endpoint,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/validate")
@ExpectedResponses({ 200, 202, 400 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> validateAtSubscriptionScope(@HostParam("$host") String endpoint,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@BodyParam("application/json") DeploymentInner parameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> whatIfAtSubscriptionScope(@HostParam("$host") String endpoint,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@BodyParam("application/json") DeploymentWhatIf parameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> exportTemplateAtSubscriptionScope(
@HostParam("$host") String endpoint, @PathParam("deploymentName") String deploymentName,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/providers/Microsoft.Resources/deployments/")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> list(@HostParam("$host") String endpoint,
@QueryParam("$filter") String filter, @QueryParam("$top") Integer top,
@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.Resources/deployments/{deploymentName}")
@ExpectedResponses({ 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> delete(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Head("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}")
@ExpectedResponses({ 204, 404 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> checkExistence(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createOrUpdate(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@BodyParam("application/json") DeploymentInner parameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getByResourceGroup(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel")
@ExpectedResponses({ 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> cancel(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate")
@ExpectedResponses({ 200, 202, 400 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> validate(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@BodyParam("application/json") DeploymentInner parameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/whatIf")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> whatIf(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("deploymentName") String deploymentName, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@BodyParam("application/json") DeploymentWhatIf parameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/exportTemplate")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> exportTemplate(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("deploymentName") String deploymentName, @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.Resources/deployments/")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByResourceGroup(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$filter") String filter,
@QueryParam("$top") Integer top, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/providers/Microsoft.Resources/calculateTemplateHash")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> calculateTemplateHash(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @BodyParam("application/json") Object template,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listAtScopeNext(
@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> listAtTenantScopeNext(
@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> listAtManagementGroupScopeNext(
@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> listAtSubscriptionScopeNext(
@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);
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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)
public Mono>> deleteAtScopeWithResponseAsync(String scope, String deploymentName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (scope == null) {
return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.deleteAtScope(this.client.getEndpoint(), scope, deploymentName,
this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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>> deleteAtScopeWithResponseAsync(String scope, String deploymentName,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (scope == null) {
return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.deleteAtScope(this.client.getEndpoint(), scope, deploymentName, this.client.getApiVersion(),
accept, context);
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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)
public PollerFlux, Void> beginDeleteAtScopeAsync(String scope, String deploymentName) {
Mono>> mono = deleteAtScopeWithResponseAsync(scope, deploymentName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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> beginDeleteAtScopeAsync(String scope, String deploymentName,
Context context) {
context = this.client.mergeContext(context);
Mono>> mono = deleteAtScopeWithResponseAsync(scope, deploymentName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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> beginDeleteAtScope(String scope, String deploymentName) {
return this.beginDeleteAtScopeAsync(scope, deploymentName).getSyncPoller();
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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> beginDeleteAtScope(String scope, String deploymentName, Context context) {
return this.beginDeleteAtScopeAsync(scope, deploymentName, context).getSyncPoller();
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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)
public Mono deleteAtScopeAsync(String scope, String deploymentName) {
return beginDeleteAtScopeAsync(scope, deploymentName).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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 deleteAtScopeAsync(String scope, String deploymentName, Context context) {
return beginDeleteAtScopeAsync(scope, deploymentName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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 deleteAtScope(String scope, String deploymentName) {
deleteAtScopeAsync(scope, deploymentName).block();
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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 deleteAtScope(String scope, String deploymentName, Context context) {
deleteAtScopeAsync(scope, deploymentName, context).block();
}
/**
* Checks whether the deployment exists.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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 whether resource exists along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> checkExistenceAtScopeWithResponseAsync(String scope, String deploymentName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (scope == null) {
return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.checkExistenceAtScope(this.client.getEndpoint(), scope, deploymentName,
this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Checks whether the deployment exists.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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 whether resource exists along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> checkExistenceAtScopeWithResponseAsync(String scope, String deploymentName,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (scope == null) {
return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.checkExistenceAtScope(this.client.getEndpoint(), scope, deploymentName,
this.client.getApiVersion(), accept, context);
}
/**
* Checks whether the deployment exists.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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 whether resource exists on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono checkExistenceAtScopeAsync(String scope, String deploymentName) {
return checkExistenceAtScopeWithResponseAsync(scope, deploymentName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Checks whether the deployment exists.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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 whether resource exists along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response checkExistenceAtScopeWithResponse(String scope, String deploymentName, Context context) {
return checkExistenceAtScopeWithResponseAsync(scope, deploymentName, context).block();
}
/**
* Checks whether the deployment exists.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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 whether resource exists.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public boolean checkExistenceAtScope(String scope, String deploymentName) {
return checkExistenceAtScopeWithResponse(scope, deploymentName, Context.NONE).getValue();
}
/**
* Deploys resources at a given scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the 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 deployment information along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> createOrUpdateAtScopeWithResponseAsync(String scope, String deploymentName,
DeploymentInner parameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (scope == null) {
return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createOrUpdateAtScope(this.client.getEndpoint(), scope, deploymentName,
this.client.getApiVersion(), parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Deploys resources at a given scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the operation.
* @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 deployment information along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createOrUpdateAtScopeWithResponseAsync(String scope, String deploymentName,
DeploymentInner parameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (scope == null) {
return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createOrUpdateAtScope(this.client.getEndpoint(), scope, deploymentName,
this.client.getApiVersion(), parameters, accept, context);
}
/**
* Deploys resources at a given scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the 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 deployment information.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, DeploymentExtendedInner>
beginCreateOrUpdateAtScopeAsync(String scope, String deploymentName, DeploymentInner parameters) {
Mono>> mono
= createOrUpdateAtScopeWithResponseAsync(scope, deploymentName, parameters);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DeploymentExtendedInner.class, DeploymentExtendedInner.class,
this.client.getContext());
}
/**
* Deploys resources at a given scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the operation.
* @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 deployment information.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DeploymentExtendedInner> beginCreateOrUpdateAtScopeAsync(
String scope, String deploymentName, DeploymentInner parameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= createOrUpdateAtScopeWithResponseAsync(scope, deploymentName, parameters, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DeploymentExtendedInner.class, DeploymentExtendedInner.class, context);
}
/**
* Deploys resources at a given scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the 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 deployment information.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DeploymentExtendedInner>
beginCreateOrUpdateAtScope(String scope, String deploymentName, DeploymentInner parameters) {
return this.beginCreateOrUpdateAtScopeAsync(scope, deploymentName, parameters).getSyncPoller();
}
/**
* Deploys resources at a given scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the operation.
* @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 deployment information.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DeploymentExtendedInner>
beginCreateOrUpdateAtScope(String scope, String deploymentName, DeploymentInner parameters, Context context) {
return this.beginCreateOrUpdateAtScopeAsync(scope, deploymentName, parameters, context).getSyncPoller();
}
/**
* Deploys resources at a given scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the 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 deployment information on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono createOrUpdateAtScopeAsync(String scope, String deploymentName,
DeploymentInner parameters) {
return beginCreateOrUpdateAtScopeAsync(scope, deploymentName, parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deploys resources at a given scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the operation.
* @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 deployment information on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createOrUpdateAtScopeAsync(String scope, String deploymentName,
DeploymentInner parameters, Context context) {
return beginCreateOrUpdateAtScopeAsync(scope, deploymentName, parameters, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deploys resources at a given scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the 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 deployment information.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DeploymentExtendedInner createOrUpdateAtScope(String scope, String deploymentName,
DeploymentInner parameters) {
return createOrUpdateAtScopeAsync(scope, deploymentName, parameters).block();
}
/**
* Deploys resources at a given scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the operation.
* @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 deployment information.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DeploymentExtendedInner createOrUpdateAtScope(String scope, String deploymentName,
DeploymentInner parameters, Context context) {
return createOrUpdateAtScopeAsync(scope, deploymentName, parameters, context).block();
}
/**
* Gets a deployment.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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 deployment along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getAtScopeWithResponseAsync(String scope, String deploymentName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (scope == null) {
return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getAtScope(this.client.getEndpoint(), scope, deploymentName,
this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets a deployment.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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 deployment along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getAtScopeWithResponseAsync(String scope, String deploymentName,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (scope == null) {
return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getAtScope(this.client.getEndpoint(), scope, deploymentName, this.client.getApiVersion(), accept,
context);
}
/**
* Gets a deployment.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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 deployment on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono getAtScopeAsync(String scope, String deploymentName) {
return getAtScopeWithResponseAsync(scope, deploymentName).flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Gets a deployment.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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 deployment along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getAtScopeWithResponse(String scope, String deploymentName,
Context context) {
return getAtScopeWithResponseAsync(scope, deploymentName, context).block();
}
/**
* Gets a deployment.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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 deployment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DeploymentExtendedInner getAtScope(String scope, String deploymentName) {
return getAtScopeWithResponse(scope, deploymentName, Context.NONE).getValue();
}
/**
* Cancels a currently running template deployment.
*
* You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is
* canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running
* template deployment and leaves the resources partially deployed.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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)
public Mono> cancelAtScopeWithResponseAsync(String scope, String deploymentName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (scope == null) {
return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.cancelAtScope(this.client.getEndpoint(), scope, deploymentName,
this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Cancels a currently running template deployment.
*
* You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is
* canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running
* template deployment and leaves the resources partially deployed.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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> cancelAtScopeWithResponseAsync(String scope, String deploymentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (scope == null) {
return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.cancelAtScope(this.client.getEndpoint(), scope, deploymentName, this.client.getApiVersion(),
accept, context);
}
/**
* Cancels a currently running template deployment.
*
* You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is
* canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running
* template deployment and leaves the resources partially deployed.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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)
public Mono cancelAtScopeAsync(String scope, String deploymentName) {
return cancelAtScopeWithResponseAsync(scope, deploymentName).flatMap(ignored -> Mono.empty());
}
/**
* Cancels a currently running template deployment.
*
* You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is
* canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running
* template deployment and leaves the resources partially deployed.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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 cancelAtScopeWithResponse(String scope, String deploymentName, Context context) {
return cancelAtScopeWithResponseAsync(scope, deploymentName, context).block();
}
/**
* Cancels a currently running template deployment.
*
* You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is
* canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running
* template deployment and leaves the resources partially deployed.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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 cancelAtScope(String scope, String deploymentName) {
cancelAtScopeWithResponse(scope, deploymentName, Context.NONE);
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response along with {@link Response} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> validateAtScopeWithResponseAsync(String scope, String deploymentName,
DeploymentInner parameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (scope == null) {
return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.validateAtScope(this.client.getEndpoint(), scope, deploymentName,
this.client.getApiVersion(), parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response along with {@link Response} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> validateAtScopeWithResponseAsync(String scope, String deploymentName,
DeploymentInner parameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (scope == null) {
return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.validateAtScope(this.client.getEndpoint(), scope, deploymentName, this.client.getApiVersion(),
parameters, accept, context);
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, DeploymentValidateResultInner>
beginValidateAtScopeAsync(String scope, String deploymentName, DeploymentInner parameters) {
Mono>> mono = validateAtScopeWithResponseAsync(scope, deploymentName, parameters);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DeploymentValidateResultInner.class, DeploymentValidateResultInner.class,
this.client.getContext());
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DeploymentValidateResultInner>
beginValidateAtScopeAsync(String scope, String deploymentName, DeploymentInner parameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= validateAtScopeWithResponseAsync(scope, deploymentName, parameters, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DeploymentValidateResultInner.class, DeploymentValidateResultInner.class,
context);
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DeploymentValidateResultInner>
beginValidateAtScope(String scope, String deploymentName, DeploymentInner parameters) {
return this.beginValidateAtScopeAsync(scope, deploymentName, parameters).getSyncPoller();
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DeploymentValidateResultInner>
beginValidateAtScope(String scope, String deploymentName, DeploymentInner parameters, Context context) {
return this.beginValidateAtScopeAsync(scope, deploymentName, parameters, context).getSyncPoller();
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono validateAtScopeAsync(String scope, String deploymentName,
DeploymentInner parameters) {
return beginValidateAtScopeAsync(scope, deploymentName, parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono validateAtScopeAsync(String scope, String deploymentName,
DeploymentInner parameters, Context context) {
return beginValidateAtScopeAsync(scope, deploymentName, parameters, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DeploymentValidateResultInner validateAtScope(String scope, String deploymentName,
DeploymentInner parameters) {
return validateAtScopeAsync(scope, deploymentName, parameters).block();
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DeploymentValidateResultInner validateAtScope(String scope, String deploymentName,
DeploymentInner parameters, Context context) {
return validateAtScopeAsync(scope, deploymentName, parameters, context).block();
}
/**
* Exports the template used for specified deployment.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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 deployment export result along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> exportTemplateAtScopeWithResponseAsync(String scope,
String deploymentName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (scope == null) {
return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.exportTemplateAtScope(this.client.getEndpoint(), scope, deploymentName,
this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Exports the template used for specified deployment.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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 deployment export result along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> exportTemplateAtScopeWithResponseAsync(String scope,
String deploymentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (scope == null) {
return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.exportTemplateAtScope(this.client.getEndpoint(), scope, deploymentName,
this.client.getApiVersion(), accept, context);
}
/**
* Exports the template used for specified deployment.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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 deployment export result on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono exportTemplateAtScopeAsync(String scope, String deploymentName) {
return exportTemplateAtScopeWithResponseAsync(scope, deploymentName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Exports the template used for specified deployment.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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 deployment export result along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response exportTemplateAtScopeWithResponse(String scope, String deploymentName,
Context context) {
return exportTemplateAtScopeWithResponseAsync(scope, deploymentName, context).block();
}
/**
* Exports the template used for specified deployment.
*
* @param scope The resource scope.
* @param deploymentName The name of the deployment.
* @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 deployment export result.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DeploymentExportResultInner exportTemplateAtScope(String scope, String deploymentName) {
return exportTemplateAtScopeWithResponse(scope, deploymentName, Context.NONE).getValue();
}
/**
* Get all the deployments at the given scope.
*
* @param scope The resource scope.
* @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq
* '{state}'.
* @param top The number of results to get. If null is passed, returns all deployments.
* @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 all the deployments at the given scope along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listAtScopeSinglePageAsync(String scope, String filter,
Integer top) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (scope == null) {
return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listAtScope(this.client.getEndpoint(), scope, filter, top,
this.client.getApiVersion(), 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 all the deployments at the given scope.
*
* @param scope The resource scope.
* @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq
* '{state}'.
* @param top The number of results to get. If null is passed, returns all deployments.
* @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 all the deployments at the given scope along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listAtScopeSinglePageAsync(String scope, String filter,
Integer top, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (scope == null) {
return Mono.error(new IllegalArgumentException("Parameter scope is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listAtScope(this.client.getEndpoint(), scope, filter, top, this.client.getApiVersion(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Get all the deployments at the given scope.
*
* @param scope The resource scope.
* @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq
* '{state}'.
* @param top The number of results to get. If null is passed, returns all deployments.
* @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 all the deployments at the given scope as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux listAtScopeAsync(String scope, String filter, Integer top) {
return new PagedFlux<>(() -> listAtScopeSinglePageAsync(scope, filter, top),
nextLink -> listAtScopeNextSinglePageAsync(nextLink));
}
/**
* Get all the deployments at the given scope.
*
* @param scope The resource scope.
* @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 all the deployments at the given scope as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux listAtScopeAsync(String scope) {
final String filter = null;
final Integer top = null;
return new PagedFlux<>(() -> listAtScopeSinglePageAsync(scope, filter, top),
nextLink -> listAtScopeNextSinglePageAsync(nextLink));
}
/**
* Get all the deployments at the given scope.
*
* @param scope The resource scope.
* @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq
* '{state}'.
* @param top The number of results to get. If null is passed, returns all deployments.
* @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 all the deployments at the given scope as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAtScopeAsync(String scope, String filter, Integer top,
Context context) {
return new PagedFlux<>(() -> listAtScopeSinglePageAsync(scope, filter, top, context),
nextLink -> listAtScopeNextSinglePageAsync(nextLink, context));
}
/**
* Get all the deployments at the given scope.
*
* @param scope The resource scope.
* @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 all the deployments at the given scope as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listAtScope(String scope) {
final String filter = null;
final Integer top = null;
return new PagedIterable<>(listAtScopeAsync(scope, filter, top));
}
/**
* Get all the deployments at the given scope.
*
* @param scope The resource scope.
* @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq
* '{state}'.
* @param top The number of results to get. If null is passed, returns all deployments.
* @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 all the deployments at the given scope as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listAtScope(String scope, String filter, Integer top,
Context context) {
return new PagedIterable<>(listAtScopeAsync(scope, filter, top, context));
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param deploymentName The name of the deployment.
* @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)
public Mono>> deleteAtTenantScopeWithResponseAsync(String deploymentName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.deleteAtTenantScope(this.client.getEndpoint(), deploymentName,
this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param deploymentName The name of the deployment.
* @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>> deleteAtTenantScopeWithResponseAsync(String deploymentName,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.deleteAtTenantScope(this.client.getEndpoint(), deploymentName, this.client.getApiVersion(),
accept, context);
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param deploymentName The name of the deployment.
* @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)
public PollerFlux, Void> beginDeleteAtTenantScopeAsync(String deploymentName) {
Mono>> mono = deleteAtTenantScopeWithResponseAsync(deploymentName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param deploymentName The name of the deployment.
* @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> beginDeleteAtTenantScopeAsync(String deploymentName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = deleteAtTenantScopeWithResponseAsync(deploymentName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param deploymentName The name of the deployment.
* @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> beginDeleteAtTenantScope(String deploymentName) {
return this.beginDeleteAtTenantScopeAsync(deploymentName).getSyncPoller();
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param deploymentName The name of the deployment.
* @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> beginDeleteAtTenantScope(String deploymentName, Context context) {
return this.beginDeleteAtTenantScopeAsync(deploymentName, context).getSyncPoller();
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param deploymentName The name of the deployment.
* @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)
public Mono deleteAtTenantScopeAsync(String deploymentName) {
return beginDeleteAtTenantScopeAsync(deploymentName).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param deploymentName The name of the deployment.
* @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 deleteAtTenantScopeAsync(String deploymentName, Context context) {
return beginDeleteAtTenantScopeAsync(deploymentName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param deploymentName The name of the deployment.
* @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 deleteAtTenantScope(String deploymentName) {
deleteAtTenantScopeAsync(deploymentName).block();
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param deploymentName The name of the deployment.
* @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 deleteAtTenantScope(String deploymentName, Context context) {
deleteAtTenantScopeAsync(deploymentName, context).block();
}
/**
* Checks whether the deployment exists.
*
* @param deploymentName The name of the deployment.
* @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 whether resource exists along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> checkExistenceAtTenantScopeWithResponseAsync(String deploymentName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.checkExistenceAtTenantScope(this.client.getEndpoint(), deploymentName,
this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Checks whether the deployment exists.
*
* @param deploymentName The name of the deployment.
* @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 whether resource exists along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> checkExistenceAtTenantScopeWithResponseAsync(String deploymentName,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.checkExistenceAtTenantScope(this.client.getEndpoint(), deploymentName,
this.client.getApiVersion(), accept, context);
}
/**
* Checks whether the deployment exists.
*
* @param deploymentName The name of the deployment.
* @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 whether resource exists on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono checkExistenceAtTenantScopeAsync(String deploymentName) {
return checkExistenceAtTenantScopeWithResponseAsync(deploymentName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Checks whether the deployment exists.
*
* @param deploymentName The name of the deployment.
* @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 whether resource exists along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response checkExistenceAtTenantScopeWithResponse(String deploymentName, Context context) {
return checkExistenceAtTenantScopeWithResponseAsync(deploymentName, context).block();
}
/**
* Checks whether the deployment exists.
*
* @param deploymentName The name of the deployment.
* @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 whether resource exists.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public boolean checkExistenceAtTenantScope(String deploymentName) {
return checkExistenceAtTenantScopeWithResponse(deploymentName, Context.NONE).getValue();
}
/**
* Deploys resources at tenant scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the 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 deployment information along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> createOrUpdateAtTenantScopeWithResponseAsync(String deploymentName,
ScopedDeployment parameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createOrUpdateAtTenantScope(this.client.getEndpoint(), deploymentName,
this.client.getApiVersion(), parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Deploys resources at tenant scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the operation.
* @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 deployment information along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createOrUpdateAtTenantScopeWithResponseAsync(String deploymentName,
ScopedDeployment parameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createOrUpdateAtTenantScope(this.client.getEndpoint(), deploymentName,
this.client.getApiVersion(), parameters, accept, context);
}
/**
* Deploys resources at tenant scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the 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 deployment information.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, DeploymentExtendedInner>
beginCreateOrUpdateAtTenantScopeAsync(String deploymentName, ScopedDeployment parameters) {
Mono>> mono
= createOrUpdateAtTenantScopeWithResponseAsync(deploymentName, parameters);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DeploymentExtendedInner.class, DeploymentExtendedInner.class,
this.client.getContext());
}
/**
* Deploys resources at tenant scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the operation.
* @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 deployment information.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DeploymentExtendedInner>
beginCreateOrUpdateAtTenantScopeAsync(String deploymentName, ScopedDeployment parameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= createOrUpdateAtTenantScopeWithResponseAsync(deploymentName, parameters, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DeploymentExtendedInner.class, DeploymentExtendedInner.class, context);
}
/**
* Deploys resources at tenant scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the 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 deployment information.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DeploymentExtendedInner>
beginCreateOrUpdateAtTenantScope(String deploymentName, ScopedDeployment parameters) {
return this.beginCreateOrUpdateAtTenantScopeAsync(deploymentName, parameters).getSyncPoller();
}
/**
* Deploys resources at tenant scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the operation.
* @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 deployment information.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DeploymentExtendedInner>
beginCreateOrUpdateAtTenantScope(String deploymentName, ScopedDeployment parameters, Context context) {
return this.beginCreateOrUpdateAtTenantScopeAsync(deploymentName, parameters, context).getSyncPoller();
}
/**
* Deploys resources at tenant scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the 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 deployment information on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono createOrUpdateAtTenantScopeAsync(String deploymentName,
ScopedDeployment parameters) {
return beginCreateOrUpdateAtTenantScopeAsync(deploymentName, parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deploys resources at tenant scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the operation.
* @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 deployment information on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createOrUpdateAtTenantScopeAsync(String deploymentName,
ScopedDeployment parameters, Context context) {
return beginCreateOrUpdateAtTenantScopeAsync(deploymentName, parameters, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deploys resources at tenant scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the 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 deployment information.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DeploymentExtendedInner createOrUpdateAtTenantScope(String deploymentName, ScopedDeployment parameters) {
return createOrUpdateAtTenantScopeAsync(deploymentName, parameters).block();
}
/**
* Deploys resources at tenant scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the operation.
* @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 deployment information.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DeploymentExtendedInner createOrUpdateAtTenantScope(String deploymentName, ScopedDeployment parameters,
Context context) {
return createOrUpdateAtTenantScopeAsync(deploymentName, parameters, context).block();
}
/**
* Gets a deployment.
*
* @param deploymentName The name of the deployment.
* @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 deployment along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getAtTenantScopeWithResponseAsync(String deploymentName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getAtTenantScope(this.client.getEndpoint(), deploymentName,
this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets a deployment.
*
* @param deploymentName The name of the deployment.
* @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 deployment along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getAtTenantScopeWithResponseAsync(String deploymentName,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getAtTenantScope(this.client.getEndpoint(), deploymentName, this.client.getApiVersion(), accept,
context);
}
/**
* Gets a deployment.
*
* @param deploymentName The name of the deployment.
* @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 deployment on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono getAtTenantScopeAsync(String deploymentName) {
return getAtTenantScopeWithResponseAsync(deploymentName).flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Gets a deployment.
*
* @param deploymentName The name of the deployment.
* @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 deployment along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getAtTenantScopeWithResponse(String deploymentName, Context context) {
return getAtTenantScopeWithResponseAsync(deploymentName, context).block();
}
/**
* Gets a deployment.
*
* @param deploymentName The name of the deployment.
* @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 deployment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DeploymentExtendedInner getAtTenantScope(String deploymentName) {
return getAtTenantScopeWithResponse(deploymentName, Context.NONE).getValue();
}
/**
* Cancels a currently running template deployment.
*
* You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is
* canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running
* template deployment and leaves the resources partially deployed.
*
* @param deploymentName The name of the deployment.
* @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)
public Mono> cancelAtTenantScopeWithResponseAsync(String deploymentName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.cancelAtTenantScope(this.client.getEndpoint(), deploymentName,
this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Cancels a currently running template deployment.
*
* You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is
* canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running
* template deployment and leaves the resources partially deployed.
*
* @param deploymentName The name of the deployment.
* @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> cancelAtTenantScopeWithResponseAsync(String deploymentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.cancelAtTenantScope(this.client.getEndpoint(), deploymentName, this.client.getApiVersion(),
accept, context);
}
/**
* Cancels a currently running template deployment.
*
* You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is
* canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running
* template deployment and leaves the resources partially deployed.
*
* @param deploymentName The name of the deployment.
* @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)
public Mono cancelAtTenantScopeAsync(String deploymentName) {
return cancelAtTenantScopeWithResponseAsync(deploymentName).flatMap(ignored -> Mono.empty());
}
/**
* Cancels a currently running template deployment.
*
* You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is
* canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running
* template deployment and leaves the resources partially deployed.
*
* @param deploymentName The name of the deployment.
* @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 cancelAtTenantScopeWithResponse(String deploymentName, Context context) {
return cancelAtTenantScopeWithResponseAsync(deploymentName, context).block();
}
/**
* Cancels a currently running template deployment.
*
* You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is
* canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running
* template deployment and leaves the resources partially deployed.
*
* @param deploymentName The name of the deployment.
* @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 cancelAtTenantScope(String deploymentName) {
cancelAtTenantScopeWithResponse(deploymentName, Context.NONE);
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response along with {@link Response} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> validateAtTenantScopeWithResponseAsync(String deploymentName,
ScopedDeployment parameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.validateAtTenantScope(this.client.getEndpoint(), deploymentName,
this.client.getApiVersion(), parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response along with {@link Response} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> validateAtTenantScopeWithResponseAsync(String deploymentName,
ScopedDeployment parameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.validateAtTenantScope(this.client.getEndpoint(), deploymentName, this.client.getApiVersion(),
parameters, accept, context);
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, DeploymentValidateResultInner>
beginValidateAtTenantScopeAsync(String deploymentName, ScopedDeployment parameters) {
Mono>> mono = validateAtTenantScopeWithResponseAsync(deploymentName, parameters);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DeploymentValidateResultInner.class, DeploymentValidateResultInner.class,
this.client.getContext());
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DeploymentValidateResultInner>
beginValidateAtTenantScopeAsync(String deploymentName, ScopedDeployment parameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= validateAtTenantScopeWithResponseAsync(deploymentName, parameters, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DeploymentValidateResultInner.class, DeploymentValidateResultInner.class,
context);
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DeploymentValidateResultInner>
beginValidateAtTenantScope(String deploymentName, ScopedDeployment parameters) {
return this.beginValidateAtTenantScopeAsync(deploymentName, parameters).getSyncPoller();
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DeploymentValidateResultInner>
beginValidateAtTenantScope(String deploymentName, ScopedDeployment parameters, Context context) {
return this.beginValidateAtTenantScopeAsync(deploymentName, parameters, context).getSyncPoller();
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono validateAtTenantScopeAsync(String deploymentName,
ScopedDeployment parameters) {
return beginValidateAtTenantScopeAsync(deploymentName, parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono validateAtTenantScopeAsync(String deploymentName,
ScopedDeployment parameters, Context context) {
return beginValidateAtTenantScopeAsync(deploymentName, parameters, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DeploymentValidateResultInner validateAtTenantScope(String deploymentName, ScopedDeployment parameters) {
return validateAtTenantScopeAsync(deploymentName, parameters).block();
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DeploymentValidateResultInner validateAtTenantScope(String deploymentName, ScopedDeployment parameters,
Context context) {
return validateAtTenantScopeAsync(deploymentName, parameters, context).block();
}
/**
* Returns changes that will be made by the deployment if executed at the scope of the tenant group.
*
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 result of the What-If operation along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> whatIfAtTenantScopeWithResponseAsync(String deploymentName,
ScopedDeploymentWhatIf parameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.whatIfAtTenantScope(this.client.getEndpoint(), deploymentName,
this.client.getApiVersion(), parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Returns changes that will be made by the deployment if executed at the scope of the tenant group.
*
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 result of the What-If operation along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> whatIfAtTenantScopeWithResponseAsync(String deploymentName,
ScopedDeploymentWhatIf parameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.whatIfAtTenantScope(this.client.getEndpoint(), deploymentName, this.client.getApiVersion(),
parameters, accept, context);
}
/**
* Returns changes that will be made by the deployment if executed at the scope of the tenant group.
*
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 result of the What-If operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, WhatIfOperationResultInner>
beginWhatIfAtTenantScopeAsync(String deploymentName, ScopedDeploymentWhatIf parameters) {
Mono>> mono = whatIfAtTenantScopeWithResponseAsync(deploymentName, parameters);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), WhatIfOperationResultInner.class, WhatIfOperationResultInner.class,
this.client.getContext());
}
/**
* Returns changes that will be made by the deployment if executed at the scope of the tenant group.
*
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 result of the What-If operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, WhatIfOperationResultInner>
beginWhatIfAtTenantScopeAsync(String deploymentName, ScopedDeploymentWhatIf parameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= whatIfAtTenantScopeWithResponseAsync(deploymentName, parameters, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), WhatIfOperationResultInner.class, WhatIfOperationResultInner.class, context);
}
/**
* Returns changes that will be made by the deployment if executed at the scope of the tenant group.
*
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 result of the What-If operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, WhatIfOperationResultInner>
beginWhatIfAtTenantScope(String deploymentName, ScopedDeploymentWhatIf parameters) {
return this.beginWhatIfAtTenantScopeAsync(deploymentName, parameters).getSyncPoller();
}
/**
* Returns changes that will be made by the deployment if executed at the scope of the tenant group.
*
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 result of the What-If operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, WhatIfOperationResultInner>
beginWhatIfAtTenantScope(String deploymentName, ScopedDeploymentWhatIf parameters, Context context) {
return this.beginWhatIfAtTenantScopeAsync(deploymentName, parameters, context).getSyncPoller();
}
/**
* Returns changes that will be made by the deployment if executed at the scope of the tenant group.
*
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 result of the What-If operation on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono whatIfAtTenantScopeAsync(String deploymentName,
ScopedDeploymentWhatIf parameters) {
return beginWhatIfAtTenantScopeAsync(deploymentName, parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Returns changes that will be made by the deployment if executed at the scope of the tenant group.
*
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 result of the What-If operation on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono whatIfAtTenantScopeAsync(String deploymentName,
ScopedDeploymentWhatIf parameters, Context context) {
return beginWhatIfAtTenantScopeAsync(deploymentName, parameters, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Returns changes that will be made by the deployment if executed at the scope of the tenant group.
*
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 result of the What-If operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WhatIfOperationResultInner whatIfAtTenantScope(String deploymentName, ScopedDeploymentWhatIf parameters) {
return whatIfAtTenantScopeAsync(deploymentName, parameters).block();
}
/**
* Returns changes that will be made by the deployment if executed at the scope of the tenant group.
*
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 result of the What-If operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WhatIfOperationResultInner whatIfAtTenantScope(String deploymentName, ScopedDeploymentWhatIf parameters,
Context context) {
return whatIfAtTenantScopeAsync(deploymentName, parameters, context).block();
}
/**
* Exports the template used for specified deployment.
*
* @param deploymentName The name of the deployment.
* @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 deployment export result along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>
exportTemplateAtTenantScopeWithResponseAsync(String deploymentName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.exportTemplateAtTenantScope(this.client.getEndpoint(), deploymentName,
this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Exports the template used for specified deployment.
*
* @param deploymentName The name of the deployment.
* @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 deployment export result along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
exportTemplateAtTenantScopeWithResponseAsync(String deploymentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.exportTemplateAtTenantScope(this.client.getEndpoint(), deploymentName,
this.client.getApiVersion(), accept, context);
}
/**
* Exports the template used for specified deployment.
*
* @param deploymentName The name of the deployment.
* @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 deployment export result on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono exportTemplateAtTenantScopeAsync(String deploymentName) {
return exportTemplateAtTenantScopeWithResponseAsync(deploymentName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Exports the template used for specified deployment.
*
* @param deploymentName The name of the deployment.
* @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 deployment export result along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response exportTemplateAtTenantScopeWithResponse(String deploymentName,
Context context) {
return exportTemplateAtTenantScopeWithResponseAsync(deploymentName, context).block();
}
/**
* Exports the template used for specified deployment.
*
* @param deploymentName The name of the deployment.
* @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 deployment export result.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DeploymentExportResultInner exportTemplateAtTenantScope(String deploymentName) {
return exportTemplateAtTenantScopeWithResponse(deploymentName, Context.NONE).getValue();
}
/**
* Get all the deployments at the tenant scope.
*
* @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq
* '{state}'.
* @param top The number of results to get. If null is passed, returns all deployments.
* @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 all the deployments at the tenant scope along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listAtTenantScopeSinglePageAsync(String filter, Integer top) {
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.listAtTenantScope(this.client.getEndpoint(), filter, top,
this.client.getApiVersion(), 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 all the deployments at the tenant scope.
*
* @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq
* '{state}'.
* @param top The number of results to get. If null is passed, returns all deployments.
* @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 all the deployments at the tenant scope along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listAtTenantScopeSinglePageAsync(String filter, Integer top,
Context context) {
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
.listAtTenantScope(this.client.getEndpoint(), filter, top, this.client.getApiVersion(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Get all the deployments at the tenant scope.
*
* @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq
* '{state}'.
* @param top The number of results to get. If null is passed, returns all deployments.
* @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 all the deployments at the tenant scope as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux listAtTenantScopeAsync(String filter, Integer top) {
return new PagedFlux<>(() -> listAtTenantScopeSinglePageAsync(filter, top),
nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink));
}
/**
* Get all the deployments at the tenant scope.
*
* @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 all the deployments at the tenant scope as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux listAtTenantScopeAsync() {
final String filter = null;
final Integer top = null;
return new PagedFlux<>(() -> listAtTenantScopeSinglePageAsync(filter, top),
nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink));
}
/**
* Get all the deployments at the tenant scope.
*
* @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq
* '{state}'.
* @param top The number of results to get. If null is passed, returns all deployments.
* @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 all the deployments at the tenant scope as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAtTenantScopeAsync(String filter, Integer top, Context context) {
return new PagedFlux<>(() -> listAtTenantScopeSinglePageAsync(filter, top, context),
nextLink -> listAtTenantScopeNextSinglePageAsync(nextLink, context));
}
/**
* Get all the deployments at the tenant scope.
*
* @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 all the deployments at the tenant scope as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listAtTenantScope() {
final String filter = null;
final Integer top = null;
return new PagedIterable<>(listAtTenantScopeAsync(filter, top));
}
/**
* Get all the deployments at the tenant scope.
*
* @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq
* '{state}'.
* @param top The number of results to get. If null is passed, returns all deployments.
* @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 all the deployments at the tenant scope as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listAtTenantScope(String filter, Integer top, Context context) {
return new PagedIterable<>(listAtTenantScopeAsync(filter, top, context));
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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)
public Mono>> deleteAtManagementGroupScopeWithResponseAsync(String groupId,
String deploymentName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (groupId == null) {
return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.deleteAtManagementGroupScope(this.client.getEndpoint(), groupId,
deploymentName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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>> deleteAtManagementGroupScopeWithResponseAsync(String groupId,
String deploymentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (groupId == null) {
return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.deleteAtManagementGroupScope(this.client.getEndpoint(), groupId, deploymentName,
this.client.getApiVersion(), accept, context);
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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)
public PollerFlux, Void> beginDeleteAtManagementGroupScopeAsync(String groupId,
String deploymentName) {
Mono>> mono = deleteAtManagementGroupScopeWithResponseAsync(groupId, deploymentName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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> beginDeleteAtManagementGroupScopeAsync(String groupId,
String deploymentName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= deleteAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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> beginDeleteAtManagementGroupScope(String groupId, String deploymentName) {
return this.beginDeleteAtManagementGroupScopeAsync(groupId, deploymentName).getSyncPoller();
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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> beginDeleteAtManagementGroupScope(String groupId, String deploymentName,
Context context) {
return this.beginDeleteAtManagementGroupScopeAsync(groupId, deploymentName, context).getSyncPoller();
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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)
public Mono deleteAtManagementGroupScopeAsync(String groupId, String deploymentName) {
return beginDeleteAtManagementGroupScopeAsync(groupId, deploymentName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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 deleteAtManagementGroupScopeAsync(String groupId, String deploymentName, Context context) {
return beginDeleteAtManagementGroupScopeAsync(groupId, deploymentName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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 deleteAtManagementGroupScope(String groupId, String deploymentName) {
deleteAtManagementGroupScopeAsync(groupId, deploymentName).block();
}
/**
* Deletes a deployment from the deployment history.
*
* A template deployment that is currently running cannot be deleted. Deleting a template deployment removes the
* associated deployment operations. This is an asynchronous operation that returns a status of 202 until the
* template deployment is successfully deleted. The Location response header contains the URI that is used to obtain
* the status of the process. While the process is running, a call to the URI in the Location header returns a
* status of 202. When the process finishes, the URI in the Location header returns a status of 204 on success. If
* the asynchronous request failed, the URI in the Location header returns an error-level status code.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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 deleteAtManagementGroupScope(String groupId, String deploymentName, Context context) {
deleteAtManagementGroupScopeAsync(groupId, deploymentName, context).block();
}
/**
* Checks whether the deployment exists.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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 whether resource exists along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> checkExistenceAtManagementGroupScopeWithResponseAsync(String groupId,
String deploymentName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (groupId == null) {
return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.checkExistenceAtManagementGroupScope(this.client.getEndpoint(), groupId,
deploymentName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Checks whether the deployment exists.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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 whether resource exists along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> checkExistenceAtManagementGroupScopeWithResponseAsync(String groupId,
String deploymentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (groupId == null) {
return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.checkExistenceAtManagementGroupScope(this.client.getEndpoint(), groupId, deploymentName,
this.client.getApiVersion(), accept, context);
}
/**
* Checks whether the deployment exists.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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 whether resource exists on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono checkExistenceAtManagementGroupScopeAsync(String groupId, String deploymentName) {
return checkExistenceAtManagementGroupScopeWithResponseAsync(groupId, deploymentName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Checks whether the deployment exists.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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 whether resource exists along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response checkExistenceAtManagementGroupScopeWithResponse(String groupId, String deploymentName,
Context context) {
return checkExistenceAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context).block();
}
/**
* Checks whether the deployment exists.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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 whether resource exists.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public boolean checkExistenceAtManagementGroupScope(String groupId, String deploymentName) {
return checkExistenceAtManagementGroupScopeWithResponse(groupId, deploymentName, Context.NONE).getValue();
}
/**
* Deploys resources at management group scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the 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 deployment information along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> createOrUpdateAtManagementGroupScopeWithResponseAsync(String groupId,
String deploymentName, ScopedDeployment parameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (groupId == null) {
return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createOrUpdateAtManagementGroupScope(this.client.getEndpoint(), groupId,
deploymentName, this.client.getApiVersion(), parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Deploys resources at management group scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the operation.
* @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 deployment information along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createOrUpdateAtManagementGroupScopeWithResponseAsync(String groupId,
String deploymentName, ScopedDeployment parameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (groupId == null) {
return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createOrUpdateAtManagementGroupScope(this.client.getEndpoint(), groupId, deploymentName,
this.client.getApiVersion(), parameters, accept, context);
}
/**
* Deploys resources at management group scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the 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 deployment information.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, DeploymentExtendedInner>
beginCreateOrUpdateAtManagementGroupScopeAsync(String groupId, String deploymentName,
ScopedDeployment parameters) {
Mono>> mono
= createOrUpdateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DeploymentExtendedInner.class, DeploymentExtendedInner.class,
this.client.getContext());
}
/**
* Deploys resources at management group scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the operation.
* @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 deployment information.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DeploymentExtendedInner>
beginCreateOrUpdateAtManagementGroupScopeAsync(String groupId, String deploymentName,
ScopedDeployment parameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= createOrUpdateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DeploymentExtendedInner.class, DeploymentExtendedInner.class, context);
}
/**
* Deploys resources at management group scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the 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 deployment information.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DeploymentExtendedInner>
beginCreateOrUpdateAtManagementGroupScope(String groupId, String deploymentName, ScopedDeployment parameters) {
return this.beginCreateOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).getSyncPoller();
}
/**
* Deploys resources at management group scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the operation.
* @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 deployment information.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DeploymentExtendedInner>
beginCreateOrUpdateAtManagementGroupScope(String groupId, String deploymentName, ScopedDeployment parameters,
Context context) {
return this.beginCreateOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context)
.getSyncPoller();
}
/**
* Deploys resources at management group scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the 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 deployment information on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono createOrUpdateAtManagementGroupScopeAsync(String groupId,
String deploymentName, ScopedDeployment parameters) {
return beginCreateOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deploys resources at management group scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the operation.
* @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 deployment information on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createOrUpdateAtManagementGroupScopeAsync(String groupId,
String deploymentName, ScopedDeployment parameters, Context context) {
return beginCreateOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deploys resources at management group scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the 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 deployment information.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DeploymentExtendedInner createOrUpdateAtManagementGroupScope(String groupId, String deploymentName,
ScopedDeployment parameters) {
return createOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).block();
}
/**
* Deploys resources at management group scope.
*
* You can provide the template and parameters directly in the request or link to JSON files.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Additional parameters supplied to the operation.
* @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 deployment information.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DeploymentExtendedInner createOrUpdateAtManagementGroupScope(String groupId, String deploymentName,
ScopedDeployment parameters, Context context) {
return createOrUpdateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).block();
}
/**
* Gets a deployment.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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 deployment along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getAtManagementGroupScopeWithResponseAsync(String groupId,
String deploymentName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (groupId == null) {
return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getAtManagementGroupScope(this.client.getEndpoint(), groupId,
deploymentName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets a deployment.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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 deployment along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getAtManagementGroupScopeWithResponseAsync(String groupId,
String deploymentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (groupId == null) {
return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getAtManagementGroupScope(this.client.getEndpoint(), groupId, deploymentName,
this.client.getApiVersion(), accept, context);
}
/**
* Gets a deployment.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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 deployment on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono getAtManagementGroupScopeAsync(String groupId, String deploymentName) {
return getAtManagementGroupScopeWithResponseAsync(groupId, deploymentName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Gets a deployment.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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 deployment along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getAtManagementGroupScopeWithResponse(String groupId,
String deploymentName, Context context) {
return getAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context).block();
}
/**
* Gets a deployment.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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 deployment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DeploymentExtendedInner getAtManagementGroupScope(String groupId, String deploymentName) {
return getAtManagementGroupScopeWithResponse(groupId, deploymentName, Context.NONE).getValue();
}
/**
* Cancels a currently running template deployment.
*
* You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is
* canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running
* template deployment and leaves the resources partially deployed.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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)
public Mono> cancelAtManagementGroupScopeWithResponseAsync(String groupId, String deploymentName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (groupId == null) {
return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.cancelAtManagementGroupScope(this.client.getEndpoint(), groupId,
deploymentName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Cancels a currently running template deployment.
*
* You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is
* canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running
* template deployment and leaves the resources partially deployed.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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> cancelAtManagementGroupScopeWithResponseAsync(String groupId, String deploymentName,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (groupId == null) {
return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.cancelAtManagementGroupScope(this.client.getEndpoint(), groupId, deploymentName,
this.client.getApiVersion(), accept, context);
}
/**
* Cancels a currently running template deployment.
*
* You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is
* canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running
* template deployment and leaves the resources partially deployed.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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)
public Mono cancelAtManagementGroupScopeAsync(String groupId, String deploymentName) {
return cancelAtManagementGroupScopeWithResponseAsync(groupId, deploymentName).flatMap(ignored -> Mono.empty());
}
/**
* Cancels a currently running template deployment.
*
* You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is
* canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running
* template deployment and leaves the resources partially deployed.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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 cancelAtManagementGroupScopeWithResponse(String groupId, String deploymentName,
Context context) {
return cancelAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context).block();
}
/**
* Cancels a currently running template deployment.
*
* You can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is
* canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running
* template deployment and leaves the resources partially deployed.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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 cancelAtManagementGroupScope(String groupId, String deploymentName) {
cancelAtManagementGroupScopeWithResponse(groupId, deploymentName, Context.NONE);
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response along with {@link Response} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> validateAtManagementGroupScopeWithResponseAsync(String groupId,
String deploymentName, ScopedDeployment parameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (groupId == null) {
return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.validateAtManagementGroupScope(this.client.getEndpoint(), groupId,
deploymentName, this.client.getApiVersion(), parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response along with {@link Response} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> validateAtManagementGroupScopeWithResponseAsync(String groupId,
String deploymentName, ScopedDeployment parameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (groupId == null) {
return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.validateAtManagementGroupScope(this.client.getEndpoint(), groupId, deploymentName,
this.client.getApiVersion(), parameters, accept, context);
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, DeploymentValidateResultInner>
beginValidateAtManagementGroupScopeAsync(String groupId, String deploymentName, ScopedDeployment parameters) {
Mono>> mono
= validateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DeploymentValidateResultInner.class, DeploymentValidateResultInner.class,
this.client.getContext());
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DeploymentValidateResultInner>
beginValidateAtManagementGroupScopeAsync(String groupId, String deploymentName, ScopedDeployment parameters,
Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= validateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), DeploymentValidateResultInner.class, DeploymentValidateResultInner.class,
context);
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DeploymentValidateResultInner>
beginValidateAtManagementGroupScope(String groupId, String deploymentName, ScopedDeployment parameters) {
return this.beginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).getSyncPoller();
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DeploymentValidateResultInner>
beginValidateAtManagementGroupScope(String groupId, String deploymentName, ScopedDeployment parameters,
Context context) {
return this.beginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context)
.getSyncPoller();
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono validateAtManagementGroupScopeAsync(String groupId,
String deploymentName, ScopedDeployment parameters) {
return beginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono validateAtManagementGroupScopeAsync(String groupId,
String deploymentName, ScopedDeployment parameters, Context context) {
return beginValidateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DeploymentValidateResultInner validateAtManagementGroupScope(String groupId, String deploymentName,
ScopedDeployment parameters) {
return validateAtManagementGroupScopeAsync(groupId, deploymentName, parameters).block();
}
/**
* Validates whether the specified template is syntactically correct and will be accepted by Azure Resource
* Manager..
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 information from validate template deployment response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DeploymentValidateResultInner validateAtManagementGroupScope(String groupId, String deploymentName,
ScopedDeployment parameters, Context context) {
return validateAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).block();
}
/**
* Returns changes that will be made by the deployment if executed at the scope of the management group.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 result of the What-If operation along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> whatIfAtManagementGroupScopeWithResponseAsync(String groupId,
String deploymentName, ScopedDeploymentWhatIf parameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (groupId == null) {
return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.whatIfAtManagementGroupScope(this.client.getEndpoint(), groupId,
deploymentName, this.client.getApiVersion(), parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Returns changes that will be made by the deployment if executed at the scope of the management group.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 result of the What-If operation along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> whatIfAtManagementGroupScopeWithResponseAsync(String groupId,
String deploymentName, ScopedDeploymentWhatIf parameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (groupId == null) {
return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
if (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.whatIfAtManagementGroupScope(this.client.getEndpoint(), groupId, deploymentName,
this.client.getApiVersion(), parameters, accept, context);
}
/**
* Returns changes that will be made by the deployment if executed at the scope of the management group.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 result of the What-If operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, WhatIfOperationResultInner>
beginWhatIfAtManagementGroupScopeAsync(String groupId, String deploymentName,
ScopedDeploymentWhatIf parameters) {
Mono>> mono
= whatIfAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), WhatIfOperationResultInner.class, WhatIfOperationResultInner.class,
this.client.getContext());
}
/**
* Returns changes that will be made by the deployment if executed at the scope of the management group.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 result of the What-If operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, WhatIfOperationResultInner>
beginWhatIfAtManagementGroupScopeAsync(String groupId, String deploymentName, ScopedDeploymentWhatIf parameters,
Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= whatIfAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, parameters, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), WhatIfOperationResultInner.class, WhatIfOperationResultInner.class, context);
}
/**
* Returns changes that will be made by the deployment if executed at the scope of the management group.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 result of the What-If operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, WhatIfOperationResultInner>
beginWhatIfAtManagementGroupScope(String groupId, String deploymentName, ScopedDeploymentWhatIf parameters) {
return this.beginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters).getSyncPoller();
}
/**
* Returns changes that will be made by the deployment if executed at the scope of the management group.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 result of the What-If operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, WhatIfOperationResultInner>
beginWhatIfAtManagementGroupScope(String groupId, String deploymentName, ScopedDeploymentWhatIf parameters,
Context context) {
return this.beginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context)
.getSyncPoller();
}
/**
* Returns changes that will be made by the deployment if executed at the scope of the management group.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 result of the What-If operation on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono whatIfAtManagementGroupScopeAsync(String groupId, String deploymentName,
ScopedDeploymentWhatIf parameters) {
return beginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Returns changes that will be made by the deployment if executed at the scope of the management group.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 result of the What-If operation on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono whatIfAtManagementGroupScopeAsync(String groupId, String deploymentName,
ScopedDeploymentWhatIf parameters, Context context) {
return beginWhatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Returns changes that will be made by the deployment if executed at the scope of the management group.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 result of the What-If operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WhatIfOperationResultInner whatIfAtManagementGroupScope(String groupId, String deploymentName,
ScopedDeploymentWhatIf parameters) {
return whatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters).block();
}
/**
* Returns changes that will be made by the deployment if executed at the scope of the management group.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @param parameters Parameters to validate.
* @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 result of the What-If operation.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public WhatIfOperationResultInner whatIfAtManagementGroupScope(String groupId, String deploymentName,
ScopedDeploymentWhatIf parameters, Context context) {
return whatIfAtManagementGroupScopeAsync(groupId, deploymentName, parameters, context).block();
}
/**
* Exports the template used for specified deployment.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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 deployment export result along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>
exportTemplateAtManagementGroupScopeWithResponseAsync(String groupId, String deploymentName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (groupId == null) {
return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.exportTemplateAtManagementGroupScope(this.client.getEndpoint(), groupId,
deploymentName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Exports the template used for specified deployment.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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 deployment export result along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
exportTemplateAtManagementGroupScopeWithResponseAsync(String groupId, String deploymentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (groupId == null) {
return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
}
if (deploymentName == null) {
return Mono.error(new IllegalArgumentException("Parameter deploymentName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.exportTemplateAtManagementGroupScope(this.client.getEndpoint(), groupId, deploymentName,
this.client.getApiVersion(), accept, context);
}
/**
* Exports the template used for specified deployment.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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 deployment export result on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono exportTemplateAtManagementGroupScopeAsync(String groupId,
String deploymentName) {
return exportTemplateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Exports the template used for specified deployment.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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 deployment export result along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response exportTemplateAtManagementGroupScopeWithResponse(String groupId,
String deploymentName, Context context) {
return exportTemplateAtManagementGroupScopeWithResponseAsync(groupId, deploymentName, context).block();
}
/**
* Exports the template used for specified deployment.
*
* @param groupId The management group ID.
* @param deploymentName The name of the deployment.
* @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 deployment export result.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DeploymentExportResultInner exportTemplateAtManagementGroupScope(String groupId, String deploymentName) {
return exportTemplateAtManagementGroupScopeWithResponse(groupId, deploymentName, Context.NONE).getValue();
}
/**
* Get all the deployments for a management group.
*
* @param groupId The management group ID.
* @param filter The filter to apply on the operation. For example, you can use $filter=provisioningState eq
* '{state}'.
* @param top The number of results to get. If null is passed, returns all deployments.
* @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 all the deployments for a management group along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listAtManagementGroupScopeSinglePageAsync(String groupId,
String filter, Integer top) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (groupId == null) {
return Mono.error(new IllegalArgumentException("Parameter groupId is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listAtManagementGroupScope(this.client.getEndpoint(), groupId, filter, top,
this.client.getApiVersion(), accept, context))
.