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

package com.azure.resourcemanager.storagepool.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.storagepool.fluent.DiskPoolZonesClient;
import com.azure.resourcemanager.storagepool.fluent.models.DiskPoolZoneInfoInner;
import com.azure.resourcemanager.storagepool.models.DiskPoolZoneInfo;
import com.azure.resourcemanager.storagepool.models.DiskPoolZones;

public final class DiskPoolZonesImpl implements DiskPoolZones {
    private static final ClientLogger LOGGER = new ClientLogger(DiskPoolZonesImpl.class);

    private final DiskPoolZonesClient innerClient;

    private final com.azure.resourcemanager.storagepool.StoragePoolManager serviceManager;

    public DiskPoolZonesImpl(
        DiskPoolZonesClient innerClient, com.azure.resourcemanager.storagepool.StoragePoolManager serviceManager) {
        this.innerClient = innerClient;
        this.serviceManager = serviceManager;
    }

    public PagedIterable<DiskPoolZoneInfo> list(String location) {
        PagedIterable<DiskPoolZoneInfoInner> inner = this.serviceClient().list(location);
        return Utils.mapPage(inner, inner1 -> new DiskPoolZoneInfoImpl(inner1, this.manager()));
    }

    public PagedIterable<DiskPoolZoneInfo> list(String location, Context context) {
        PagedIterable<DiskPoolZoneInfoInner> inner = this.serviceClient().list(location, context);
        return Utils.mapPage(inner, inner1 -> new DiskPoolZoneInfoImpl(inner1, this.manager()));
    }

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

    private com.azure.resourcemanager.storagepool.StoragePoolManager manager() {
        return this.serviceManager;
    }
}
