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

package com.azure.resourcemanager.networkcloud.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/**
 * StorageApplianceCommandSpecification represents the read-only command and optional arguments to execute against a
 * storage appliance.
 */
@Fluent
public final class StorageApplianceCommandSpecification {
    /*
     * The list of string arguments that will be passed to the script in order as separate arguments.
     */
    @JsonProperty(value = "arguments")
    private List<String> arguments;

    /*
     * The read-only command to execute against the storage appliance.
     */
    @JsonProperty(value = "command", required = true)
    private String command;

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

    /**
     * Get the arguments property: The list of string arguments that will be passed to the script in order as separate
     * arguments.
     *
     * @return the arguments value.
     */
    public List<String> arguments() {
        return this.arguments;
    }

    /**
     * Set the arguments property: The list of string arguments that will be passed to the script in order as separate
     * arguments.
     *
     * @param arguments the arguments value to set.
     * @return the StorageApplianceCommandSpecification object itself.
     */
    public StorageApplianceCommandSpecification withArguments(List<String> arguments) {
        this.arguments = arguments;
        return this;
    }

    /**
     * Get the command property: The read-only command to execute against the storage appliance.
     *
     * @return the command value.
     */
    public String command() {
        return this.command;
    }

    /**
     * Set the command property: The read-only command to execute against the storage appliance.
     *
     * @param command the command value to set.
     * @return the StorageApplianceCommandSpecification object itself.
     */
    public StorageApplianceCommandSpecification withCommand(String command) {
        this.command = command;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (command() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property command in model StorageApplianceCommandSpecification"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(StorageApplianceCommandSpecification.class);
}
