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

package com.azure.resourcemanager.vmwarecloudsimple.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.vmwarecloudsimple.fluent.SkusAvailabilitiesClient;
import com.azure.resourcemanager.vmwarecloudsimple.fluent.models.SkuAvailabilityInner;
import com.azure.resourcemanager.vmwarecloudsimple.models.SkuAvailability;
import com.azure.resourcemanager.vmwarecloudsimple.models.SkusAvailabilities;

public final class SkusAvailabilitiesImpl implements SkusAvailabilities {
    private static final ClientLogger LOGGER = new ClientLogger(SkusAvailabilitiesImpl.class);

    private final SkusAvailabilitiesClient innerClient;

    private final com.azure.resourcemanager.vmwarecloudsimple.VMwareCloudSimpleManager serviceManager;

    public SkusAvailabilitiesImpl(
        SkusAvailabilitiesClient innerClient,
        com.azure.resourcemanager.vmwarecloudsimple.VMwareCloudSimpleManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public PagedIterable<SkuAvailability> list(String regionId) {
        PagedIterable<SkuAvailabilityInner> inner = this.serviceClient().list(regionId);
        return Utils.mapPage(inner, inner1 -> new SkuAvailabilityImpl(inner1, this.manager()));
    }

    public PagedIterable<SkuAvailability> list(String regionId, String skuId, Context context) {
        PagedIterable<SkuAvailabilityInner> inner = this.serviceClient().list(regionId, skuId, context);
        return Utils.mapPage(inner, inner1 -> new SkuAvailabilityImpl(inner1, this.manager()));
    }

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

    private com.azure.resourcemanager.vmwarecloudsimple.VMwareCloudSimpleManager manager() {
        return this.serviceManager;
    }
}
