
com.azure.resourcemanager.appcontainers.implementation.ContainerAppsBuildsClientImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-appcontainers Show documentation
Show all versions of azure-resourcemanager-appcontainers Show documentation
This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2024-03.
The newest version!
// 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.Delete;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Headers;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.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.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.ContainerAppsBuildsClient;
import com.azure.resourcemanager.appcontainers.fluent.models.ContainerAppsBuildResourceInner;
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 ContainerAppsBuildsClient.
*/
public final class ContainerAppsBuildsClientImpl implements ContainerAppsBuildsClient {
/**
* The proxy service used to perform REST calls.
*/
private final ContainerAppsBuildsService service;
/**
* The service client containing this operation class.
*/
private final ContainerAppsApiClientImpl client;
/**
* Initializes an instance of ContainerAppsBuildsClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
ContainerAppsBuildsClientImpl(ContainerAppsApiClientImpl client) {
this.service = RestProxy.create(ContainerAppsBuildsService.class, client.getHttpPipeline(),
client.getSerializerAdapter());
this.client = client;
}
/**
* The interface defining all the services for ContainerAppsApiClientContainerAppsBuilds to be used by the proxy
* service to perform REST calls.
*/
@Host("{$host}")
@ServiceInterface(name = "ContainerAppsApiClie")
public interface ContainerAppsBuildsService {
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> get(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("containerAppName") String containerAppName, @PathParam("buildName") String buildName,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps/{containerAppName}/builds/{buildName}")
@ExpectedResponses({ 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> delete(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("containerAppName") String containerAppName, @PathParam("buildName") String buildName,
@HeaderParam("Accept") String accept, Context context);
}
/**
* Get a Container Apps Build resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App the Build is associated.
* @param buildName The name of a build.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a Container Apps Build resource along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getWithResponseAsync(String resourceGroupName,
String containerAppName, String buildName) {
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 (buildName == null) {
return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, containerAppName, buildName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get a Container Apps Build resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App the Build is associated.
* @param buildName The name of a build.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a Container Apps Build resource along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getWithResponseAsync(String resourceGroupName,
String containerAppName, String buildName, 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 (buildName == null) {
return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
resourceGroupName, containerAppName, buildName, accept, context);
}
/**
* Get a Container Apps Build resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App the Build is associated.
* @param buildName The name of a build.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a Container Apps Build resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getAsync(String resourceGroupName, String containerAppName,
String buildName) {
return getWithResponseAsync(resourceGroupName, containerAppName, buildName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Get a Container Apps Build resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App the Build is associated.
* @param buildName The name of a build.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a Container Apps Build resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getWithResponse(String resourceGroupName, String containerAppName,
String buildName, Context context) {
return getWithResponseAsync(resourceGroupName, containerAppName, buildName, context).block();
}
/**
* Get a Container Apps Build resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App the Build is associated.
* @param buildName The name of a build.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a Container Apps Build resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ContainerAppsBuildResourceInner get(String resourceGroupName, String containerAppName, String buildName) {
return getWithResponse(resourceGroupName, containerAppName, buildName, Context.NONE).getValue();
}
/**
* Delete a Container Apps Build resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App the Build is associated.
* @param buildName The name of a build.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deleteWithResponseAsync(String resourceGroupName, String containerAppName,
String buildName) {
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 (buildName == null) {
return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, containerAppName, buildName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Delete a Container Apps Build resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App the Build is associated.
* @param buildName The name of a build.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> deleteWithResponseAsync(String resourceGroupName, String containerAppName,
String buildName, 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 (buildName == null) {
return Mono.error(new IllegalArgumentException("Parameter buildName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
resourceGroupName, containerAppName, buildName, accept, context);
}
/**
* Delete a Container Apps Build resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App the Build is associated.
* @param buildName The name of a build.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String containerAppName,
String buildName) {
Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerAppName, buildName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Delete a Container Apps Build resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App the Build is associated.
* @param buildName The name of a build.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String containerAppName,
String buildName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= deleteWithResponseAsync(resourceGroupName, containerAppName, buildName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Delete a Container Apps Build resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App the Build is associated.
* @param buildName The name of a build.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDelete(String resourceGroupName, String containerAppName,
String buildName) {
return this.beginDeleteAsync(resourceGroupName, containerAppName, buildName).getSyncPoller();
}
/**
* Delete a Container Apps Build resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App the Build is associated.
* @param buildName The name of a build.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDelete(String resourceGroupName, String containerAppName,
String buildName, Context context) {
return this.beginDeleteAsync(resourceGroupName, containerAppName, buildName, context).getSyncPoller();
}
/**
* Delete a Container Apps Build resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App the Build is associated.
* @param buildName The name of a build.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteAsync(String resourceGroupName, String containerAppName, String buildName) {
return beginDeleteAsync(resourceGroupName, containerAppName, buildName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Delete a Container Apps Build resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App the Build is associated.
* @param buildName The name of a build.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return A {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteAsync(String resourceGroupName, String containerAppName, String buildName,
Context context) {
return beginDeleteAsync(resourceGroupName, containerAppName, buildName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Delete a Container Apps Build resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App the Build is associated.
* @param buildName The name of a build.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void delete(String resourceGroupName, String containerAppName, String buildName) {
deleteAsync(resourceGroupName, containerAppName, buildName).block();
}
/**
* Delete a Container Apps Build resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param containerAppName Name of the Container App the Build is associated.
* @param buildName The name of a build.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void delete(String resourceGroupName, String containerAppName, String buildName, Context context) {
deleteAsync(resourceGroupName, containerAppName, buildName, context).block();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy