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

package com.azure.resourcemanager.postgresql.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.postgresql.fluent.LocationBasedPerformanceTiersClient;
import com.azure.resourcemanager.postgresql.fluent.models.PerformanceTierPropertiesInner;
import com.azure.resourcemanager.postgresql.models.LocationBasedPerformanceTiers;
import com.azure.resourcemanager.postgresql.models.PerformanceTierProperties;
import com.fasterxml.jackson.annotation.JsonIgnore;

public final class LocationBasedPerformanceTiersImpl implements LocationBasedPerformanceTiers {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(LocationBasedPerformanceTiersImpl.class);

    private final LocationBasedPerformanceTiersClient innerClient;

    private final com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager;

    public LocationBasedPerformanceTiersImpl(
        LocationBasedPerformanceTiersClient innerClient,
        com.azure.resourcemanager.postgresql.PostgreSqlManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public PagedIterable<PerformanceTierProperties> list(String locationName) {
        PagedIterable<PerformanceTierPropertiesInner> inner = this.serviceClient().list(locationName);
        return Utils.mapPage(inner, inner1 -> new PerformanceTierPropertiesImpl(inner1, this.manager()));
    }

    public PagedIterable<PerformanceTierProperties> list(String locationName, Context context) {
        PagedIterable<PerformanceTierPropertiesInner> inner = this.serviceClient().list(locationName, context);
        return Utils.mapPage(inner, inner1 -> new PerformanceTierPropertiesImpl(inner1, this.manager()));
    }

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

    private com.azure.resourcemanager.postgresql.PostgreSqlManager manager() {
        return this.serviceManager;
    }
}
