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

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

/** Network Tap Rule updatable properties. */
@Fluent
public class NetworkTapRulePatchableProperties {
    /*
     * Input method to configure Network Tap Rule.
     */
    @JsonProperty(value = "configurationType")
    private ConfigurationType configurationType;

    /*
     * Network Tap Rules file URL.
     */
    @JsonProperty(value = "tapRulesUrl")
    private String tapRulesUrl;

    /*
     * List of match configurations.
     */
    @JsonProperty(value = "matchConfigurations")
    private List<NetworkTapRuleMatchConfiguration> matchConfigurations;

    /*
     * List of dynamic match configurations.
     */
    @JsonProperty(value = "dynamicMatchConfigurations")
    private List<CommonDynamicMatchConfiguration> dynamicMatchConfigurations;

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

    /**
     * Get the configurationType property: Input method to configure Network Tap Rule.
     *
     * @return the configurationType value.
     */
    public ConfigurationType configurationType() {
        return this.configurationType;
    }

    /**
     * Set the configurationType property: Input method to configure Network Tap Rule.
     *
     * @param configurationType the configurationType value to set.
     * @return the NetworkTapRulePatchableProperties object itself.
     */
    public NetworkTapRulePatchableProperties withConfigurationType(ConfigurationType configurationType) {
        this.configurationType = configurationType;
        return this;
    }

    /**
     * Get the tapRulesUrl property: Network Tap Rules file URL.
     *
     * @return the tapRulesUrl value.
     */
    public String tapRulesUrl() {
        return this.tapRulesUrl;
    }

    /**
     * Set the tapRulesUrl property: Network Tap Rules file URL.
     *
     * @param tapRulesUrl the tapRulesUrl value to set.
     * @return the NetworkTapRulePatchableProperties object itself.
     */
    public NetworkTapRulePatchableProperties withTapRulesUrl(String tapRulesUrl) {
        this.tapRulesUrl = tapRulesUrl;
        return this;
    }

    /**
     * Get the matchConfigurations property: List of match configurations.
     *
     * @return the matchConfigurations value.
     */
    public List<NetworkTapRuleMatchConfiguration> matchConfigurations() {
        return this.matchConfigurations;
    }

    /**
     * Set the matchConfigurations property: List of match configurations.
     *
     * @param matchConfigurations the matchConfigurations value to set.
     * @return the NetworkTapRulePatchableProperties object itself.
     */
    public NetworkTapRulePatchableProperties withMatchConfigurations(
        List<NetworkTapRuleMatchConfiguration> matchConfigurations) {
        this.matchConfigurations = matchConfigurations;
        return this;
    }

    /**
     * Get the dynamicMatchConfigurations property: List of dynamic match configurations.
     *
     * @return the dynamicMatchConfigurations value.
     */
    public List<CommonDynamicMatchConfiguration> dynamicMatchConfigurations() {
        return this.dynamicMatchConfigurations;
    }

    /**
     * Set the dynamicMatchConfigurations property: List of dynamic match configurations.
     *
     * @param dynamicMatchConfigurations the dynamicMatchConfigurations value to set.
     * @return the NetworkTapRulePatchableProperties object itself.
     */
    public NetworkTapRulePatchableProperties withDynamicMatchConfigurations(
        List<CommonDynamicMatchConfiguration> dynamicMatchConfigurations) {
        this.dynamicMatchConfigurations = dynamicMatchConfigurations;
        return this;
    }

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