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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.networkfunction.models.EmissionPoliciesPropertiesFormat;
import com.azure.resourcemanager.networkfunction.models.IngestionPolicyPropertiesFormat;
import com.azure.resourcemanager.networkfunction.models.ProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Collection policy properties. */
@Fluent
public final class CollectorPolicyPropertiesFormat {
    /*
     * Ingestion policies.
     */
    @JsonProperty(value = "ingestionPolicy")
    private IngestionPolicyPropertiesFormat ingestionPolicy;

    /*
     * Emission policies.
     */
    @JsonProperty(value = "emissionPolicies")
    private List<EmissionPoliciesPropertiesFormat> emissionPolicies;

    /*
     * The provisioning state.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

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

    /**
     * Get the ingestionPolicy property: Ingestion policies.
     *
     * @return the ingestionPolicy value.
     */
    public IngestionPolicyPropertiesFormat ingestionPolicy() {
        return this.ingestionPolicy;
    }

    /**
     * Set the ingestionPolicy property: Ingestion policies.
     *
     * @param ingestionPolicy the ingestionPolicy value to set.
     * @return the CollectorPolicyPropertiesFormat object itself.
     */
    public CollectorPolicyPropertiesFormat withIngestionPolicy(IngestionPolicyPropertiesFormat ingestionPolicy) {
        this.ingestionPolicy = ingestionPolicy;
        return this;
    }

    /**
     * Get the emissionPolicies property: Emission policies.
     *
     * @return the emissionPolicies value.
     */
    public List<EmissionPoliciesPropertiesFormat> emissionPolicies() {
        return this.emissionPolicies;
    }

    /**
     * Set the emissionPolicies property: Emission policies.
     *
     * @param emissionPolicies the emissionPolicies value to set.
     * @return the CollectorPolicyPropertiesFormat object itself.
     */
    public CollectorPolicyPropertiesFormat withEmissionPolicies(
        List<EmissionPoliciesPropertiesFormat> emissionPolicies) {
        this.emissionPolicies = emissionPolicies;
        return this;
    }

    /**
     * Get the provisioningState property: The provisioning state.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

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