// 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.IntegrationRuntimeStatusOperationsClient;
import com.azure.resourcemanager.synapse.fluent.models.IntegrationRuntimeStatusResponseInner;
import com.azure.resourcemanager.synapse.models.IntegrationRuntimeStatusOperations;
import com.azure.resourcemanager.synapse.models.IntegrationRuntimeStatusResponse;

public final class IntegrationRuntimeStatusOperationsImpl implements IntegrationRuntimeStatusOperations {
    private static final ClientLogger LOGGER = new ClientLogger(IntegrationRuntimeStatusOperationsImpl.class);

    private final IntegrationRuntimeStatusOperationsClient innerClient;

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

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

    public Response<IntegrationRuntimeStatusResponse> getWithResponse(
        String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) {
        Response<IntegrationRuntimeStatusResponseInner> inner =
            this.serviceClient().getWithResponse(resourceGroupName, workspaceName, integrationRuntimeName, context);
        if (inner != null) {
            return new SimpleResponse<>(
                inner.getRequest(),
                inner.getStatusCode(),
                inner.getHeaders(),
                new IntegrationRuntimeStatusResponseImpl(inner.getValue(), this.manager()));
        } else {
            return null;
        }
    }

    public IntegrationRuntimeStatusResponse get(
        String resourceGroupName, String workspaceName, String integrationRuntimeName) {
        IntegrationRuntimeStatusResponseInner inner =
            this.serviceClient().get(resourceGroupName, workspaceName, integrationRuntimeName);
        if (inner != null) {
            return new IntegrationRuntimeStatusResponseImpl(inner, this.manager());
        } else {
            return null;
        }
    }

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

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