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

package com.azure.resourcemanager.hybridnetwork.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.hybridnetwork.fluent.NetworkFunctionVendorSkusClient;
import com.azure.resourcemanager.hybridnetwork.fluent.models.NetworkFunctionSkuRoleDetailsInner;
import com.azure.resourcemanager.hybridnetwork.fluent.models.SkuOverviewInner;
import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionSkuRoleDetails;
import com.azure.resourcemanager.hybridnetwork.models.NetworkFunctionVendorSkus;
import com.azure.resourcemanager.hybridnetwork.models.SkuOverview;

public final class NetworkFunctionVendorSkusImpl implements NetworkFunctionVendorSkus {
    private static final ClientLogger LOGGER = new ClientLogger(NetworkFunctionVendorSkusImpl.class);

    private final NetworkFunctionVendorSkusClient innerClient;

    private final com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager;

    public NetworkFunctionVendorSkusImpl(
        NetworkFunctionVendorSkusClient innerClient,
        com.azure.resourcemanager.hybridnetwork.HybridNetworkManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public PagedIterable<SkuOverview> listByVendor(String vendorName) {
        PagedIterable<SkuOverviewInner> inner = this.serviceClient().listByVendor(vendorName);
        return Utils.mapPage(inner, inner1 -> new SkuOverviewImpl(inner1, this.manager()));
    }

    public PagedIterable<SkuOverview> listByVendor(String vendorName, Context context) {
        PagedIterable<SkuOverviewInner> inner = this.serviceClient().listByVendor(vendorName, context);
        return Utils.mapPage(inner, inner1 -> new SkuOverviewImpl(inner1, this.manager()));
    }

    public PagedIterable<NetworkFunctionSkuRoleDetails> listBySku(String vendorName, String vendorSkuName) {
        PagedIterable<NetworkFunctionSkuRoleDetailsInner> inner =
            this.serviceClient().listBySku(vendorName, vendorSkuName);
        return Utils.mapPage(inner, inner1 -> new NetworkFunctionSkuRoleDetailsImpl(inner1, this.manager()));
    }

    public PagedIterable<NetworkFunctionSkuRoleDetails> listBySku(
        String vendorName, String vendorSkuName, Context context) {
        PagedIterable<NetworkFunctionSkuRoleDetailsInner> inner =
            this.serviceClient().listBySku(vendorName, vendorSkuName, context);
        return Utils.mapPage(inner, inner1 -> new NetworkFunctionSkuRoleDetailsImpl(inner1, this.manager()));
    }

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

    private com.azure.resourcemanager.hybridnetwork.HybridNetworkManager manager() {
        return this.serviceManager;
    }
}
