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

package com.azure.resourcemanager.machinelearningservices.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.machinelearningservices.fluent.WorkspaceFeaturesClient;
import com.azure.resourcemanager.machinelearningservices.fluent.models.AmlUserFeatureInner;
import com.azure.resourcemanager.machinelearningservices.models.AmlUserFeature;
import com.azure.resourcemanager.machinelearningservices.models.WorkspaceFeatures;
import com.fasterxml.jackson.annotation.JsonIgnore;

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

    private final WorkspaceFeaturesClient innerClient;

    private final com.azure.resourcemanager.machinelearningservices.MachineLearningServicesManager serviceManager;

    public WorkspaceFeaturesImpl(
        WorkspaceFeaturesClient innerClient,
        com.azure.resourcemanager.machinelearningservices.MachineLearningServicesManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public PagedIterable<AmlUserFeature> list(String resourceGroupName, String workspaceName) {
        PagedIterable<AmlUserFeatureInner> inner = this.serviceClient().list(resourceGroupName, workspaceName);
        return Utils.mapPage(inner, inner1 -> new AmlUserFeatureImpl(inner1, this.manager()));
    }

    public PagedIterable<AmlUserFeature> list(String resourceGroupName, String workspaceName, Context context) {
        PagedIterable<AmlUserFeatureInner> inner = this.serviceClient().list(resourceGroupName, workspaceName, context);
        return Utils.mapPage(inner, inner1 -> new AmlUserFeatureImpl(inner1, this.manager()));
    }

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

    private com.azure.resourcemanager.machinelearningservices.MachineLearningServicesManager manager() {
        return this.serviceManager;
    }
}
