<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for XAddOnModule StructType
 * @subpackage Structs
 */
class XAddOnModule extends AbstractStructBase
{
    /**
     * The loadInformation
     * Meta informations extracted from the WSDL
     * - documentation: Load Information is either the module's specific load information or the default load information.If any special load information is specified, the special attribute is set to TRUE. Otherwise, the load information is the default for
     * the product.
     * - maxOccurs: 1
     * - minOccurs: 1
     * - nillable: true
     * @var XLoadInformation
     */
    public $loadInformation;
    /**
     * The model
     * Meta informations extracted from the WSDL
     * - default: 7914 14-Button Line Expansion Module
     * - documentation: Model ID string.
     * - maxOccurs: 1
     * - minOccurs: 1
     * @var string
     */
    public $model;
    /**
     * The index
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * @var string
     */
    public $index;
    /**
     * Constructor method for XAddOnModule
     * @uses XAddOnModule::setLoadInformation()
     * @uses XAddOnModule::setModel()
     * @uses XAddOnModule::setIndex()
     * @param XLoadInformation $loadInformation
     * @param string $model
     * @param string $index
     */
    public function __construct(XLoadInformation $loadInformation = null, $model = '7914 14-Button Line Expansion Module', $index = null)
    {
        $this
            ->setLoadInformation($loadInformation)
            ->setModel($model)
            ->setIndex($index);
    }
    /**
     * Get loadInformation value
     * @return XLoadInformation
     */
    public function getLoadInformation()
    {
        return $this->loadInformation;
    }
    /**
     * Set loadInformation value
     * @param XLoadInformation $loadInformation
     * @return XAddOnModule
     */
    public function setLoadInformation(XLoadInformation $loadInformation = null)
    {
        $this->loadInformation = $loadInformation;
        return $this;
    }
    /**
     * Get model value
     * @return string
     */
    public function getModel()
    {
        return $this->model;
    }
    /**
     * Set model value
     * @uses XModel::valueIsValid()
     * @uses XModel::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $model
     * @return XAddOnModule
     */
    public function setModel($model = '7914 14-Button Line Expansion Module')
    {
        // validation for constraint: enumeration
        if (!XModel::valueIsValid($model)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $model, implode(', ', XModel::getValidValues())), __LINE__);
        }
        $this->model = $model;
        return $this;
    }
    /**
     * Get index value
     * @return string
     */
    public function getIndex()
    {
        return $this->index;
    }
    /**
     * Set index value
     * @uses XInteger::valueIsValid()
     * @uses XInteger::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $index
     * @return XAddOnModule
     */
    public function setIndex($index = null)
    {
        // validation for constraint: enumeration
        if (!XInteger::valueIsValid($index)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $index, implode(', ', XInteger::getValidValues())), __LINE__);
        }
        $this->index = $index;
        return $this;
    }
    /**
     * Method called when an object has been exported with var_export() functions
     * It allows to return an object instantiated with the values
     * @see AbstractStructBase::__set_state()
     * @uses AbstractStructBase::__set_state()
     * @param array $array the exported values
     * @return XAddOnModule
     */
    public static function __set_state(array $array)
    {
        return parent::__set_state($array);
    }
    /**
     * Method returning the class name
     * @return string __CLASS__
     */
    public function __toString()
    {
        return __CLASS__;
    }
}
