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

/** Number of nodes based on the Filter. */
@Fluent
public final class NodeCount {
    /*
     * Gets the name of a count type
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * The properties property.
     */
    @JsonProperty(value = "properties")
    private NodeCountProperties properties;

    /**
     * Get the name property: Gets the name of a count type.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: Gets the name of a count type.
     *
     * @param name the name value to set.
     * @return the NodeCount object itself.
     */
    public NodeCount withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the properties property: The properties property.
     *
     * @return the properties value.
     */
    public NodeCountProperties properties() {
        return this.properties;
    }

    /**
     * Set the properties property: The properties property.
     *
     * @param properties the properties value to set.
     * @return the NodeCount object itself.
     */
    public NodeCount withProperties(NodeCountProperties properties) {
        this.properties = properties;
        return this;
    }

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