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

package com.azure.resourcemanager.security.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.security.fluent.HealthReportOperationsClient;
import com.azure.resourcemanager.security.fluent.models.HealthReportInner;
import com.azure.resourcemanager.security.models.HealthReport;
import com.azure.resourcemanager.security.models.HealthReportOperations;

public final class HealthReportOperationsImpl implements HealthReportOperations {
    private static final ClientLogger LOGGER = new ClientLogger(HealthReportOperationsImpl.class);

    private final HealthReportOperationsClient innerClient;

    private final com.azure.resourcemanager.security.SecurityManager serviceManager;

    public HealthReportOperationsImpl(
        HealthReportOperationsClient innerClient, com.azure.resourcemanager.security.SecurityManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public Response<HealthReport> getWithResponse(String resourceId, String healthReportName, Context context) {
        Response<HealthReportInner> inner = this.serviceClient().getWithResponse(resourceId, healthReportName, context);
        if (inner != null) {
            return new SimpleResponse<>(
                inner.getRequest(),
                inner.getStatusCode(),
                inner.getHeaders(),
                new HealthReportImpl(inner.getValue(), this.manager()));
        } else {
            return null;
        }
    }

    public HealthReport get(String resourceId, String healthReportName) {
        HealthReportInner inner = this.serviceClient().get(resourceId, healthReportName);
        if (inner != null) {
            return new HealthReportImpl(inner, this.manager());
        } else {
            return null;
        }
    }

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

    private com.azure.resourcemanager.security.SecurityManager manager() {
        return this.serviceManager;
    }
}
