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

package com.azure.resourcemanager.networkfunction.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.networkfunction.fluent.AzureTrafficCollectorsBySubscriptionsClient;
import com.azure.resourcemanager.networkfunction.fluent.models.AzureTrafficCollectorInner;
import com.azure.resourcemanager.networkfunction.models.AzureTrafficCollector;
import com.azure.resourcemanager.networkfunction.models.AzureTrafficCollectorsBySubscriptions;

public final class AzureTrafficCollectorsBySubscriptionsImpl implements AzureTrafficCollectorsBySubscriptions {
    private static final ClientLogger LOGGER = new ClientLogger(AzureTrafficCollectorsBySubscriptionsImpl.class);

    private final AzureTrafficCollectorsBySubscriptionsClient innerClient;

    private final com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager serviceManager;

    public AzureTrafficCollectorsBySubscriptionsImpl(
        AzureTrafficCollectorsBySubscriptionsClient innerClient,
        com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public PagedIterable<AzureTrafficCollector> list() {
        PagedIterable<AzureTrafficCollectorInner> inner = this.serviceClient().list();
        return Utils.mapPage(inner, inner1 -> new AzureTrafficCollectorImpl(inner1, this.manager()));
    }

    public PagedIterable<AzureTrafficCollector> list(Context context) {
        PagedIterable<AzureTrafficCollectorInner> inner = this.serviceClient().list(context);
        return Utils.mapPage(inner, inner1 -> new AzureTrafficCollectorImpl(inner1, this.manager()));
    }

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

    private com.azure.resourcemanager.networkfunction.AzureTrafficCollectorManager manager() {
        return this.serviceManager;
    }
}
