lib/modularinputs/argument.js
function Argument(argumentConfig) {
        if (!argumentConfig) {
            argumentConfig = {};
        }

        this.name = utils.isUndefined(argumentConfig.name) ? "" : argumentConfig.name;
        this.description = utils.isUndefined(argumentConfig.description) ? null : argumentConfig.description;
        this.validation = utils.isUndefined(argumentConfig.validation) ? null : argumentConfig.validation;
        this.dataType = utils.isUndefined(argumentConfig.dataType) ? Argument.dataTypeString : argumentConfig.dataType;
        this.requiredOnEdit = utils.isUndefined(argumentConfig.requiredOnEdit) ? false : argumentConfig.requiredOnEdit;
        this.requiredOnCreate = utils.isUndefined(argumentConfig.requiredOnCreate) ? false : argumentConfig.requiredOnCreate;
    }
function Argument(argumentConfig) {
        if (!argumentConfig) {
            argumentConfig = {};
        }

        this.name = utils.isUndefined(argumentConfig.name) ? "" : argumentConfig.name;
        this.description = utils.isUndefined(argumentConfig.description) ? null : argumentConfig.description;
        this.validation = utils.isUndefined(argumentConfig.validation) ? null : argumentConfig.validation;
        this.dataType = utils.isUndefined(argumentConfig.dataType) ? Argument.dataTypeString : argumentConfig.dataType;
        this.requiredOnEdit = utils.isUndefined(argumentConfig.requiredOnEdit) ? false : argumentConfig.requiredOnEdit;
        this.requiredOnCreate = utils.isUndefined(argumentConfig.requiredOnCreate) ? false : argumentConfig.requiredOnCreate;
    }
function Argument ( argumentConfig ) { if ( ! argumentConfig ) { argumentConfig = { } ; } this . name = utils . isUndefined ( argumentConfig . name ) ? "" : argumentConfig . name ; this . description = utils . isUndefined ( argumentConfig . description ) ? null : argumentConfig . description ; this . validation = utils . isUndefined ( argumentConfig . validation ) ? null : argumentConfig . validation ; this . dataType = utils . isUndefined ( argumentConfig . dataType ) ? Argument . dataTypeString : argumentConfig . dataType ; this . requiredOnEdit = utils . isUndefined ( argumentConfig . requiredOnEdit ) ? false : argumentConfig . requiredOnEdit ; this . requiredOnCreate = utils . isUndefined ( argumentConfig . requiredOnCreate ) ? false : argumentConfig . requiredOnCreate ; }
Class representing an argument to a modular input kind.

`Argument` is meant to be used with `Scheme` to generate an XML
definition of the modular input kind that Splunk understands.

`name` is the only required parameter for the constructor.

@example

// Example with minimal parameters
var myArg1 = new Argument({name: "arg1"});

// Example with all parameters
var myArg2 = new Argument({
name: "arg1",
description: "This an argument with lots of parameters",
validation: "is_pos_int('some_name')",
dataType: Argument.dataTypeNumber,
requiredOnEdit: true,
requiredOnCreate: true
});

@param {Object} argumentConfig An object containing at least the name property to configure this Argument
@class splunkjs.ModularInputs.Argument
Class representing an argument to a modular input kind .