<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for XMeetMe StructType
 * @subpackage Structs
 */
class XMeetMe extends AbstractStructBase
{
    /**
     * The pattern
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * - nillable: false
     * @var string
     */
    public $pattern;
    /**
     * The minimumSecurityLevel
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * - nillable: true
     * @var string
     */
    public $minimumSecurityLevel;
    /**
     * The description
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * - nillable: false
     * @var string
     */
    public $description;
    /**
     * The routePartitionName
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * - nillable: true
     * @var XFkType
     */
    public $routePartitionName;
    /**
     * Constructor method for XMeetMe
     * @uses XMeetMe::setPattern()
     * @uses XMeetMe::setMinimumSecurityLevel()
     * @uses XMeetMe::setDescription()
     * @uses XMeetMe::setRoutePartitionName()
     * @param string $pattern
     * @param string $minimumSecurityLevel
     * @param string $description
     * @param XFkType $routePartitionName
     */
    public function __construct($pattern = null, $minimumSecurityLevel = null, $description = null, XFkType $routePartitionName = null)
    {
        $this
            ->setPattern($pattern)
            ->setMinimumSecurityLevel($minimumSecurityLevel)
            ->setDescription($description)
            ->setRoutePartitionName($routePartitionName);
    }
    /**
     * Get pattern value
     * @return string
     */
    public function getPattern()
    {
        return $this->pattern;
    }
    /**
     * Set pattern value
     * @param string $pattern
     * @return XMeetMe
     */
    public function setPattern($pattern = null)
    {
        // validation for constraint: string
        if (!is_null($pattern) && !is_string($pattern)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($pattern)), __LINE__);
        }
        $this->pattern = $pattern;
        return $this;
    }
    /**
     * Get minimumSecurityLevel value
     * @return string
     */
    public function getMinimumSecurityLevel()
    {
        return $this->minimumSecurityLevel;
    }
    /**
     * Set minimumSecurityLevel value
     * @uses XDeviceSecurityMode::valueIsValid()
     * @uses XDeviceSecurityMode::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $minimumSecurityLevel
     * @return XMeetMe
     */
    public function setMinimumSecurityLevel($minimumSecurityLevel = null)
    {
        // validation for constraint: enumeration
        if (!XDeviceSecurityMode::valueIsValid($minimumSecurityLevel)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $minimumSecurityLevel, implode(', ', XDeviceSecurityMode::getValidValues())), __LINE__);
        }
        $this->minimumSecurityLevel = $minimumSecurityLevel;
        return $this;
    }
    /**
     * Get description value
     * @return string|null
     */
    public function getDescription()
    {
        return $this->description;
    }
    /**
     * Set description value
     * @param string $description
     * @return XMeetMe
     */
    public function setDescription($description = null)
    {
        // validation for constraint: string
        if (!is_null($description) && !is_string($description)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($description)), __LINE__);
        }
        $this->description = $description;
        return $this;
    }
    /**
     * Get routePartitionName 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 getRoutePartitionName()
    {
        return isset($this->routePartitionName) ? $this->routePartitionName : null;
    }
    /**
     * Set routePartitionName 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 $routePartitionName
     * @return XMeetMe
     */
    public function setRoutePartitionName(XFkType $routePartitionName = null)
    {
        if (is_null($routePartitionName) || (is_array($routePartitionName) && empty($routePartitionName))) {
            unset($this->routePartitionName);
        } else {
            $this->routePartitionName = $routePartitionName;
        }
        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 XMeetMe
     */
    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__;
    }
}
