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

package com.azure.resourcemanager.networkfunction.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Ingestion Policy properties. */
@Fluent
public final class IngestionPolicyPropertiesFormat {
    /*
     * The ingestion type.
     */
    @JsonProperty(value = "ingestionType")
    private IngestionType ingestionType;

    /*
     * Ingestion Sources.
     */
    @JsonProperty(value = "ingestionSources")
    private List<IngestionSourcesPropertiesFormat> ingestionSources;

    /** Creates an instance of IngestionPolicyPropertiesFormat class. */
    public IngestionPolicyPropertiesFormat() {
    }

    /**
     * Get the ingestionType property: The ingestion type.
     *
     * @return the ingestionType value.
     */
    public IngestionType ingestionType() {
        return this.ingestionType;
    }

    /**
     * Set the ingestionType property: The ingestion type.
     *
     * @param ingestionType the ingestionType value to set.
     * @return the IngestionPolicyPropertiesFormat object itself.
     */
    public IngestionPolicyPropertiesFormat withIngestionType(IngestionType ingestionType) {
        this.ingestionType = ingestionType;
        return this;
    }

    /**
     * Get the ingestionSources property: Ingestion Sources.
     *
     * @return the ingestionSources value.
     */
    public List<IngestionSourcesPropertiesFormat> ingestionSources() {
        return this.ingestionSources;
    }

    /**
     * Set the ingestionSources property: Ingestion Sources.
     *
     * @param ingestionSources the ingestionSources value to set.
     * @return the IngestionPolicyPropertiesFormat object itself.
     */
    public IngestionPolicyPropertiesFormat withIngestionSources(
        List<IngestionSourcesPropertiesFormat> ingestionSources) {
        this.ingestionSources = ingestionSources;
        return this;
    }

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