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

package com.azure.resourcemanager.desktopvirtualization.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.desktopvirtualization.fluent.StartMenuItemsClient;
import com.azure.resourcemanager.desktopvirtualization.fluent.models.StartMenuItemInner;
import com.azure.resourcemanager.desktopvirtualization.models.StartMenuItem;
import com.azure.resourcemanager.desktopvirtualization.models.StartMenuItems;

public final class StartMenuItemsImpl implements StartMenuItems {
    private static final ClientLogger LOGGER = new ClientLogger(StartMenuItemsImpl.class);

    private final StartMenuItemsClient innerClient;

    private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager;

    public StartMenuItemsImpl(
        StartMenuItemsClient innerClient,
        com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public PagedIterable<StartMenuItem> list(String resourceGroupName, String applicationGroupName) {
        PagedIterable<StartMenuItemInner> inner = this.serviceClient().list(resourceGroupName, applicationGroupName);
        return Utils.mapPage(inner, inner1 -> new StartMenuItemImpl(inner1, this.manager()));
    }

    public PagedIterable<StartMenuItem> list(
        String resourceGroupName,
        String applicationGroupName,
        Integer pageSize,
        Boolean isDescending,
        Integer initialSkip,
        Context context) {
        PagedIterable<StartMenuItemInner> inner =
            this
                .serviceClient()
                .list(resourceGroupName, applicationGroupName, pageSize, isDescending, initialSkip, context);
        return Utils.mapPage(inner, inner1 -> new StartMenuItemImpl(inner1, this.manager()));
    }

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

    private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() {
        return this.serviceManager;
    }
}
