// 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.fluent.models;

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

/** The incident related entities response. */
@Fluent
public final class IncidentEntitiesResponseInner {
    /*
     * Array of the incident related entities.
     */
    @JsonProperty(value = "entities")
    private List<EntityInner> entities;

    /*
     * The metadata from the incident related entities results.
     */
    @JsonProperty(value = "metaData")
    private List<IncidentEntitiesResultsMetadata> metadata;

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

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

    /**
     * Get the metadata property: The metadata from the incident related entities results.
     *
     * @return the metadata value.
     */
    public List<IncidentEntitiesResultsMetadata> metadata() {
        return this.metadata;
    }

    /**
     * Set the metadata property: The metadata from the incident related entities results.
     *
     * @param metadata the metadata value to set.
     * @return the IncidentEntitiesResponseInner object itself.
     */
    public IncidentEntitiesResponseInner withMetadata(List<IncidentEntitiesResultsMetadata> metadata) {
        this.metadata = metadata;
        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 (metadata() != null) {
            metadata().forEach(e -> e.validate());
        }
    }
}
