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

package com.azure.resourcemanager.automation.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.automation.fluent.StatisticsOperationsClient;
import com.azure.resourcemanager.automation.fluent.models.StatisticsInner;
import com.azure.resourcemanager.automation.models.Statistics;
import com.azure.resourcemanager.automation.models.StatisticsOperations;

public final class StatisticsOperationsImpl implements StatisticsOperations {
    private static final ClientLogger LOGGER = new ClientLogger(StatisticsOperationsImpl.class);

    private final StatisticsOperationsClient innerClient;

    private final com.azure.resourcemanager.automation.AutomationManager serviceManager;

    public StatisticsOperationsImpl(
        StatisticsOperationsClient innerClient, com.azure.resourcemanager.automation.AutomationManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public PagedIterable<Statistics> listByAutomationAccount(String resourceGroupName, String automationAccountName) {
        PagedIterable<StatisticsInner> inner =
            this.serviceClient().listByAutomationAccount(resourceGroupName, automationAccountName);
        return Utils.mapPage(inner, inner1 -> new StatisticsImpl(inner1, this.manager()));
    }

    public PagedIterable<Statistics> listByAutomationAccount(
        String resourceGroupName, String automationAccountName, String filter, Context context) {
        PagedIterable<StatisticsInner> inner =
            this.serviceClient().listByAutomationAccount(resourceGroupName, automationAccountName, filter, context);
        return Utils.mapPage(inner, inner1 -> new StatisticsImpl(inner1, this.manager()));
    }

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

    private com.azure.resourcemanager.automation.AutomationManager manager() {
        return this.serviceManager;
    }
}
