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

package com.azure.resourcemanager.securityinsights.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.securityinsights.fluent.models.EntityInner;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The expansion result values. */
@Fluent
public final class EntityExpandResponseValue {
    /*
     * Array of the expansion result entities.
     */
    @JsonProperty(value = "entities")
    private List<EntityInner> entities;

    /*
     * Array of edges that connects the entity to the list of entities.
     */
    @JsonProperty(value = "edges")
    private List<EntityEdges> edges;

    /**
     * Get the entities property: Array of the expansion result entities.
     *
     * @return the entities value.
     */
    public List<EntityInner> entities() {
        return this.entities;
    }

    /**
     * Set the entities property: Array of the expansion result entities.
     *
     * @param entities the entities value to set.
     * @return the EntityExpandResponseValue object itself.
     */
    public EntityExpandResponseValue withEntities(List<EntityInner> entities) {
        this.entities = entities;
        return this;
    }

    /**
     * Get the edges property: Array of edges that connects the entity to the list of entities.
     *
     * @return the edges value.
     */
    public List<EntityEdges> edges() {
        return this.edges;
    }

    /**
     * Set the edges property: Array of edges that connects the entity to the list of entities.
     *
     * @param edges the edges value to set.
     * @return the EntityExpandResponseValue object itself.
     */
    public EntityExpandResponseValue withEdges(List<EntityEdges> edges) {
        this.edges = edges;
        return this;
    }

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