<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for XDirNumberAliasLookupandSync StructType
 * @subpackage Structs
 */
class XDirNumberAliasLookupandSync extends AbstractStructBase
{
    /**
     * The ldapConfigName
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * - nillable: false
     * - maxLength: 50
     * @var string
     */
    public $ldapConfigName;
    /**
     * The ldapManagerDisgName
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * - nillable: false
     * - maxLength: 128
     * @var string
     */
    public $ldapManagerDisgName;
    /**
     * The ldapPassword
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * - nillable: false
     * - maxLength: 128
     * @var string
     */
    public $ldapPassword;
    /**
     * The ldapUserSearch
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * - nillable: false
     * - maxLength: 255
     * @var string
     */
    public $ldapUserSearch;
    /**
     * The servers
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 1
     * @var Servers
     */
    public $servers;
    /**
     * The ldapDirectoryServerUsage
     * Meta informations extracted from the WSDL
     * - default: DirSync
     * - maxOccurs: 1
     * - minOccurs: 0
     * - nillable: false
     * @var string
     */
    public $ldapDirectoryServerUsage;
    /**
     * The keepAliveSearch
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $keepAliveSearch;
    /**
     * The keepAliveTime
     * Meta informations extracted from the WSDL
     * - default: 5
     * - maxOccurs: 1
     * - minOccurs: 0
     * - nillable: false
     * @var string
     */
    public $keepAliveTime;
    /**
     * The sipAliasSuffix
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $sipAliasSuffix;
    /**
     * The enableCachingofRecords
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * - nillable: false
     * - pattern: (t)|(f)|(true)|(false)|(0)|(1)
     * @var string
     */
    public $enableCachingofRecords;
    /**
     * The cacheSizeforAliasLookup
     * Meta informations extracted from the WSDL
     * - default: 3000
     * - maxOccurs: 1
     * - minOccurs: 0
     * - nillable: false
     * @var string
     */
    public $cacheSizeforAliasLookup;
    /**
     * The cacheAgeforAliasLookup
     * Meta informations extracted from the WSDL
     * - default: 0
     * - maxOccurs: 1
     * - minOccurs: 0
     * - nillable: false
     * @var string
     */
    public $cacheAgeforAliasLookup;
    /**
     * Constructor method for XDirNumberAliasLookupandSync
     * @uses XDirNumberAliasLookupandSync::setLdapConfigName()
     * @uses XDirNumberAliasLookupandSync::setLdapManagerDisgName()
     * @uses XDirNumberAliasLookupandSync::setLdapPassword()
     * @uses XDirNumberAliasLookupandSync::setLdapUserSearch()
     * @uses XDirNumberAliasLookupandSync::setServers()
     * @uses XDirNumberAliasLookupandSync::setLdapDirectoryServerUsage()
     * @uses XDirNumberAliasLookupandSync::setKeepAliveSearch()
     * @uses XDirNumberAliasLookupandSync::setKeepAliveTime()
     * @uses XDirNumberAliasLookupandSync::setSipAliasSuffix()
     * @uses XDirNumberAliasLookupandSync::setEnableCachingofRecords()
     * @uses XDirNumberAliasLookupandSync::setCacheSizeforAliasLookup()
     * @uses XDirNumberAliasLookupandSync::setCacheAgeforAliasLookup()
     * @param string $ldapConfigName
     * @param string $ldapManagerDisgName
     * @param string $ldapPassword
     * @param string $ldapUserSearch
     * @param Servers $servers
     * @param string $ldapDirectoryServerUsage
     * @param string $keepAliveSearch
     * @param string $keepAliveTime
     * @param string $sipAliasSuffix
     * @param string $enableCachingofRecords
     * @param string $cacheSizeforAliasLookup
     * @param string $cacheAgeforAliasLookup
     */
    public function __construct($ldapConfigName = null, $ldapManagerDisgName = null, $ldapPassword = null, $ldapUserSearch = null, Servers $servers = null, $ldapDirectoryServerUsage = 'DirSync', $keepAliveSearch = null, $keepAliveTime = '5', $sipAliasSuffix = null, $enableCachingofRecords = null, $cacheSizeforAliasLookup = '3000', $cacheAgeforAliasLookup = '0')
    {
        $this
            ->setLdapConfigName($ldapConfigName)
            ->setLdapManagerDisgName($ldapManagerDisgName)
            ->setLdapPassword($ldapPassword)
            ->setLdapUserSearch($ldapUserSearch)
            ->setServers($servers)
            ->setLdapDirectoryServerUsage($ldapDirectoryServerUsage)
            ->setKeepAliveSearch($keepAliveSearch)
            ->setKeepAliveTime($keepAliveTime)
            ->setSipAliasSuffix($sipAliasSuffix)
            ->setEnableCachingofRecords($enableCachingofRecords)
            ->setCacheSizeforAliasLookup($cacheSizeforAliasLookup)
            ->setCacheAgeforAliasLookup($cacheAgeforAliasLookup);
    }
    /**
     * Get ldapConfigName value
     * @return string
     */
    public function getLdapConfigName()
    {
        return $this->ldapConfigName;
    }
    /**
     * Set ldapConfigName value
     * @param string $ldapConfigName
     * @return XDirNumberAliasLookupandSync
     */
    public function setLdapConfigName($ldapConfigName = null)
    {
        // validation for constraint: maxLength
        if ((is_scalar($ldapConfigName) && strlen($ldapConfigName) > 50) || (is_array($ldapConfigName) && count($ldapConfigName) > 50)) {
            throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 50 element(s) or a scalar of 50 character(s) at most, "%d" length given', is_scalar($ldapConfigName) ? strlen($ldapConfigName) : count($ldapConfigName)), __LINE__);
        }
        // validation for constraint: string
        if (!is_null($ldapConfigName) && !is_string($ldapConfigName)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($ldapConfigName)), __LINE__);
        }
        $this->ldapConfigName = $ldapConfigName;
        return $this;
    }
    /**
     * Get ldapManagerDisgName value
     * @return string
     */
    public function getLdapManagerDisgName()
    {
        return $this->ldapManagerDisgName;
    }
    /**
     * Set ldapManagerDisgName value
     * @param string $ldapManagerDisgName
     * @return XDirNumberAliasLookupandSync
     */
    public function setLdapManagerDisgName($ldapManagerDisgName = null)
    {
        // validation for constraint: maxLength
        if ((is_scalar($ldapManagerDisgName) && strlen($ldapManagerDisgName) > 128) || (is_array($ldapManagerDisgName) && count($ldapManagerDisgName) > 128)) {
            throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 128 element(s) or a scalar of 128 character(s) at most, "%d" length given', is_scalar($ldapManagerDisgName) ? strlen($ldapManagerDisgName) : count($ldapManagerDisgName)), __LINE__);
        }
        // validation for constraint: string
        if (!is_null($ldapManagerDisgName) && !is_string($ldapManagerDisgName)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($ldapManagerDisgName)), __LINE__);
        }
        $this->ldapManagerDisgName = $ldapManagerDisgName;
        return $this;
    }
    /**
     * Get ldapPassword value
     * @return string
     */
    public function getLdapPassword()
    {
        return $this->ldapPassword;
    }
    /**
     * Set ldapPassword value
     * @param string $ldapPassword
     * @return XDirNumberAliasLookupandSync
     */
    public function setLdapPassword($ldapPassword = null)
    {
        // validation for constraint: maxLength
        if ((is_scalar($ldapPassword) && strlen($ldapPassword) > 128) || (is_array($ldapPassword) && count($ldapPassword) > 128)) {
            throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 128 element(s) or a scalar of 128 character(s) at most, "%d" length given', is_scalar($ldapPassword) ? strlen($ldapPassword) : count($ldapPassword)), __LINE__);
        }
        // validation for constraint: string
        if (!is_null($ldapPassword) && !is_string($ldapPassword)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($ldapPassword)), __LINE__);
        }
        $this->ldapPassword = $ldapPassword;
        return $this;
    }
    /**
     * Get ldapUserSearch value
     * @return string
     */
    public function getLdapUserSearch()
    {
        return $this->ldapUserSearch;
    }
    /**
     * Set ldapUserSearch value
     * @param string $ldapUserSearch
     * @return XDirNumberAliasLookupandSync
     */
    public function setLdapUserSearch($ldapUserSearch = null)
    {
        // validation for constraint: maxLength
        if ((is_scalar($ldapUserSearch) && strlen($ldapUserSearch) > 255) || (is_array($ldapUserSearch) && count($ldapUserSearch) > 255)) {
            throw new \InvalidArgumentException(sprintf('Invalid length, please provide an array with 255 element(s) or a scalar of 255 character(s) at most, "%d" length given', is_scalar($ldapUserSearch) ? strlen($ldapUserSearch) : count($ldapUserSearch)), __LINE__);
        }
        // validation for constraint: string
        if (!is_null($ldapUserSearch) && !is_string($ldapUserSearch)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($ldapUserSearch)), __LINE__);
        }
        $this->ldapUserSearch = $ldapUserSearch;
        return $this;
    }
    /**
     * Get servers value
     * @return Servers
     */
    public function getServers()
    {
        return $this->servers;
    }
    /**
     * Set servers value
     * @param Servers $servers
     * @return XDirNumberAliasLookupandSync
     */
    public function setServers(Servers $servers = null)
    {
        $this->servers = $servers;
        return $this;
    }
    /**
     * Get ldapDirectoryServerUsage value
     * @return string|null
     */
    public function getLdapDirectoryServerUsage()
    {
        return $this->ldapDirectoryServerUsage;
    }
    /**
     * Set ldapDirectoryServerUsage value
     * @uses XLDAPDirectoryFunction::valueIsValid()
     * @uses XLDAPDirectoryFunction::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $ldapDirectoryServerUsage
     * @return XDirNumberAliasLookupandSync
     */
    public function setLdapDirectoryServerUsage($ldapDirectoryServerUsage = 'DirSync')
    {
        // validation for constraint: enumeration
        if (!XLDAPDirectoryFunction::valueIsValid($ldapDirectoryServerUsage)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $ldapDirectoryServerUsage, implode(', ', XLDAPDirectoryFunction::getValidValues())), __LINE__);
        }
        $this->ldapDirectoryServerUsage = $ldapDirectoryServerUsage;
        return $this;
    }
    /**
     * Get keepAliveSearch 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 string|null
     */
    public function getKeepAliveSearch()
    {
        return isset($this->keepAliveSearch) ? $this->keepAliveSearch : null;
    }
    /**
     * Set keepAliveSearch 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 string $keepAliveSearch
     * @return XDirNumberAliasLookupandSync
     */
    public function setKeepAliveSearch($keepAliveSearch = null)
    {
        // validation for constraint: string
        if (!is_null($keepAliveSearch) && !is_string($keepAliveSearch)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($keepAliveSearch)), __LINE__);
        }
        if (is_null($keepAliveSearch) || (is_array($keepAliveSearch) && empty($keepAliveSearch))) {
            unset($this->keepAliveSearch);
        } else {
            $this->keepAliveSearch = $keepAliveSearch;
        }
        return $this;
    }
    /**
     * Get keepAliveTime value
     * @return string|null
     */
    public function getKeepAliveTime()
    {
        return $this->keepAliveTime;
    }
    /**
     * Set keepAliveTime value
     * @uses XKeepAliveTimeInterval::valueIsValid()
     * @uses XKeepAliveTimeInterval::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $keepAliveTime
     * @return XDirNumberAliasLookupandSync
     */
    public function setKeepAliveTime($keepAliveTime = '5')
    {
        // validation for constraint: enumeration
        if (!XKeepAliveTimeInterval::valueIsValid($keepAliveTime)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $keepAliveTime, implode(', ', XKeepAliveTimeInterval::getValidValues())), __LINE__);
        }
        $this->keepAliveTime = $keepAliveTime;
        return $this;
    }
    /**
     * Get sipAliasSuffix 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 string|null
     */
    public function getSipAliasSuffix()
    {
        return isset($this->sipAliasSuffix) ? $this->sipAliasSuffix : null;
    }
    /**
     * Set sipAliasSuffix 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 string $sipAliasSuffix
     * @return XDirNumberAliasLookupandSync
     */
    public function setSipAliasSuffix($sipAliasSuffix = null)
    {
        // validation for constraint: string
        if (!is_null($sipAliasSuffix) && !is_string($sipAliasSuffix)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($sipAliasSuffix)), __LINE__);
        }
        if (is_null($sipAliasSuffix) || (is_array($sipAliasSuffix) && empty($sipAliasSuffix))) {
            unset($this->sipAliasSuffix);
        } else {
            $this->sipAliasSuffix = $sipAliasSuffix;
        }
        return $this;
    }
    /**
     * Get enableCachingofRecords value
     * @return string|null
     */
    public function getEnableCachingofRecords()
    {
        return $this->enableCachingofRecords;
    }
    /**
     * Set enableCachingofRecords value
     * @param string $enableCachingofRecords
     * @return XDirNumberAliasLookupandSync
     */
    public function setEnableCachingofRecords($enableCachingofRecords = null)
    {
        // validation for constraint: pattern
        if (is_scalar($enableCachingofRecords) && !preg_match('/(t)|(f)|(true)|(false)|(0)|(1)/', $enableCachingofRecords)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a scalar value that matches "(t)|(f)|(true)|(false)|(0)|(1)", "%s" given', var_export($enableCachingofRecords, true)), __LINE__);
        }
        // validation for constraint: string
        if (!is_null($enableCachingofRecords) && !is_string($enableCachingofRecords)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($enableCachingofRecords)), __LINE__);
        }
        $this->enableCachingofRecords = $enableCachingofRecords;
        return $this;
    }
    /**
     * Get cacheSizeforAliasLookup value
     * @return string|null
     */
    public function getCacheSizeforAliasLookup()
    {
        return $this->cacheSizeforAliasLookup;
    }
    /**
     * Set cacheSizeforAliasLookup value
     * @uses XInteger::valueIsValid()
     * @uses XInteger::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $cacheSizeforAliasLookup
     * @return XDirNumberAliasLookupandSync
     */
    public function setCacheSizeforAliasLookup($cacheSizeforAliasLookup = '3000')
    {
        // validation for constraint: enumeration
        if (!XInteger::valueIsValid($cacheSizeforAliasLookup)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $cacheSizeforAliasLookup, implode(', ', XInteger::getValidValues())), __LINE__);
        }
        $this->cacheSizeforAliasLookup = $cacheSizeforAliasLookup;
        return $this;
    }
    /**
     * Get cacheAgeforAliasLookup value
     * @return string|null
     */
    public function getCacheAgeforAliasLookup()
    {
        return $this->cacheAgeforAliasLookup;
    }
    /**
     * Set cacheAgeforAliasLookup value
     * @uses XInteger::valueIsValid()
     * @uses XInteger::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $cacheAgeforAliasLookup
     * @return XDirNumberAliasLookupandSync
     */
    public function setCacheAgeforAliasLookup($cacheAgeforAliasLookup = '0')
    {
        // validation for constraint: enumeration
        if (!XInteger::valueIsValid($cacheAgeforAliasLookup)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $cacheAgeforAliasLookup, implode(', ', XInteger::getValidValues())), __LINE__);
        }
        $this->cacheAgeforAliasLookup = $cacheAgeforAliasLookup;
        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 XDirNumberAliasLookupandSync
     */
    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__;
    }
}
