// 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.WorkspaceOperationsClient;
import com.azure.resourcemanager.machinelearningservices.fluent.models.WorkspaceSkuInner;
import com.azure.resourcemanager.machinelearningservices.models.WorkspaceOperations;
import com.azure.resourcemanager.machinelearningservices.models.WorkspaceSku;
import com.fasterxml.jackson.annotation.JsonIgnore;

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

    private final WorkspaceOperationsClient innerClient;

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

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

    public PagedIterable<WorkspaceSku> listSkus() {
        PagedIterable<WorkspaceSkuInner> inner = this.serviceClient().listSkus();
        return Utils.mapPage(inner, inner1 -> new WorkspaceSkuImpl(inner1, this.manager()));
    }

    public PagedIterable<WorkspaceSku> listSkus(Context context) {
        PagedIterable<WorkspaceSkuInner> inner = this.serviceClient().listSkus(context);
        return Utils.mapPage(inner, inner1 -> new WorkspaceSkuImpl(inner1, this.manager()));
    }

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

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