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

package com.azure.resourcemanager.automation.implementation;

import com.azure.resourcemanager.automation.fluent.models.SoftwareUpdateConfigurationRunInner;
import com.azure.resourcemanager.automation.fluent.models.SoftwareUpdateConfigurationRunListResultInner;
import com.azure.resourcemanager.automation.models.SoftwareUpdateConfigurationRun;
import com.azure.resourcemanager.automation.models.SoftwareUpdateConfigurationRunListResult;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

public final class SoftwareUpdateConfigurationRunListResultImpl implements SoftwareUpdateConfigurationRunListResult {
    private SoftwareUpdateConfigurationRunListResultInner innerObject;

    private final com.azure.resourcemanager.automation.AutomationManager serviceManager;

    SoftwareUpdateConfigurationRunListResultImpl(
        SoftwareUpdateConfigurationRunListResultInner innerObject,
        com.azure.resourcemanager.automation.AutomationManager serviceManager) {
        this.innerObject = innerObject;
        this.serviceManager = serviceManager;
    }

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

    public String nextLink() {
        return this.innerModel().nextLink();
    }

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

    private com.azure.resourcemanager.automation.AutomationManager manager() {
        return this.serviceManager;
    }
}
