// 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.ProvisioningState;
import com.azure.resourcemanager.networkfunction.models.ResourceReference;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Azure Traffic Collector resource properties. */
@Fluent
public final class AzureTrafficCollectorPropertiesFormat {
    /*
     * Collector Policies for Azure Traffic Collector.
     */
    @JsonProperty(value = "collectorPolicies", access = JsonProperty.Access.WRITE_ONLY)
    private List<ResourceReference> collectorPolicies;

    /*
     * The virtualHub to which the Azure Traffic Collector belongs.
     */
    @JsonProperty(value = "virtualHub")
    private ResourceReference virtualHub;

    /*
     * The provisioning state of the application rule collection resource.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

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

    /**
     * Get the collectorPolicies property: Collector Policies for Azure Traffic Collector.
     *
     * @return the collectorPolicies value.
     */
    public List<ResourceReference> collectorPolicies() {
        return this.collectorPolicies;
    }

    /**
     * Get the virtualHub property: The virtualHub to which the Azure Traffic Collector belongs.
     *
     * @return the virtualHub value.
     */
    public ResourceReference virtualHub() {
        return this.virtualHub;
    }

    /**
     * Set the virtualHub property: The virtualHub to which the Azure Traffic Collector belongs.
     *
     * @param virtualHub the virtualHub value to set.
     * @return the AzureTrafficCollectorPropertiesFormat object itself.
     */
    public AzureTrafficCollectorPropertiesFormat withVirtualHub(ResourceReference virtualHub) {
        this.virtualHub = virtualHub;
        return this;
    }

    /**
     * Get the provisioningState property: The provisioning state of the application rule collection resource.
     *
     * @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 (collectorPolicies() != null) {
            collectorPolicies().forEach(e -> e.validate());
        }
        if (virtualHub() != null) {
            virtualHub().validate();
        }
    }
}
