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

package com.azure.resourcemanager.logic.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.logic.fluent.IntegrationServiceEnvironmentManagedApiOperationsClient;
import com.azure.resourcemanager.logic.fluent.models.ApiOperationInner;
import com.azure.resourcemanager.logic.models.ApiOperation;
import com.azure.resourcemanager.logic.models.IntegrationServiceEnvironmentManagedApiOperations;

public final class IntegrationServiceEnvironmentManagedApiOperationsImpl
    implements IntegrationServiceEnvironmentManagedApiOperations {
    private static final ClientLogger LOGGER =
        new ClientLogger(IntegrationServiceEnvironmentManagedApiOperationsImpl.class);

    private final IntegrationServiceEnvironmentManagedApiOperationsClient innerClient;

    private final com.azure.resourcemanager.logic.LogicManager serviceManager;

    public IntegrationServiceEnvironmentManagedApiOperationsImpl(
        IntegrationServiceEnvironmentManagedApiOperationsClient innerClient,
        com.azure.resourcemanager.logic.LogicManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public PagedIterable<ApiOperation> list(
        String resourceGroup, String integrationServiceEnvironmentName, String apiName) {
        PagedIterable<ApiOperationInner> inner =
            this.serviceClient().list(resourceGroup, integrationServiceEnvironmentName, apiName);
        return Utils.mapPage(inner, inner1 -> new ApiOperationImpl(inner1, this.manager()));
    }

    public PagedIterable<ApiOperation> list(
        String resourceGroup, String integrationServiceEnvironmentName, String apiName, Context context) {
        PagedIterable<ApiOperationInner> inner =
            this.serviceClient().list(resourceGroup, integrationServiceEnvironmentName, apiName, context);
        return Utils.mapPage(inner, inner1 -> new ApiOperationImpl(inner1, this.manager()));
    }

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

    private com.azure.resourcemanager.logic.LogicManager manager() {
        return this.serviceManager;
    }
}
