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

package com.azure.resourcemanager.cognitiveservices.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.cognitiveservices.fluent.CommitmentTiersClient;
import com.azure.resourcemanager.cognitiveservices.fluent.models.CommitmentTierInner;
import com.azure.resourcemanager.cognitiveservices.models.CommitmentTier;
import com.azure.resourcemanager.cognitiveservices.models.CommitmentTiers;

public final class CommitmentTiersImpl implements CommitmentTiers {
    private static final ClientLogger LOGGER = new ClientLogger(CommitmentTiersImpl.class);

    private final CommitmentTiersClient innerClient;

    private final com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager;

    public CommitmentTiersImpl(
        CommitmentTiersClient innerClient,
        com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public PagedIterable<CommitmentTier> list(String location) {
        PagedIterable<CommitmentTierInner> inner = this.serviceClient().list(location);
        return Utils.mapPage(inner, inner1 -> new CommitmentTierImpl(inner1, this.manager()));
    }

    public PagedIterable<CommitmentTier> list(String location, Context context) {
        PagedIterable<CommitmentTierInner> inner = this.serviceClient().list(location, context);
        return Utils.mapPage(inner, inner1 -> new CommitmentTierImpl(inner1, this.manager()));
    }

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

    private com.azure.resourcemanager.cognitiveservices.CognitiveServicesManager manager() {
        return this.serviceManager;
    }
}
