<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for audioSource StructType
 * @subpackage Structs
 */
class AudioSource extends AbstractStructBase
{
    /**
     * The sourceId
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * - nillable: false
     * @var string
     */
    public $sourceId;
    /**
     * The maxHops
     * Meta informations extracted from the WSDL
     * - default: 2
     * - maxOccurs: 1
     * - minOccurs: 0
     * - nillable: false
     * @var string
     */
    public $maxHops;
    /**
     * Constructor method for audioSource
     * @uses AudioSource::setSourceId()
     * @uses AudioSource::setMaxHops()
     * @param string $sourceId
     * @param string $maxHops
     */
    public function __construct($sourceId = null, $maxHops = '2')
    {
        $this
            ->setSourceId($sourceId)
            ->setMaxHops($maxHops);
    }
    /**
     * Get sourceId value
     * @return string|null
     */
    public function getSourceId()
    {
        return $this->sourceId;
    }
    /**
     * Set sourceId value
     * @uses XInteger::valueIsValid()
     * @uses XInteger::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $sourceId
     * @return AudioSource
     */
    public function setSourceId($sourceId = null)
    {
        // validation for constraint: enumeration
        if (!XInteger::valueIsValid($sourceId)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $sourceId, implode(', ', XInteger::getValidValues())), __LINE__);
        }
        $this->sourceId = $sourceId;
        return $this;
    }
    /**
     * Get maxHops value
     * @return string|null
     */
    public function getMaxHops()
    {
        return $this->maxHops;
    }
    /**
     * Set maxHops value
     * @uses XInteger::valueIsValid()
     * @uses XInteger::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $maxHops
     * @return AudioSource
     */
    public function setMaxHops($maxHops = '2')
    {
        // validation for constraint: enumeration
        if (!XInteger::valueIsValid($maxHops)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $maxHops, implode(', ', XInteger::getValidValues())), __LINE__);
        }
        $this->maxHops = $maxHops;
        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 AudioSource
     */
    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__;
    }
}
