// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.quantum.jobs;

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceClient;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedResponse;
import com.azure.quantum.jobs.implementation.ProvidersImpl;
import com.azure.quantum.jobs.models.ProviderStatus;
import com.azure.quantum.jobs.models.RestErrorException;
import reactor.core.publisher.Mono;

/** Initializes a new instance of the asynchronous QuantumClient type. */
@ServiceClient(builder = QuantumClientBuilder.class, isAsync = true)
public final class ProvidersAsyncClient {
    private final ProvidersImpl serviceClient;

    /**
     * Initializes an instance of Providers client.
     *
     * @param serviceClient the service client implementation.
     */
    ProvidersAsyncClient(ProvidersImpl serviceClient) {
        this.serviceClient = serviceClient;
    }

    /**
     * Get provider status.
     *
     * @throws RestErrorException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return provider status.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public Mono<PagedResponse<ProviderStatus>> getStatusSinglePage() {
        return this.serviceClient.getStatusSinglePageAsync();
    }

    /**
     * Get provider status.
     *
     * @throws RestErrorException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return provider status.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<ProviderStatus> getStatus() {
        return this.serviceClient.getStatusAsync();
    }

    /**
     * Get the next page of items.
     *
     * @param nextLink The nextLink parameter.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws RestErrorException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return providers status.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public Mono<PagedResponse<ProviderStatus>> getStatusNextSinglePage(String nextLink) {
        return this.serviceClient.getStatusNextSinglePageAsync(nextLink);
    }
}
