// 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;

/**
 * BareMetalMachineCommandSpecification represents the command and optional arguments to exercise against the bare metal
 * machine.
 */
@Fluent
public final class BareMetalMachineCommandSpecification {
    /*
     * 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 command to execute against the bare metal machine.
     */
    @JsonProperty(value = "command", required = true)
    private String command;

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

    /**
     * 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 BareMetalMachineCommandSpecification object itself.
     */
    public BareMetalMachineCommandSpecification withArguments(List<String> arguments) {
        this.arguments = arguments;
        return this;
    }

    /**
     * Get the command property: The command to execute against the bare metal machine.
     *
     * @return the command value.
     */
    public String command() {
        return this.command;
    }

    /**
     * Set the command property: The command to execute against the bare metal machine.
     *
     * @param command the command value to set.
     * @return the BareMetalMachineCommandSpecification object itself.
     */
    public BareMetalMachineCommandSpecification 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 BareMetalMachineCommandSpecification"));
        }
    }

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