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

package com.azure.resourcemanager.netapp.implementation;

import com.azure.resourcemanager.netapp.fluent.models.SnapshotPolicyVolumeListInner;
import com.azure.resourcemanager.netapp.fluent.models.VolumeInner;
import com.azure.resourcemanager.netapp.models.SnapshotPolicyVolumeList;
import com.azure.resourcemanager.netapp.models.Volume;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

public final class SnapshotPolicyVolumeListImpl implements SnapshotPolicyVolumeList {
    private SnapshotPolicyVolumeListInner innerObject;

    private final com.azure.resourcemanager.netapp.NetAppFilesManager serviceManager;

    SnapshotPolicyVolumeListImpl(
        SnapshotPolicyVolumeListInner innerObject, com.azure.resourcemanager.netapp.NetAppFilesManager serviceManager) {
        this.innerObject = innerObject;
        this.serviceManager = serviceManager;
    }

    public List<Volume> value() {
        List<VolumeInner> inner = this.innerModel().value();
        if (inner != null) {
            return Collections
                .unmodifiableList(
                    inner.stream().map(inner1 -> new VolumeImpl(inner1, this.manager())).collect(Collectors.toList()));
        } else {
            return Collections.emptyList();
        }
    }

    public SnapshotPolicyVolumeListInner innerModel() {
        return this.innerObject;
    }

    private com.azure.resourcemanager.netapp.NetAppFilesManager manager() {
        return this.serviceManager;
    }
}
