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

package com.azure.resourcemanager.machinelearningservices.models;

import com.azure.core.annotation.Immutable;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;

/** Compute node information related to a AmlCompute. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "computeType")
@JsonTypeName("AmlCompute")
@Immutable
public final class AmlComputeNodesInformation extends ComputeNodesInformation {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(AmlComputeNodesInformation.class);

    /*
     * The collection of returned AmlCompute nodes details.
     */
    @JsonProperty(value = "nodes", access = JsonProperty.Access.WRITE_ONLY)
    private List<AmlComputeNodeInformation> nodes;

    /**
     * Get the nodes property: The collection of returned AmlCompute nodes details.
     *
     * @return the nodes value.
     */
    public List<AmlComputeNodeInformation> nodes() {
        return this.nodes;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (nodes() != null) {
            nodes().forEach(e -> e.validate());
        }
    }
}
