// 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.fasterxml.jackson.annotation.JsonProperty;

/** Reference to DNS forwarding ruleset and associated virtual network link. */
@Fluent
public final class VirtualNetworkDnsForwardingRulesetInner {
    /*
     * DNS Forwarding Ruleset Resource ID.
     */
    @JsonProperty(value = "id")
    private String id;

    /*
     * Properties of the virtual network link sub-resource reference.
     */
    @JsonProperty(value = "properties")
    private VirtualNetworkLinkSubResourceProperties innerProperties;

    /**
     * Get the id property: DNS Forwarding Ruleset Resource ID.
     *
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

    /**
     * Set the id property: DNS Forwarding Ruleset Resource ID.
     *
     * @param id the id value to set.
     * @return the VirtualNetworkDnsForwardingRulesetInner object itself.
     */
    public VirtualNetworkDnsForwardingRulesetInner withId(String id) {
        this.id = id;
        return this;
    }

    /**
     * Get the innerProperties property: Properties of the virtual network link sub-resource reference.
     *
     * @return the innerProperties value.
     */
    private VirtualNetworkLinkSubResourceProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the virtualNetworkLink property: The reference to the virtual network link.
     *
     * @return the virtualNetworkLink value.
     */
    public SubResource virtualNetworkLink() {
        return this.innerProperties() == null ? null : this.innerProperties().virtualNetworkLink();
    }

    /**
     * Set the virtualNetworkLink property: The reference to the virtual network link.
     *
     * @param virtualNetworkLink the virtualNetworkLink value to set.
     * @return the VirtualNetworkDnsForwardingRulesetInner object itself.
     */
    public VirtualNetworkDnsForwardingRulesetInner withVirtualNetworkLink(SubResource virtualNetworkLink) {
        if (this.innerProperties() == null) {
            this.innerProperties = new VirtualNetworkLinkSubResourceProperties();
        }
        this.innerProperties().withVirtualNetworkLink(virtualNetworkLink);
        return this;
    }

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