// 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.PeeringServiceLocationsClient;
import com.azure.resourcemanager.peering.fluent.models.PeeringServiceLocationInner;
import com.azure.resourcemanager.peering.models.PeeringServiceLocation;
import com.azure.resourcemanager.peering.models.PeeringServiceLocations;

public final class PeeringServiceLocationsImpl implements PeeringServiceLocations {
    private static final ClientLogger LOGGER = new ClientLogger(PeeringServiceLocationsImpl.class);

    private final PeeringServiceLocationsClient innerClient;

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

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

    public PagedIterable<PeeringServiceLocation> list() {
        PagedIterable<PeeringServiceLocationInner> inner = this.serviceClient().list();
        return Utils.mapPage(inner, inner1 -> new PeeringServiceLocationImpl(inner1, this.manager()));
    }

    public PagedIterable<PeeringServiceLocation> list(String country, Context context) {
        PagedIterable<PeeringServiceLocationInner> inner = this.serviceClient().list(country, context);
        return Utils.mapPage(inner, inner1 -> new PeeringServiceLocationImpl(inner1, this.manager()));
    }

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

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