<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for XRegionRelationship StructType
 * @subpackage Structs
 */
class XRegionRelationship extends AbstractStructBase
{
    /**
     * The regionName
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * @var XFkType
     */
    public $regionName;
    /**
     * The bandwidth
     * Meta informations extracted from the WSDL
     * - default: G.711
     * - maxOccurs: 1
     * - minOccurs: 1
     * @var string
     */
    public $bandwidth;
    /**
     * The videoBandwidth
     * Meta informations extracted from the WSDL
     * - default: 384
     * - maxOccurs: 1
     * - minOccurs: 1
     * @var string
     */
    public $videoBandwidth;
    /**
     * The immersiveVideoBandwidth
     * Meta informations extracted from the WSDL
     * - default: 2147483647
     * - maxOccurs: 1
     * - minOccurs: 1
     * @var string
     */
    public $immersiveVideoBandwidth;
    /**
     * The lossyNetwork
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var string
     */
    public $lossyNetwork;
    /**
     * The codecPreference
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * - nillable: true
     * @var XFkType
     */
    public $codecPreference;
    /**
     * Constructor method for XRegionRelationship
     * @uses XRegionRelationship::setRegionName()
     * @uses XRegionRelationship::setBandwidth()
     * @uses XRegionRelationship::setVideoBandwidth()
     * @uses XRegionRelationship::setImmersiveVideoBandwidth()
     * @uses XRegionRelationship::setLossyNetwork()
     * @uses XRegionRelationship::setCodecPreference()
     * @param XFkType $regionName
     * @param string $bandwidth
     * @param string $videoBandwidth
     * @param string $immersiveVideoBandwidth
     * @param string $lossyNetwork
     * @param XFkType $codecPreference
     */
    public function __construct(XFkType $regionName = null, $bandwidth = 'G.711', $videoBandwidth = '384', $immersiveVideoBandwidth = '2147483647', $lossyNetwork = null, XFkType $codecPreference = null)
    {
        $this
            ->setRegionName($regionName)
            ->setBandwidth($bandwidth)
            ->setVideoBandwidth($videoBandwidth)
            ->setImmersiveVideoBandwidth($immersiveVideoBandwidth)
            ->setLossyNetwork($lossyNetwork)
            ->setCodecPreference($codecPreference);
    }
    /**
     * Get regionName value
     * @return XFkType
     */
    public function getRegionName()
    {
        return $this->regionName;
    }
    /**
     * Set regionName value
     * @param XFkType $regionName
     * @return XRegionRelationship
     */
    public function setRegionName(XFkType $regionName = null)
    {
        $this->regionName = $regionName;
        return $this;
    }
    /**
     * Get bandwidth value
     * @return string
     */
    public function getBandwidth()
    {
        return $this->bandwidth;
    }
    /**
     * Set bandwidth value
     * @param string $bandwidth
     * @return XRegionRelationship
     */
    public function setBandwidth($bandwidth = 'G.711')
    {
        // validation for constraint: string
        if (!is_null($bandwidth) && !is_string($bandwidth)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($bandwidth)), __LINE__);
        }
        $this->bandwidth = $bandwidth;
        return $this;
    }
    /**
     * Get videoBandwidth value
     * @return string
     */
    public function getVideoBandwidth()
    {
        return $this->videoBandwidth;
    }
    /**
     * Set videoBandwidth value
     * @uses XInteger::valueIsValid()
     * @uses XInteger::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $videoBandwidth
     * @return XRegionRelationship
     */
    public function setVideoBandwidth($videoBandwidth = '384')
    {
        // validation for constraint: enumeration
        if (!XInteger::valueIsValid($videoBandwidth)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $videoBandwidth, implode(', ', XInteger::getValidValues())), __LINE__);
        }
        $this->videoBandwidth = $videoBandwidth;
        return $this;
    }
    /**
     * Get immersiveVideoBandwidth value
     * @return string
     */
    public function getImmersiveVideoBandwidth()
    {
        return $this->immersiveVideoBandwidth;
    }
    /**
     * Set immersiveVideoBandwidth value
     * @uses XInteger::valueIsValid()
     * @uses XInteger::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $immersiveVideoBandwidth
     * @return XRegionRelationship
     */
    public function setImmersiveVideoBandwidth($immersiveVideoBandwidth = '2147483647')
    {
        // validation for constraint: enumeration
        if (!XInteger::valueIsValid($immersiveVideoBandwidth)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $immersiveVideoBandwidth, implode(', ', XInteger::getValidValues())), __LINE__);
        }
        $this->immersiveVideoBandwidth = $immersiveVideoBandwidth;
        return $this;
    }
    /**
     * Get lossyNetwork value
     * @return string|null
     */
    public function getLossyNetwork()
    {
        return $this->lossyNetwork;
    }
    /**
     * Set lossyNetwork value
     * @uses XLossyNetwork::valueIsValid()
     * @uses XLossyNetwork::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $lossyNetwork
     * @return XRegionRelationship
     */
    public function setLossyNetwork($lossyNetwork = null)
    {
        // validation for constraint: enumeration
        if (!XLossyNetwork::valueIsValid($lossyNetwork)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $lossyNetwork, implode(', ', XLossyNetwork::getValidValues())), __LINE__);
        }
        $this->lossyNetwork = $lossyNetwork;
        return $this;
    }
    /**
     * Get codecPreference value
     * An additional test has been added (isset) before returning the property value as
     * this property may have been unset before, due to the fact that this property is
     * removable from the request (nillable=true+minOccurs=0)
     * @return XFkType|null
     */
    public function getCodecPreference()
    {
        return isset($this->codecPreference) ? $this->codecPreference : null;
    }
    /**
     * Set codecPreference value
     * This property is removable from request (nillable=true+minOccurs=0), therefore
     * if the value assigned to this property is null, it is removed from this object
     * @param XFkType $codecPreference
     * @return XRegionRelationship
     */
    public function setCodecPreference(XFkType $codecPreference = null)
    {
        if (is_null($codecPreference) || (is_array($codecPreference) && empty($codecPreference))) {
            unset($this->codecPreference);
        } else {
            $this->codecPreference = $codecPreference;
        }
        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 XRegionRelationship
     */
    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__;
    }
}
