
com.azure.resourcemanager.appcontainers.implementation.ContainerAppsClientImpl Maven / Gradle / Ivy
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.appcontainers.implementation;
import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.Delete;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Headers;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.Patch;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.Post;
import com.azure.core.annotation.Put;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
import com.azure.core.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.appcontainers.fluent.ContainerAppsClient;
import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppAuthTokenInner;
import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppInner;
import com.azure.resourcemanager.appcontainers.fluent.models.CustomHostnameAnalysisResultInner;
import com.azure.resourcemanager.appcontainers.fluent.models.SecretsCollectionInner;
import com.azure.resourcemanager.appcontainers.models.ContainerAppCollection;
import com.azure.resourcemanager.appcontainers.models.DefaultErrorResponseErrorException;
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 ContainerAppsClient.
*/
public final class ContainerAppsClientImpl implements ContainerAppsClient {
/**
* The proxy service used to perform REST calls.
*/
private final ContainerAppsService service;
/**
* The service client containing this operation class.
*/
private final ContainerAppsApiClientImpl client;
/**
* Initializes an instance of ContainerAppsClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
ContainerAppsClientImpl(ContainerAppsApiClientImpl client) {
this.service
= RestProxy.create(ContainerAppsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}
/**
* The interface defining all the services for ContainerAppsApiClientContainerApps to be used by the proxy service
* to perform REST calls.
*/
@Host("{$host}")
@ServiceInterface(name = "ContainerAppsApiClie")
public interface ContainerAppsService {
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/containerApps")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class)
Mono> list(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class)
Mono> listByResourceGroup(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ManagementException.class, code = { 404 })
@UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class)
Mono> getByResourceGroup(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class)
Mono>> createOrUpdate(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion,
@BodyParam("application/json") ContainerAppInner containerAppEnvelope, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}")
@ExpectedResponses({ 200, 202, 204 })
@UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class)
Mono>> delete(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class)
Mono>> update(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("containerAppName") String containerAppName, @QueryParam("api-version") String apiVersion,
@BodyParam("application/json") ContainerAppInner containerAppEnvelope, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/listCustomHostNameAnalysis")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class)
Mono> listCustomHostnameAnalysis(
@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("containerAppName") String containerAppName, @QueryParam("customHostname") String customHostname,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/listSecrets")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class)
Mono> listSecrets(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion,
@PathParam("containerAppName") String containerAppName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/getAuthtoken")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(value = ManagementException.class, code = { 404 })
@UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class)
Mono> getAuthToken(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion,
@PathParam("containerAppName") String containerAppName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/start")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class)
Mono>> start(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion,
@PathParam("containerAppName") String containerAppName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/stop")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class)
Mono>> stop(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion,
@PathParam("containerAppName") String containerAppName, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class)
Mono> listBySubscriptionNext(
@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(DefaultErrorResponseErrorException.class)
Mono> listByResourceGroupNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
@HeaderParam("Accept") String accept, Context context);
}
/**
* Get the Container Apps in a given subscription.
*
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the Container Apps in a given subscription along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync() {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(),
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 the Container Apps in a given subscription.
*
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the Container Apps in a given subscription along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept,
context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Get the Container Apps in a given subscription.
*
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the Container Apps in a given subscription as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync() {
return new PagedFlux<>(() -> listSinglePageAsync(),
nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
}
/**
* Get the Container Apps in a given subscription.
*
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the Container Apps in a given subscription as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(Context context) {
return new PagedFlux<>(() -> listSinglePageAsync(context),
nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context));
}
/**
* Get the Container Apps in a given subscription.
*
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the Container Apps in a given subscription as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list() {
return new PagedIterable<>(listAsync());
}
/**
* Get the Container Apps in a given subscription.
*
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the Container Apps in a given subscription as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(Context context) {
return new PagedIterable<>(listAsync(context));
}
/**
* Get the Container Apps in a given resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the Container Apps in a given resource group along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listByResourceGroup(this.client.getEndpoint(),
this.client.getSubscriptionId(), resourceGroupName, 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 the Container Apps in a given resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the Container Apps in a given resource group along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
this.client.getApiVersion(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Get the Container Apps in a given resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the Container Apps in a given resource group as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName),
nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
}
/**
* Get the Container Apps in a given resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the Container Apps in a given resource group as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) {
return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context));
}
/**
* Get the Container Apps in a given resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the Container Apps in a given resource group as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByResourceGroup(String resourceGroupName) {
return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
}
/**
* Get the Container Apps in a given resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the Container Apps in a given resource group as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
}
/**
* Get the properties of a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws ManagementException thrown if the request is rejected by server on status code 404.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the properties of a Container App along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName,
String containerAppName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (containerAppName == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, containerAppName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get the properties of a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws ManagementException thrown if the request is rejected by server on status code 404.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the properties of a Container App along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName,
String containerAppName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (containerAppName == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
containerAppName, this.client.getApiVersion(), accept, context);
}
/**
* Get the properties of a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws ManagementException thrown if the request is rejected by server on status code 404.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the properties of a Container App on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getByResourceGroupAsync(String resourceGroupName, String containerAppName) {
return getByResourceGroupWithResponseAsync(resourceGroupName, containerAppName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Get the properties of a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws ManagementException thrown if the request is rejected by server on status code 404.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the properties of a Container App along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getByResourceGroupWithResponse(String resourceGroupName, String containerAppName,
Context context) {
return getByResourceGroupWithResponseAsync(resourceGroupName, containerAppName, context).block();
}
/**
* Get the properties of a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws ManagementException thrown if the request is rejected by server on status code 404.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the properties of a Container App.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ContainerAppInner getByResourceGroup(String resourceGroupName, String containerAppName) {
return getByResourceGroupWithResponse(resourceGroupName, containerAppName, Context.NONE).getValue();
}
/**
* Create or update a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param containerAppEnvelope Properties used to create a container app.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
String containerAppName, ContainerAppInner containerAppEnvelope) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (containerAppName == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null."));
}
if (containerAppEnvelope == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppEnvelope is required and cannot be null."));
} else {
containerAppEnvelope.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, containerAppName, this.client.getApiVersion(), containerAppEnvelope, accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Create or update a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param containerAppEnvelope Properties used to create a container app.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
String containerAppName, ContainerAppInner containerAppEnvelope, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (containerAppName == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null."));
}
if (containerAppEnvelope == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppEnvelope is required and cannot be null."));
} else {
containerAppEnvelope.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
containerAppName, this.client.getApiVersion(), containerAppEnvelope, accept, context);
}
/**
* Create or update a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param containerAppEnvelope Properties used to create a container app.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException 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 container App.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ContainerAppInner> beginCreateOrUpdateAsync(
String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope) {
Mono>> mono
= createOrUpdateWithResponseAsync(resourceGroupName, containerAppName, containerAppEnvelope);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
ContainerAppInner.class, ContainerAppInner.class, this.client.getContext());
}
/**
* Create or update a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param containerAppEnvelope Properties used to create a container app.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException 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 container App.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ContainerAppInner> beginCreateOrUpdateAsync(
String resourceGroupName, String containerAppName, ContainerAppInner containerAppEnvelope, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= createOrUpdateWithResponseAsync(resourceGroupName, containerAppName, containerAppEnvelope, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
ContainerAppInner.class, ContainerAppInner.class, context);
}
/**
* Create or update a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param containerAppEnvelope Properties used to create a container app.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException 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 container App.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ContainerAppInner> beginCreateOrUpdate(String resourceGroupName,
String containerAppName, ContainerAppInner containerAppEnvelope) {
return this.beginCreateOrUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope).getSyncPoller();
}
/**
* Create or update a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param containerAppEnvelope Properties used to create a container app.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException 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 container App.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ContainerAppInner> beginCreateOrUpdate(String resourceGroupName,
String containerAppName, ContainerAppInner containerAppEnvelope, Context context) {
return this.beginCreateOrUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope, context)
.getSyncPoller();
}
/**
* Create or update a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param containerAppEnvelope Properties used to create a container app.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createOrUpdateAsync(String resourceGroupName, String containerAppName,
ContainerAppInner containerAppEnvelope) {
return beginCreateOrUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create or update a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param containerAppEnvelope Properties used to create a container app.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createOrUpdateAsync(String resourceGroupName, String containerAppName,
ContainerAppInner containerAppEnvelope, Context context) {
return beginCreateOrUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create or update a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param containerAppEnvelope Properties used to create a container app.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ContainerAppInner createOrUpdate(String resourceGroupName, String containerAppName,
ContainerAppInner containerAppEnvelope) {
return createOrUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope).block();
}
/**
* Create or update a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param containerAppEnvelope Properties used to create a container app.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ContainerAppInner createOrUpdate(String resourceGroupName, String containerAppName,
ContainerAppInner containerAppEnvelope, Context context) {
return createOrUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope, context).block();
}
/**
* Delete a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deleteWithResponseAsync(String resourceGroupName,
String containerAppName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (containerAppName == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, containerAppName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Delete a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deleteWithResponseAsync(String resourceGroupName, String containerAppName,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (containerAppName == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
containerAppName, this.client.getApiVersion(), accept, context);
}
/**
* Delete a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String containerAppName) {
Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerAppName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Delete a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String containerAppName,
Context context) {
context = this.client.mergeContext(context);
Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerAppName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Delete a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDelete(String resourceGroupName, String containerAppName) {
return this.beginDeleteAsync(resourceGroupName, containerAppName).getSyncPoller();
}
/**
* Delete a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDelete(String resourceGroupName, String containerAppName,
Context context) {
return this.beginDeleteAsync(resourceGroupName, containerAppName, context).getSyncPoller();
}
/**
* Delete a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteAsync(String resourceGroupName, String containerAppName) {
return beginDeleteAsync(resourceGroupName, containerAppName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Delete a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteAsync(String resourceGroupName, String containerAppName, Context context) {
return beginDeleteAsync(resourceGroupName, containerAppName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Delete a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void delete(String resourceGroupName, String containerAppName) {
deleteAsync(resourceGroupName, containerAppName).block();
}
/**
* Delete a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void delete(String resourceGroupName, String containerAppName, Context context) {
deleteAsync(resourceGroupName, containerAppName, context).block();
}
/**
* Update properties of a Container App
*
* Patches a Container App using JSON Merge Patch.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param containerAppEnvelope Properties of a Container App that need to be updated.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updateWithResponseAsync(String resourceGroupName, String containerAppName,
ContainerAppInner containerAppEnvelope) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (containerAppName == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null."));
}
if (containerAppEnvelope == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppEnvelope is required and cannot be null."));
} else {
containerAppEnvelope.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
containerAppName, this.client.getApiVersion(), containerAppEnvelope, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Update properties of a Container App
*
* Patches a Container App using JSON Merge Patch.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param containerAppEnvelope Properties of a Container App that need to be updated.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updateWithResponseAsync(String resourceGroupName, String containerAppName,
ContainerAppInner containerAppEnvelope, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (containerAppName == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null."));
}
if (containerAppEnvelope == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppEnvelope is required and cannot be null."));
} else {
containerAppEnvelope.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
containerAppName, this.client.getApiVersion(), containerAppEnvelope, accept, context);
}
/**
* Update properties of a Container App
*
* Patches a Container App using JSON Merge Patch.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param containerAppEnvelope Properties of a Container App that need to be updated.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException 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 container App.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ContainerAppInner> beginUpdateAsync(String resourceGroupName,
String containerAppName, ContainerAppInner containerAppEnvelope) {
Mono>> mono
= updateWithResponseAsync(resourceGroupName, containerAppName, containerAppEnvelope);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
ContainerAppInner.class, ContainerAppInner.class, this.client.getContext());
}
/**
* Update properties of a Container App
*
* Patches a Container App using JSON Merge Patch.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param containerAppEnvelope Properties of a Container App that need to be updated.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException 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 container App.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ContainerAppInner> beginUpdateAsync(String resourceGroupName,
String containerAppName, ContainerAppInner containerAppEnvelope, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= updateWithResponseAsync(resourceGroupName, containerAppName, containerAppEnvelope, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
ContainerAppInner.class, ContainerAppInner.class, context);
}
/**
* Update properties of a Container App
*
* Patches a Container App using JSON Merge Patch.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param containerAppEnvelope Properties of a Container App that need to be updated.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException 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 container App.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ContainerAppInner> beginUpdate(String resourceGroupName,
String containerAppName, ContainerAppInner containerAppEnvelope) {
return this.beginUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope).getSyncPoller();
}
/**
* Update properties of a Container App
*
* Patches a Container App using JSON Merge Patch.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param containerAppEnvelope Properties of a Container App that need to be updated.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException 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 container App.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ContainerAppInner> beginUpdate(String resourceGroupName,
String containerAppName, ContainerAppInner containerAppEnvelope, Context context) {
return this.beginUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope, context)
.getSyncPoller();
}
/**
* Update properties of a Container App
*
* Patches a Container App using JSON Merge Patch.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param containerAppEnvelope Properties of a Container App that need to be updated.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateAsync(String resourceGroupName, String containerAppName,
ContainerAppInner containerAppEnvelope) {
return beginUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update properties of a Container App
*
* Patches a Container App using JSON Merge Patch.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param containerAppEnvelope Properties of a Container App that need to be updated.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateAsync(String resourceGroupName, String containerAppName,
ContainerAppInner containerAppEnvelope, Context context) {
return beginUpdateAsync(resourceGroupName, containerAppName, containerAppEnvelope, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update properties of a Container App
*
* Patches a Container App using JSON Merge Patch.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param containerAppEnvelope Properties of a Container App that need to be updated.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ContainerAppInner update(String resourceGroupName, String containerAppName,
ContainerAppInner containerAppEnvelope) {
return updateAsync(resourceGroupName, containerAppName, containerAppEnvelope).block();
}
/**
* Update properties of a Container App
*
* Patches a Container App using JSON Merge Patch.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param containerAppEnvelope Properties of a Container App that need to be updated.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ContainerAppInner update(String resourceGroupName, String containerAppName,
ContainerAppInner containerAppEnvelope, Context context) {
return updateAsync(resourceGroupName, containerAppName, containerAppEnvelope, context).block();
}
/**
* Analyzes a custom hostname for a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param customHostname Custom hostname.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return custom domain analysis along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listCustomHostnameAnalysisWithResponseAsync(
String resourceGroupName, String containerAppName, String customHostname) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (containerAppName == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listCustomHostnameAnalysis(this.client.getEndpoint(),
this.client.getSubscriptionId(), resourceGroupName, containerAppName, customHostname,
this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Analyzes a custom hostname for a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param customHostname Custom hostname.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return custom domain analysis along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listCustomHostnameAnalysisWithResponseAsync(
String resourceGroupName, String containerAppName, String customHostname, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (containerAppName == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listCustomHostnameAnalysis(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, containerAppName, customHostname, this.client.getApiVersion(), accept, context);
}
/**
* Analyzes a custom hostname for a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return custom domain analysis on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono listCustomHostnameAnalysisAsync(String resourceGroupName,
String containerAppName) {
final String customHostname = null;
return listCustomHostnameAnalysisWithResponseAsync(resourceGroupName, containerAppName, customHostname)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Analyzes a custom hostname for a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param customHostname Custom hostname.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return custom domain analysis along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response listCustomHostnameAnalysisWithResponse(String resourceGroupName,
String containerAppName, String customHostname, Context context) {
return listCustomHostnameAnalysisWithResponseAsync(resourceGroupName, containerAppName, customHostname, context)
.block();
}
/**
* Analyzes a custom hostname for a Container App.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return custom domain analysis.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public CustomHostnameAnalysisResultInner listCustomHostnameAnalysis(String resourceGroupName,
String containerAppName) {
final String customHostname = null;
return listCustomHostnameAnalysisWithResponse(resourceGroupName, containerAppName, customHostname, Context.NONE)
.getValue();
}
/**
* List secrets for a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App Secrets Collection ARM resource along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSecretsWithResponseAsync(String resourceGroupName,
String containerAppName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (containerAppName == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listSecrets(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, this.client.getApiVersion(), containerAppName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* List secrets for a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App Secrets Collection ARM resource along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSecretsWithResponseAsync(String resourceGroupName,
String containerAppName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (containerAppName == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listSecrets(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
this.client.getApiVersion(), containerAppName, accept, context);
}
/**
* List secrets for a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App Secrets Collection ARM resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono listSecretsAsync(String resourceGroupName, String containerAppName) {
return listSecretsWithResponseAsync(resourceGroupName, containerAppName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* List secrets for a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App Secrets Collection ARM resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response listSecretsWithResponse(String resourceGroupName, String containerAppName,
Context context) {
return listSecretsWithResponseAsync(resourceGroupName, containerAppName, context).block();
}
/**
* List secrets for a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App Secrets Collection ARM resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public SecretsCollectionInner listSecrets(String resourceGroupName, String containerAppName) {
return listSecretsWithResponse(resourceGroupName, containerAppName, Context.NONE).getValue();
}
/**
* Get auth token for a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws ManagementException thrown if the request is rejected by server on status code 404.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return auth token for a container app along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getAuthTokenWithResponseAsync(String resourceGroupName,
String containerAppName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (containerAppName == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getAuthToken(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, this.client.getApiVersion(), containerAppName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get auth token for a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws ManagementException thrown if the request is rejected by server on status code 404.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return auth token for a container app along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getAuthTokenWithResponseAsync(String resourceGroupName,
String containerAppName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (containerAppName == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getAuthToken(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
this.client.getApiVersion(), containerAppName, accept, context);
}
/**
* Get auth token for a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws ManagementException thrown if the request is rejected by server on status code 404.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return auth token for a container app on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getAuthTokenAsync(String resourceGroupName, String containerAppName) {
return getAuthTokenWithResponseAsync(resourceGroupName, containerAppName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Get auth token for a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws ManagementException thrown if the request is rejected by server on status code 404.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return auth token for a container app along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getAuthTokenWithResponse(String resourceGroupName,
String containerAppName, Context context) {
return getAuthTokenWithResponseAsync(resourceGroupName, containerAppName, context).block();
}
/**
* Get auth token for a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws ManagementException thrown if the request is rejected by server on status code 404.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return auth token for a container app.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ContainerAppAuthTokenInner getAuthToken(String resourceGroupName, String containerAppName) {
return getAuthTokenWithResponse(resourceGroupName, containerAppName, Context.NONE).getValue();
}
/**
* Start a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> startWithResponseAsync(String resourceGroupName, String containerAppName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (containerAppName == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.start(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, this.client.getApiVersion(), containerAppName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Start a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> startWithResponseAsync(String resourceGroupName, String containerAppName,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (containerAppName == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.start(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
this.client.getApiVersion(), containerAppName, accept, context);
}
/**
* Start a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException 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 container App.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ContainerAppInner> beginStartAsync(String resourceGroupName,
String containerAppName) {
Mono>> mono = startWithResponseAsync(resourceGroupName, containerAppName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
ContainerAppInner.class, ContainerAppInner.class, this.client.getContext());
}
/**
* Start a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException 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 container App.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ContainerAppInner> beginStartAsync(String resourceGroupName,
String containerAppName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = startWithResponseAsync(resourceGroupName, containerAppName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
ContainerAppInner.class, ContainerAppInner.class, context);
}
/**
* Start a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException 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 container App.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ContainerAppInner> beginStart(String resourceGroupName,
String containerAppName) {
return this.beginStartAsync(resourceGroupName, containerAppName).getSyncPoller();
}
/**
* Start a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException 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 container App.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ContainerAppInner> beginStart(String resourceGroupName,
String containerAppName, Context context) {
return this.beginStartAsync(resourceGroupName, containerAppName, context).getSyncPoller();
}
/**
* Start a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono startAsync(String resourceGroupName, String containerAppName) {
return beginStartAsync(resourceGroupName, containerAppName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Start a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono startAsync(String resourceGroupName, String containerAppName, Context context) {
return beginStartAsync(resourceGroupName, containerAppName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Start a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ContainerAppInner start(String resourceGroupName, String containerAppName) {
return startAsync(resourceGroupName, containerAppName).block();
}
/**
* Start a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ContainerAppInner start(String resourceGroupName, String containerAppName, Context context) {
return startAsync(resourceGroupName, containerAppName, context).block();
}
/**
* Stop a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> stopWithResponseAsync(String resourceGroupName, String containerAppName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (containerAppName == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.stop(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, this.client.getApiVersion(), containerAppName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Stop a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> stopWithResponseAsync(String resourceGroupName, String containerAppName,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (containerAppName == null) {
return Mono
.error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.stop(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
this.client.getApiVersion(), containerAppName, accept, context);
}
/**
* Stop a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException 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 container App.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ContainerAppInner> beginStopAsync(String resourceGroupName,
String containerAppName) {
Mono>> mono = stopWithResponseAsync(resourceGroupName, containerAppName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
ContainerAppInner.class, ContainerAppInner.class, this.client.getContext());
}
/**
* Stop a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException 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 container App.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ContainerAppInner> beginStopAsync(String resourceGroupName,
String containerAppName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = stopWithResponseAsync(resourceGroupName, containerAppName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
ContainerAppInner.class, ContainerAppInner.class, context);
}
/**
* Stop a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException 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 container App.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ContainerAppInner> beginStop(String resourceGroupName,
String containerAppName) {
return this.beginStopAsync(resourceGroupName, containerAppName).getSyncPoller();
}
/**
* Stop a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException 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 container App.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ContainerAppInner> beginStop(String resourceGroupName,
String containerAppName, Context context) {
return this.beginStopAsync(resourceGroupName, containerAppName, context).getSyncPoller();
}
/**
* Stop a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono stopAsync(String resourceGroupName, String containerAppName) {
return beginStopAsync(resourceGroupName, containerAppName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Stop a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono stopAsync(String resourceGroupName, String containerAppName, Context context) {
return beginStopAsync(resourceGroupName, containerAppName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Stop a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ContainerAppInner stop(String resourceGroupName, String containerAppName) {
return stopAsync(resourceGroupName, containerAppName).block();
}
/**
* Stop a container app.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ContainerAppInner stop(String resourceGroupName, String containerAppName, Context context) {
return stopAsync(resourceGroupName, containerAppName, context).block();
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App collection ARM resource along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App collection ARM resource along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listBySubscriptionNextSinglePageAsync(String nextLink,
Context context) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App collection ARM resource along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(),
res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws DefaultErrorResponseErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return container App collection ARM resource along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupNextSinglePageAsync(String nextLink,
Context context) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy