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

package com.azure.resourcemanager.automation.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.automation.fluent.models.DscNodeConfigurationAssociationProperty;
import com.fasterxml.jackson.annotation.JsonProperty;

/** The DscNodeUpdateParametersProperties model. */
@Fluent
public final class DscNodeUpdateParametersProperties {
    /*
     * Gets or sets the configuration of the node.
     */
    @JsonProperty(value = "nodeConfiguration")
    private DscNodeConfigurationAssociationProperty innerNodeConfiguration;

    /**
     * Get the innerNodeConfiguration property: Gets or sets the configuration of the node.
     *
     * @return the innerNodeConfiguration value.
     */
    private DscNodeConfigurationAssociationProperty innerNodeConfiguration() {
        return this.innerNodeConfiguration;
    }

    /**
     * Get the name property: Gets or sets the name of the dsc node configuration.
     *
     * @return the name value.
     */
    public String name() {
        return this.innerNodeConfiguration() == null ? null : this.innerNodeConfiguration().name();
    }

    /**
     * Set the name property: Gets or sets the name of the dsc node configuration.
     *
     * @param name the name value to set.
     * @return the DscNodeUpdateParametersProperties object itself.
     */
    public DscNodeUpdateParametersProperties withName(String name) {
        if (this.innerNodeConfiguration() == null) {
            this.innerNodeConfiguration = new DscNodeConfigurationAssociationProperty();
        }
        this.innerNodeConfiguration().withName(name);
        return this;
    }

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