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

package com.azure.resourcemanager.recoveryservices.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.recoveryservices.fluent.ReplicationUsagesClient;
import com.azure.resourcemanager.recoveryservices.fluent.models.ReplicationUsageInner;
import com.azure.resourcemanager.recoveryservices.models.ReplicationUsage;
import com.azure.resourcemanager.recoveryservices.models.ReplicationUsages;

public final class ReplicationUsagesImpl implements ReplicationUsages {
    private static final ClientLogger LOGGER = new ClientLogger(ReplicationUsagesImpl.class);

    private final ReplicationUsagesClient innerClient;

    private final com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager;

    public ReplicationUsagesImpl(
        ReplicationUsagesClient innerClient,
        com.azure.resourcemanager.recoveryservices.RecoveryServicesManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public PagedIterable<ReplicationUsage> list(String resourceGroupName, String vaultName) {
        PagedIterable<ReplicationUsageInner> inner = this.serviceClient().list(resourceGroupName, vaultName);
        return Utils.mapPage(inner, inner1 -> new ReplicationUsageImpl(inner1, this.manager()));
    }

    public PagedIterable<ReplicationUsage> list(String resourceGroupName, String vaultName, Context context) {
        PagedIterable<ReplicationUsageInner> inner = this.serviceClient().list(resourceGroupName, vaultName, context);
        return Utils.mapPage(inner, inner1 -> new ReplicationUsageImpl(inner1, this.manager()));
    }

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

    private com.azure.resourcemanager.recoveryservices.RecoveryServicesManager manager() {
        return this.serviceManager;
    }
}
