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

package com.azure.resourcemanager.attestation.implementation;

import com.azure.core.management.SystemData;
import com.azure.resourcemanager.attestation.fluent.models.AttestationProviderInner;
import com.azure.resourcemanager.attestation.fluent.models.AttestationProviderListResultInner;
import com.azure.resourcemanager.attestation.models.AttestationProvider;
import com.azure.resourcemanager.attestation.models.AttestationProviderListResult;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

public final class AttestationProviderListResultImpl implements AttestationProviderListResult {
    private AttestationProviderListResultInner innerObject;

    private final com.azure.resourcemanager.attestation.AttestationManager serviceManager;

    AttestationProviderListResultImpl(
        AttestationProviderListResultInner innerObject,
        com.azure.resourcemanager.attestation.AttestationManager serviceManager) {
        this.innerObject = innerObject;
        this.serviceManager = serviceManager;
    }

    public SystemData systemData() {
        return this.innerModel().systemData();
    }

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

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

    private com.azure.resourcemanager.attestation.AttestationManager manager() {
        return this.serviceManager;
    }
}
