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

package com.azure.resourcemanager.datalakestore.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.datalakestore.fluent.models.UpdateVirtualNetworkRuleProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The parameters used to update a virtual network rule. */
@Fluent
public final class UpdateVirtualNetworkRuleParameters {
    /*
     * The virtual network rule properties to use when updating a virtual network rule.
     */
    @JsonProperty(value = "properties")
    private UpdateVirtualNetworkRuleProperties innerProperties;

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

    /**
     * Get the innerProperties property: The virtual network rule properties to use when updating a virtual network
     * rule.
     *
     * @return the innerProperties value.
     */
    private UpdateVirtualNetworkRuleProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the subnetId property: The resource identifier for the subnet.
     *
     * @return the subnetId value.
     */
    public String subnetId() {
        return this.innerProperties() == null ? null : this.innerProperties().subnetId();
    }

    /**
     * Set the subnetId property: The resource identifier for the subnet.
     *
     * @param subnetId the subnetId value to set.
     * @return the UpdateVirtualNetworkRuleParameters object itself.
     */
    public UpdateVirtualNetworkRuleParameters withSubnetId(String subnetId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new UpdateVirtualNetworkRuleProperties();
        }
        this.innerProperties().withSubnetId(subnetId);
        return this;
    }

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