// 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;
import java.util.List;

/** Definition of the activity parameter set. */
@Fluent
public final class ActivityParameterSet {
    /*
     * Gets or sets the name of the activity parameter set.
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * Gets or sets the parameters of the activity parameter set.
     */
    @JsonProperty(value = "parameters")
    private List<ActivityParameter> parameters;

    /**
     * Get the name property: Gets or sets the name of the activity parameter set.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: Gets or sets the name of the activity parameter set.
     *
     * @param name the name value to set.
     * @return the ActivityParameterSet object itself.
     */
    public ActivityParameterSet withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the parameters property: Gets or sets the parameters of the activity parameter set.
     *
     * @return the parameters value.
     */
    public List<ActivityParameter> parameters() {
        return this.parameters;
    }

    /**
     * Set the parameters property: Gets or sets the parameters of the activity parameter set.
     *
     * @param parameters the parameters value to set.
     * @return the ActivityParameterSet object itself.
     */
    public ActivityParameterSet withParameters(List<ActivityParameter> parameters) {
        this.parameters = parameters;
        return this;
    }

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