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

package com.azure.resourcemanager.peering.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.peering.fluent.PeeringServiceCountriesClient;
import com.azure.resourcemanager.peering.fluent.models.PeeringServiceCountryInner;
import com.azure.resourcemanager.peering.models.PeeringServiceCountries;
import com.azure.resourcemanager.peering.models.PeeringServiceCountry;

public final class PeeringServiceCountriesImpl implements PeeringServiceCountries {
    private static final ClientLogger LOGGER = new ClientLogger(PeeringServiceCountriesImpl.class);

    private final PeeringServiceCountriesClient innerClient;

    private final com.azure.resourcemanager.peering.PeeringManager serviceManager;

    public PeeringServiceCountriesImpl(
        PeeringServiceCountriesClient innerClient, com.azure.resourcemanager.peering.PeeringManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public PagedIterable<PeeringServiceCountry> list() {
        PagedIterable<PeeringServiceCountryInner> inner = this.serviceClient().list();
        return Utils.mapPage(inner, inner1 -> new PeeringServiceCountryImpl(inner1, this.manager()));
    }

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

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

    private com.azure.resourcemanager.peering.PeeringManager manager() {
        return this.serviceManager;
    }
}
