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

package com.azure.resourcemanager.paloaltonetworks.ngfw.models;

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

/** DNS Proxy settings for Firewall. */
@Fluent
public final class DnsSettings {
    /*
     * Enable DNS proxy, disabled by default
     */
    @JsonProperty(value = "enableDnsProxy")
    private DnsProxy enableDnsProxy;

    /*
     * Enabled DNS proxy type, disabled by default
     */
    @JsonProperty(value = "enabledDnsType")
    private EnabledDnsType enabledDnsType;

    /*
     * List of IPs associated with the Firewall
     */
    @JsonProperty(value = "dnsServers")
    private List<IpAddress> dnsServers;

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

    /**
     * Get the enableDnsProxy property: Enable DNS proxy, disabled by default.
     *
     * @return the enableDnsProxy value.
     */
    public DnsProxy enableDnsProxy() {
        return this.enableDnsProxy;
    }

    /**
     * Set the enableDnsProxy property: Enable DNS proxy, disabled by default.
     *
     * @param enableDnsProxy the enableDnsProxy value to set.
     * @return the DnsSettings object itself.
     */
    public DnsSettings withEnableDnsProxy(DnsProxy enableDnsProxy) {
        this.enableDnsProxy = enableDnsProxy;
        return this;
    }

    /**
     * Get the enabledDnsType property: Enabled DNS proxy type, disabled by default.
     *
     * @return the enabledDnsType value.
     */
    public EnabledDnsType enabledDnsType() {
        return this.enabledDnsType;
    }

    /**
     * Set the enabledDnsType property: Enabled DNS proxy type, disabled by default.
     *
     * @param enabledDnsType the enabledDnsType value to set.
     * @return the DnsSettings object itself.
     */
    public DnsSettings withEnabledDnsType(EnabledDnsType enabledDnsType) {
        this.enabledDnsType = enabledDnsType;
        return this;
    }

    /**
     * Get the dnsServers property: List of IPs associated with the Firewall.
     *
     * @return the dnsServers value.
     */
    public List<IpAddress> dnsServers() {
        return this.dnsServers;
    }

    /**
     * Set the dnsServers property: List of IPs associated with the Firewall.
     *
     * @param dnsServers the dnsServers value to set.
     * @return the DnsSettings object itself.
     */
    public DnsSettings withDnsServers(List<IpAddress> dnsServers) {
        this.dnsServers = dnsServers;
        return this;
    }

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