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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.SubResource;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.dnsresolver.models.ProvisioningState;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Represents the properties of a DNS forwarding ruleset. */
@Fluent
public final class DnsForwardingRulesetProperties {
    /*
     * The reference to the DNS resolver outbound endpoints that are used to route DNS queries matching the forwarding
     * rules in the ruleset to the target DNS servers.
     */
    @JsonProperty(value = "dnsResolverOutboundEndpoints", required = true)
    private List<SubResource> dnsResolverOutboundEndpoints;

    /*
     * The current provisioning state of the DNS forwarding ruleset. This is a read-only property and any attempt to
     * set this value will be ignored.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

    /*
     * The resourceGuid for the DNS forwarding ruleset.
     */
    @JsonProperty(value = "resourceGuid", access = JsonProperty.Access.WRITE_ONLY)
    private String resourceGuid;

    /**
     * Get the dnsResolverOutboundEndpoints property: The reference to the DNS resolver outbound endpoints that are used
     * to route DNS queries matching the forwarding rules in the ruleset to the target DNS servers.
     *
     * @return the dnsResolverOutboundEndpoints value.
     */
    public List<SubResource> dnsResolverOutboundEndpoints() {
        return this.dnsResolverOutboundEndpoints;
    }

    /**
     * Set the dnsResolverOutboundEndpoints property: The reference to the DNS resolver outbound endpoints that are used
     * to route DNS queries matching the forwarding rules in the ruleset to the target DNS servers.
     *
     * @param dnsResolverOutboundEndpoints the dnsResolverOutboundEndpoints value to set.
     * @return the DnsForwardingRulesetProperties object itself.
     */
    public DnsForwardingRulesetProperties withDnsResolverOutboundEndpoints(
        List<SubResource> dnsResolverOutboundEndpoints) {
        this.dnsResolverOutboundEndpoints = dnsResolverOutboundEndpoints;
        return this;
    }

    /**
     * Get the provisioningState property: The current provisioning state of the DNS forwarding ruleset. This is a
     * read-only property and any attempt to set this value will be ignored.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the resourceGuid property: The resourceGuid for the DNS forwarding ruleset.
     *
     * @return the resourceGuid value.
     */
    public String resourceGuid() {
        return this.resourceGuid;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (dnsResolverOutboundEndpoints() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property dnsResolverOutboundEndpoints in model"
                            + " DnsForwardingRulesetProperties"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(DnsForwardingRulesetProperties.class);
}
