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

package azure.resourcemanager.operationtemplates.implementation;

import azure.resourcemanager.operationtemplates.fluent.LroPagingsClient;
import azure.resourcemanager.operationtemplates.fluent.models.ProductInner;
import azure.resourcemanager.operationtemplates.models.LroPagings;
import azure.resourcemanager.operationtemplates.models.Product;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;

public final class LroPagingsImpl implements LroPagings {
    private static final ClientLogger LOGGER = new ClientLogger(LroPagingsImpl.class);

    private final LroPagingsClient innerClient;

    private final azure.resourcemanager.operationtemplates.OperationTemplatesManager serviceManager;

    public LroPagingsImpl(LroPagingsClient innerClient,
        azure.resourcemanager.operationtemplates.OperationTemplatesManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public PagedIterable<Product> postPagingLro(String resourceGroupName, String productName) {
        PagedIterable<ProductInner> inner = this.serviceClient().postPagingLro(resourceGroupName, productName);
        return ResourceManagerUtils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager()));
    }

    public PagedIterable<Product> postPagingLro(String resourceGroupName, String productName, Context context) {
        PagedIterable<ProductInner> inner = this.serviceClient().postPagingLro(resourceGroupName, productName, context);
        return ResourceManagerUtils.mapPage(inner, inner1 -> new ProductImpl(inner1, this.manager()));
    }

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

    private azure.resourcemanager.operationtemplates.OperationTemplatesManager manager() {
        return this.serviceManager;
    }
}
