// 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.http.rest.PagedIterable;
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.synapse.fluent.SqlPoolTableColumnsClient;
import com.azure.resourcemanager.synapse.fluent.models.SqlPoolColumnInner;
import com.azure.resourcemanager.synapse.models.SqlPoolColumn;
import com.azure.resourcemanager.synapse.models.SqlPoolTableColumns;

public final class SqlPoolTableColumnsImpl implements SqlPoolTableColumns {
    private static final ClientLogger LOGGER = new ClientLogger(SqlPoolTableColumnsImpl.class);

    private final SqlPoolTableColumnsClient innerClient;

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

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

    public PagedIterable<SqlPoolColumn> listByTableName(
        String resourceGroupName, String workspaceName, String sqlPoolName, String schemaName, String tableName) {
        PagedIterable<SqlPoolColumnInner> inner =
            this.serviceClient().listByTableName(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName);
        return Utils.mapPage(inner, inner1 -> new SqlPoolColumnImpl(inner1, this.manager()));
    }

    public PagedIterable<SqlPoolColumn> listByTableName(
        String resourceGroupName,
        String workspaceName,
        String sqlPoolName,
        String schemaName,
        String tableName,
        String filter,
        Context context) {
        PagedIterable<SqlPoolColumnInner> inner =
            this
                .serviceClient()
                .listByTableName(resourceGroupName, workspaceName, sqlPoolName, schemaName, tableName, filter, context);
        return Utils.mapPage(inner, inner1 -> new SqlPoolColumnImpl(inner1, this.manager()));
    }

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

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