All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.confidentialledger.implementation.ManagedCcfsClientImpl 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.confidentialledger.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.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.confidentialledger.fluent.ManagedCcfsClient;
import com.azure.resourcemanager.confidentialledger.fluent.models.ManagedCcfInner;
import com.azure.resourcemanager.confidentialledger.models.ManagedCcfList;
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 ManagedCcfsClient. */
public final class ManagedCcfsClientImpl implements ManagedCcfsClient {
    /** The proxy service used to perform REST calls. */
    private final ManagedCcfsService service;

    /** The service client containing this operation class. */
    private final ConfidentialLedgerManagementClientImpl client;

    /**
     * Initializes an instance of ManagedCcfsClientImpl.
     *
     * @param client the instance of the service client containing this operation class.
     */
    ManagedCcfsClientImpl(ConfidentialLedgerManagementClientImpl client) {
        this.service =
            RestProxy.create(ManagedCcfsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
        this.client = client;
    }

    /**
     * The interface defining all the services for ConfidentialLedgerManagementClientManagedCcfs to be used by the proxy
     * service to perform REST calls.
     */
    @Host("{$host}")
    @ServiceInterface(name = "ConfidentialLedgerMa")
    public interface ManagedCcfsService {
        @Headers({"Content-Type: application/json"})
        @Get(
            "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs/{appName}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> getByResourceGroup(
            @HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("appName") String appName,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Delete(
            "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs/{appName}")
        @ExpectedResponses({200, 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("appName") String appName,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Put(
            "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs/{appName}")
        @ExpectedResponses({200, 201})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> create(
            @HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("appName") String appName,
            @BodyParam("application/json") ManagedCcfInner managedCcf,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Patch(
            "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs/{appName}")
        @ExpectedResponses({200, 202})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono>> update(
            @HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("appName") String appName,
            @BodyParam("application/json") ManagedCcfInner managedCcf,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get(
            "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ConfidentialLedger/managedCCFs")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> listByResourceGroup(
            @HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @QueryParam("$filter") String filter,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get("/subscriptions/{subscriptionId}/providers/Microsoft.ConfidentialLedger/managedCCFs/")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> list(
            @HostParam("$host") String endpoint,
            @QueryParam("api-version") String apiVersion,
            @PathParam("subscriptionId") String subscriptionId,
            @QueryParam("$filter") String filter,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> listByResourceGroupNext(
            @PathParam(value = "nextLink", encoded = true) String nextLink,
            @HostParam("$host") String endpoint,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get("{nextLink}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono> listBySubscriptionNext(
            @PathParam(value = "nextLink", encoded = true) String nextLink,
            @HostParam("$host") String endpoint,
            @HeaderParam("Accept") String accept,
            Context context);
    }

    /**
     * Retrieves information about a Managed CCF resource.
     *
     * 

Retrieves the properties of a Managed CCF app. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return managed CCF along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( String resourceGroupName, String appName) { 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 (appName == null) { return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil .withContext( context -> service .getByResourceGroup( this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, appName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Retrieves information about a Managed CCF resource. * *

Retrieves the properties of a Managed CCF app. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @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 managed CCF along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getByResourceGroupWithResponseAsync( String resourceGroupName, String appName, 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 (appName == null) { return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .getByResourceGroup( this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, appName, accept, context); } /** * Retrieves information about a Managed CCF resource. * *

Retrieves the properties of a Managed CCF app. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return managed CCF on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono getByResourceGroupAsync(String resourceGroupName, String appName) { return getByResourceGroupWithResponseAsync(resourceGroupName, appName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Retrieves information about a Managed CCF resource. * *

Retrieves the properties of a Managed CCF app. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @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 managed CCF along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse( String resourceGroupName, String appName, Context context) { return getByResourceGroupWithResponseAsync(resourceGroupName, appName, context).block(); } /** * Retrieves information about a Managed CCF resource. * *

Retrieves the properties of a Managed CCF app. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return managed CCF. */ @ServiceMethod(returns = ReturnType.SINGLE) public ManagedCcfInner getByResourceGroup(String resourceGroupName, String appName) { return getByResourceGroupWithResponse(resourceGroupName, appName, Context.NONE).getValue(); } /** * Deletes a Managed CCF resource. * *

Deletes an existing Managed CCF. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 appName) { 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 (appName == null) { return Mono.error(new IllegalArgumentException("Parameter appName 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, appName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Deletes a Managed CCF resource. * *

Deletes an existing Managed CCF. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @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 appName, 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 (appName == null) { return Mono.error(new IllegalArgumentException("Parameter appName 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, appName, accept, context); } /** * Deletes a Managed CCF resource. * *

Deletes an existing Managed CCF. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 appName) { Mono>> mono = deleteWithResponseAsync(resourceGroupName, appName); return this .client .getLroResult( mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** * Deletes a Managed CCF resource. * *

Deletes an existing Managed CCF. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @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 appName, Context context) { context = this.client.mergeContext(context); Mono>> mono = deleteWithResponseAsync(resourceGroupName, appName, context); return this .client .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** * Deletes a Managed CCF resource. * *

Deletes an existing Managed CCF. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 appName) { return this.beginDeleteAsync(resourceGroupName, appName).getSyncPoller(); } /** * Deletes a Managed CCF resource. * *

Deletes an existing Managed CCF. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @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 appName, Context context) { return this.beginDeleteAsync(resourceGroupName, appName, context).getSyncPoller(); } /** * Deletes a Managed CCF resource. * *

Deletes an existing Managed CCF. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 appName) { return beginDeleteAsync(resourceGroupName, appName).last().flatMap(this.client::getLroFinalResultOrError); } /** * Deletes a Managed CCF resource. * *

Deletes an existing Managed CCF. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @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 appName, Context context) { return beginDeleteAsync(resourceGroupName, appName, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** * Deletes a Managed CCF resource. * *

Deletes an existing Managed CCF. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 appName) { deleteAsync(resourceGroupName, appName).block(); } /** * Deletes a Managed CCF resource. * *

Deletes an existing Managed CCF. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @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 appName, Context context) { deleteAsync(resourceGroupName, appName, context).block(); } /** * Creates a Managed CCF. * *

Creates a Managed CCF with the specified Managed CCF parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return managed CCF along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( String resourceGroupName, String appName, ManagedCcfInner managedCcf) { 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 (appName == null) { return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); } if (managedCcf == null) { return Mono.error(new IllegalArgumentException("Parameter managedCcf is required and cannot be null.")); } else { managedCcf.validate(); } final String accept = "application/json"; return FluxUtil .withContext( context -> service .create( this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, appName, managedCcf, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates a Managed CCF. * *

Creates a Managed CCF with the specified Managed CCF parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. * @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 managed CCF along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync( String resourceGroupName, String appName, ManagedCcfInner managedCcf, 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 (appName == null) { return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); } if (managedCcf == null) { return Mono.error(new IllegalArgumentException("Parameter managedCcf is required and cannot be null.")); } else { managedCcf.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .create( this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, appName, managedCcf, accept, context); } /** * Creates a Managed CCF. * *

Creates a Managed CCF with the specified Managed CCF parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 managed CCF. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ManagedCcfInner> beginCreateAsync( String resourceGroupName, String appName, ManagedCcfInner managedCcf) { Mono>> mono = createWithResponseAsync(resourceGroupName, appName, managedCcf); return this .client .getLroResult( mono, this.client.getHttpPipeline(), ManagedCcfInner.class, ManagedCcfInner.class, this.client.getContext()); } /** * Creates a Managed CCF. * *

Creates a Managed CCF with the specified Managed CCF parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. * @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 managed CCF. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ManagedCcfInner> beginCreateAsync( String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context) { context = this.client.mergeContext(context); Mono>> mono = createWithResponseAsync(resourceGroupName, appName, managedCcf, context); return this .client .getLroResult( mono, this.client.getHttpPipeline(), ManagedCcfInner.class, ManagedCcfInner.class, context); } /** * Creates a Managed CCF. * *

Creates a Managed CCF with the specified Managed CCF parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 managed CCF. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ManagedCcfInner> beginCreate( String resourceGroupName, String appName, ManagedCcfInner managedCcf) { return this.beginCreateAsync(resourceGroupName, appName, managedCcf).getSyncPoller(); } /** * Creates a Managed CCF. * *

Creates a Managed CCF with the specified Managed CCF parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. * @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 managed CCF. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ManagedCcfInner> beginCreate( String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context) { return this.beginCreateAsync(resourceGroupName, appName, managedCcf, context).getSyncPoller(); } /** * Creates a Managed CCF. * *

Creates a Managed CCF with the specified Managed CCF parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return managed CCF on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync(String resourceGroupName, String appName, ManagedCcfInner managedCcf) { return beginCreateAsync(resourceGroupName, appName, managedCcf) .last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates a Managed CCF. * *

Creates a Managed CCF with the specified Managed CCF parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. * @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 managed CCF on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync( String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context) { return beginCreateAsync(resourceGroupName, appName, managedCcf, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** * Creates a Managed CCF. * *

Creates a Managed CCF with the specified Managed CCF parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return managed CCF. */ @ServiceMethod(returns = ReturnType.SINGLE) public ManagedCcfInner create(String resourceGroupName, String appName, ManagedCcfInner managedCcf) { return createAsync(resourceGroupName, appName, managedCcf).block(); } /** * Creates a Managed CCF. * *

Creates a Managed CCF with the specified Managed CCF parameters. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Managed CCF Create Request Body. * @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 managed CCF. */ @ServiceMethod(returns = ReturnType.SINGLE) public ManagedCcfInner create( String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context) { return createAsync(resourceGroupName, appName, managedCcf, context).block(); } /** * Update Managed CCF properties * *

Updates properties of Managed CCF. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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>> updateWithResponseAsync( String resourceGroupName, String appName, ManagedCcfInner managedCcf) { 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 (appName == null) { return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); } if (managedCcf == null) { return Mono.error(new IllegalArgumentException("Parameter managedCcf is required and cannot be null.")); } else { managedCcf.validate(); } final String accept = "application/json"; return FluxUtil .withContext( context -> service .update( this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, appName, managedCcf, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Update Managed CCF properties * *

Updates properties of Managed CCF. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. * @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>> updateWithResponseAsync( String resourceGroupName, String appName, ManagedCcfInner managedCcf, 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 (appName == null) { return Mono.error(new IllegalArgumentException("Parameter appName is required and cannot be null.")); } if (managedCcf == null) { return Mono.error(new IllegalArgumentException("Parameter managedCcf is required and cannot be null.")); } else { managedCcf.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service .update( this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, appName, managedCcf, accept, context); } /** * Update Managed CCF properties * *

Updates properties of Managed CCF. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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> beginUpdateAsync( String resourceGroupName, String appName, ManagedCcfInner managedCcf) { Mono>> mono = updateWithResponseAsync(resourceGroupName, appName, managedCcf); return this .client .getLroResult( mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** * Update Managed CCF properties * *

Updates properties of Managed CCF. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. * @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> beginUpdateAsync( String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context) { context = this.client.mergeContext(context); Mono>> mono = updateWithResponseAsync(resourceGroupName, appName, managedCcf, context); return this .client .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** * Update Managed CCF properties * *

Updates properties of Managed CCF. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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> beginUpdate( String resourceGroupName, String appName, ManagedCcfInner managedCcf) { return this.beginUpdateAsync(resourceGroupName, appName, managedCcf).getSyncPoller(); } /** * Update Managed CCF properties * *

Updates properties of Managed CCF. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. * @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> beginUpdate( String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context) { return this.beginUpdateAsync(resourceGroupName, appName, managedCcf, context).getSyncPoller(); } /** * Update Managed CCF properties * *

Updates properties of Managed CCF. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 updateAsync(String resourceGroupName, String appName, ManagedCcfInner managedCcf) { return beginUpdateAsync(resourceGroupName, appName, managedCcf) .last() .flatMap(this.client::getLroFinalResultOrError); } /** * Update Managed CCF properties * *

Updates properties of Managed CCF. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. * @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 updateAsync( String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context) { return beginUpdateAsync(resourceGroupName, appName, managedCcf, context) .last() .flatMap(this.client::getLroFinalResultOrError); } /** * Update Managed CCF properties * *

Updates properties of Managed CCF. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. * @throws IllegalArgumentException thrown if parameters fail the validation. * @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 update(String resourceGroupName, String appName, ManagedCcfInner managedCcf) { updateAsync(resourceGroupName, appName, managedCcf).block(); } /** * Update Managed CCF properties * *

Updates properties of Managed CCF. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param appName Name of the Managed CCF. * @param managedCcf Request body for Updating Managed CCF App. * @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 update(String resourceGroupName, String appName, ManagedCcfInner managedCcf, Context context) { updateAsync(resourceGroupName, appName, managedCcf, context).block(); } /** * Retrieves information about all Managed CCF resources under the given subscription and resource group * *

Retrieves the properties of all Managed CCF apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return object that includes an array of Managed CCF and a possible link for next set along with {@link * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( String resourceGroupName, String filter) { 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.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, filter, 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())); } /** * Retrieves information about all Managed CCF resources under the given subscription and resource group * *

Retrieves the properties of all Managed CCF apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Managed CCF and a possible link for next set along with {@link * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupSinglePageAsync( String resourceGroupName, String filter, 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.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, filter, accept, context) .map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** * Retrieves information about all Managed CCF resources under the given subscription and resource group * *

Retrieves the properties of all Managed CCF apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return object that includes an array of Managed CCF and a possible link for next set as paginated response with * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, String filter) { return new PagedFlux<>( () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * Retrieves information about all Managed CCF resources under the given subscription and resource group * *

Retrieves the properties of all Managed CCF apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return object that includes an array of Managed CCF and a possible link for next set as paginated response with * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { final String filter = null; return new PagedFlux<>( () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** * Retrieves information about all Managed CCF resources under the given subscription and resource group * *

Retrieves the properties of all Managed CCF apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync( String resourceGroupName, String filter, Context context) { return new PagedFlux<>( () -> listByResourceGroupSinglePageAsync(resourceGroupName, filter, context), nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** * Retrieves information about all Managed CCF resources under the given subscription and resource group * *

Retrieves the properties of all Managed CCF apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return object that includes an array of Managed CCF and a possible link for next set as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { final String filter = null; return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter)); } /** * Retrieves information about all Managed CCF resources under the given subscription and resource group * *

Retrieves the properties of all Managed CCF apps. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup( String resourceGroupName, String filter, Context context) { return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, filter, context)); } /** * Retrieves information about all Managed CCF resources under the given subscription * *

Retrieves the properties of all Managed CCF. * * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return object that includes an array of Managed CCF and a possible link for next set along with {@link * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String filter) { 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.getApiVersion(), this.client.getSubscriptionId(), filter, 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())); } /** * Retrieves information about all Managed CCF resources under the given subscription * *

Retrieves the properties of all Managed CCF. * * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Managed CCF and a possible link for next set along with {@link * PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync(String filter, 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.getApiVersion(), this.client.getSubscriptionId(), filter, accept, context) .map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** * Retrieves information about all Managed CCF resources under the given subscription * *

Retrieves the properties of all Managed CCF. * * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return object that includes an array of Managed CCF and a possible link for next set as paginated response with * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String filter) { return new PagedFlux<>( () -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * Retrieves information about all Managed CCF resources under the given subscription * *

Retrieves the properties of all Managed CCF. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return object that includes an array of Managed CCF and a possible link for next set as paginated response with * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { final String filter = null; return new PagedFlux<>( () -> listSinglePageAsync(filter), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** * Retrieves information about all Managed CCF resources under the given subscription * *

Retrieves the properties of all Managed CCF. * * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String filter, Context context) { return new PagedFlux<>( () -> listSinglePageAsync(filter, context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** * Retrieves information about all Managed CCF resources under the given subscription * *

Retrieves the properties of all Managed CCF. * * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return object that includes an array of Managed CCF and a possible link for next set as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { final String filter = null; return new PagedIterable<>(listAsync(filter)); } /** * Retrieves information about all Managed CCF resources under the given subscription * *

Retrieves the properties of all Managed CCF. * * @param filter The filter to apply on the list operation. eg. $filter=ledgerType eq 'Public'. * @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 object that includes an array of Managed CCF and a possible link for next set as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String filter, Context context) { return new PagedIterable<>(listAsync(filter, context)); } /** * Get the next page of items. * * @param nextLink The URL to get the next list of items *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return object that includes an array of Managed CCF and a possible link for next set 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 *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return object that includes an array of Managed CCF and a possible link for next set 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)); } /** * Get the next page of items. * * @param nextLink The URL to get the next list of items *

The nextLink parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return object that includes an array of Managed CCF and a possible link for next set 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 *

The nextLink parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return object that includes an array of Managed CCF and a possible link for next set 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)); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy