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

package com.azure.resourcemanager.managednetworkfabric.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.managednetworkfabric.models.AnnotationResource;
import com.azure.resourcemanager.managednetworkfabric.models.NetworkTapPatchableParametersDestinationsItem;
import com.azure.resourcemanager.managednetworkfabric.models.PollingType;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The Network Tap resource patch definition. */
@Fluent
public final class NetworkTapPatchableParameters extends AnnotationResource {
    /*
     * Polling type.
     */
    @JsonProperty(value = "pollingType")
    private PollingType pollingType;

    /*
     * List of destination properties to send the filter traffic.
     */
    @JsonProperty(value = "destinations")
    private List<NetworkTapPatchableParametersDestinationsItem> destinations;

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

    /**
     * Get the pollingType property: Polling type.
     *
     * @return the pollingType value.
     */
    public PollingType pollingType() {
        return this.pollingType;
    }

    /**
     * Set the pollingType property: Polling type.
     *
     * @param pollingType the pollingType value to set.
     * @return the NetworkTapPatchableParameters object itself.
     */
    public NetworkTapPatchableParameters withPollingType(PollingType pollingType) {
        this.pollingType = pollingType;
        return this;
    }

    /**
     * Get the destinations property: List of destination properties to send the filter traffic.
     *
     * @return the destinations value.
     */
    public List<NetworkTapPatchableParametersDestinationsItem> destinations() {
        return this.destinations;
    }

    /**
     * Set the destinations property: List of destination properties to send the filter traffic.
     *
     * @param destinations the destinations value to set.
     * @return the NetworkTapPatchableParameters object itself.
     */
    public NetworkTapPatchableParameters withDestinations(
        List<NetworkTapPatchableParametersDestinationsItem> destinations) {
        this.destinations = destinations;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public NetworkTapPatchableParameters withAnnotation(String annotation) {
        super.withAnnotation(annotation);
        return this;
    }

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