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

package com.azure.resourcemanager.synapse.implementation;

import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.synapse.fluent.SqlPoolOperationResultsClient;
import com.azure.resourcemanager.synapse.fluent.models.SqlPoolInner;
import com.azure.resourcemanager.synapse.models.SqlPool;
import com.azure.resourcemanager.synapse.models.SqlPoolOperationResults;

public final class SqlPoolOperationResultsImpl implements SqlPoolOperationResults {
    private static final ClientLogger LOGGER = new ClientLogger(SqlPoolOperationResultsImpl.class);

    private final SqlPoolOperationResultsClient innerClient;

    private final com.azure.resourcemanager.synapse.SynapseManager serviceManager;

    public SqlPoolOperationResultsImpl(
        SqlPoolOperationResultsClient innerClient, com.azure.resourcemanager.synapse.SynapseManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public SqlPool getLocationHeaderResult(
        String resourceGroupName, String workspaceName, String sqlPoolName, String operationId) {
        SqlPoolInner inner =
            this.serviceClient().getLocationHeaderResult(resourceGroupName, workspaceName, sqlPoolName, operationId);
        if (inner != null) {
            return new SqlPoolImpl(inner, this.manager());
        } else {
            return null;
        }
    }

    public SqlPool getLocationHeaderResult(
        String resourceGroupName, String workspaceName, String sqlPoolName, String operationId, Context context) {
        SqlPoolInner inner =
            this
                .serviceClient()
                .getLocationHeaderResult(resourceGroupName, workspaceName, sqlPoolName, operationId, context);
        if (inner != null) {
            return new SqlPoolImpl(inner, this.manager());
        } else {
            return null;
        }
    }

    private SqlPoolOperationResultsClient serviceClient() {
        return this.innerClient;
    }

    private com.azure.resourcemanager.synapse.SynapseManager manager() {
        return this.serviceManager;
    }
}
