// 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.Response;
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.synapse.fluent.SqlPoolDataWarehouseUserActivitiesClient;
import com.azure.resourcemanager.synapse.fluent.models.DataWarehouseUserActivitiesInner;
import com.azure.resourcemanager.synapse.models.DataWarehouseUserActivities;
import com.azure.resourcemanager.synapse.models.DataWarehouseUserActivityName;
import com.azure.resourcemanager.synapse.models.SqlPoolDataWarehouseUserActivities;

public final class SqlPoolDataWarehouseUserActivitiesImpl implements SqlPoolDataWarehouseUserActivities {
    private static final ClientLogger LOGGER = new ClientLogger(SqlPoolDataWarehouseUserActivitiesImpl.class);

    private final SqlPoolDataWarehouseUserActivitiesClient innerClient;

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

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

    public Response<DataWarehouseUserActivities> getWithResponse(
        String resourceGroupName,
        String workspaceName,
        String sqlPoolName,
        DataWarehouseUserActivityName dataWarehouseUserActivityName,
        Context context) {
        Response<DataWarehouseUserActivitiesInner> inner =
            this
                .serviceClient()
                .getWithResponse(resourceGroupName, workspaceName, sqlPoolName, dataWarehouseUserActivityName, context);
        if (inner != null) {
            return new SimpleResponse<>(
                inner.getRequest(),
                inner.getStatusCode(),
                inner.getHeaders(),
                new DataWarehouseUserActivitiesImpl(inner.getValue(), this.manager()));
        } else {
            return null;
        }
    }

    public DataWarehouseUserActivities get(
        String resourceGroupName,
        String workspaceName,
        String sqlPoolName,
        DataWarehouseUserActivityName dataWarehouseUserActivityName) {
        DataWarehouseUserActivitiesInner inner =
            this.serviceClient().get(resourceGroupName, workspaceName, sqlPoolName, dataWarehouseUserActivityName);
        if (inner != null) {
            return new DataWarehouseUserActivitiesImpl(inner, this.manager());
        } else {
            return null;
        }
    }

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

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