// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.analytics.synapse.artifacts;

import com.azure.analytics.synapse.artifacts.implementation.KqlScriptsImpl;
import com.azure.analytics.synapse.artifacts.models.ErrorContractException;
import com.azure.analytics.synapse.artifacts.models.KqlScriptResource;
import com.azure.core.annotation.Generated;
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;

/** Initializes a new instance of the asynchronous ArtifactsClient type. */
@ServiceClient(builder = ArtifactsClientBuilder.class, isAsync = true)
public final class KqlScriptsAsyncClient {
    @Generated private final KqlScriptsImpl serviceClient;

    /**
     * Initializes an instance of KqlScriptsAsyncClient class.
     *
     * @param serviceClient the service client implementation.
     */
    @Generated
    KqlScriptsAsyncClient(KqlScriptsImpl serviceClient) {
        this.serviceClient = serviceClient;
    }

    /**
     * Get all KQL scripts.
     *
     * @throws ErrorContractException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return all KQL scripts as paginated response with {@link PagedFlux}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.COLLECTION)
    public PagedFlux<KqlScriptResource> getAll() {
        return this.serviceClient.getAllAsync();
    }
}
