// 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;

/** Emission policy properties. */
@Fluent
public final class EmissionPoliciesPropertiesFormat {
    /*
     * Emission format type.
     */
    @JsonProperty(value = "emissionType")
    private EmissionType emissionType;

    /*
     * Emission policy destinations.
     */
    @JsonProperty(value = "emissionDestinations")
    private List<EmissionPolicyDestination> emissionDestinations;

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

    /**
     * Get the emissionType property: Emission format type.
     *
     * @return the emissionType value.
     */
    public EmissionType emissionType() {
        return this.emissionType;
    }

    /**
     * Set the emissionType property: Emission format type.
     *
     * @param emissionType the emissionType value to set.
     * @return the EmissionPoliciesPropertiesFormat object itself.
     */
    public EmissionPoliciesPropertiesFormat withEmissionType(EmissionType emissionType) {
        this.emissionType = emissionType;
        return this;
    }

    /**
     * Get the emissionDestinations property: Emission policy destinations.
     *
     * @return the emissionDestinations value.
     */
    public List<EmissionPolicyDestination> emissionDestinations() {
        return this.emissionDestinations;
    }

    /**
     * Set the emissionDestinations property: Emission policy destinations.
     *
     * @param emissionDestinations the emissionDestinations value to set.
     * @return the EmissionPoliciesPropertiesFormat object itself.
     */
    public EmissionPoliciesPropertiesFormat withEmissionDestinations(
        List<EmissionPolicyDestination> emissionDestinations) {
        this.emissionDestinations = emissionDestinations;
        return this;
    }

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