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

package com.azure.resourcemanager.quota.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.quota.fluent.QuotaOperationsClient;
import com.azure.resourcemanager.quota.fluent.models.OperationResponseInner;
import com.azure.resourcemanager.quota.models.OperationResponse;
import com.azure.resourcemanager.quota.models.QuotaOperations;

public final class QuotaOperationsImpl implements QuotaOperations {
    private static final ClientLogger LOGGER = new ClientLogger(QuotaOperationsImpl.class);

    private final QuotaOperationsClient innerClient;

    private final com.azure.resourcemanager.quota.QuotaManager serviceManager;

    public QuotaOperationsImpl(
        QuotaOperationsClient innerClient, com.azure.resourcemanager.quota.QuotaManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public PagedIterable<OperationResponse> list() {
        PagedIterable<OperationResponseInner> inner = this.serviceClient().list();
        return Utils.mapPage(inner, inner1 -> new OperationResponseImpl(inner1, this.manager()));
    }

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

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

    private com.azure.resourcemanager.quota.QuotaManager manager() {
        return this.serviceManager;
    }
}
