// 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.SqlPoolsImpl;
import com.azure.analytics.synapse.artifacts.models.ErrorContractException;
import com.azure.analytics.synapse.artifacts.models.SqlPool;
import com.azure.analytics.synapse.artifacts.models.SqlPoolInfoListResult;
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.Response;
import com.azure.core.util.Context;

/** Initializes a new instance of the synchronous ArtifactsClient type. */
@ServiceClient(builder = ArtifactsClientBuilder.class)
public final class SqlPoolsClient {
    @Generated private final SqlPoolsImpl serviceClient;

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

    /**
     * List Sql Pools.
     *
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @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 sQL pool collection along with {@link Response}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<SqlPoolInfoListResult> listWithResponse(Context context) {
        return this.serviceClient.listWithResponse(context);
    }

    /**
     * List Sql Pools.
     *
     * @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 sQL pool collection.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public SqlPoolInfoListResult list() {
        return this.serviceClient.list();
    }

    /**
     * Get Sql Pool.
     *
     * @param sqlPoolName The Sql Pool name.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @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 sql Pool along with {@link Response}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<SqlPool> getWithResponse(String sqlPoolName, Context context) {
        return this.serviceClient.getWithResponse(sqlPoolName, context);
    }

    /**
     * Get Sql Pool.
     *
     * @param sqlPoolName The Sql Pool name.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @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 sql Pool.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public SqlPool get(String sqlPoolName) {
        return this.serviceClient.get(sqlPoolName);
    }
}
