<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for callInfoForPickupNotification StructType
 * Meta informations extracted from the WSDL
 * - documentation: This tag is applicable when Pickup Notification Policy is "Visual Alert" or "Visual or Audio Alert". | This tag is applicable when Pickup Notification Policy is "Visual Alert" or "Visual or Audio Alert".
 * @subpackage Structs
 */
class CallInfoForPickupNotification extends AbstractStructBase
{
    /**
     * The callingPartyInfo
     * Meta informations extracted from the WSDL
     * - default: false
     * - maxOccurs: 1
     * - minOccurs: 0
     * - nillable: false
     * - pattern: (t)|(f)|(true)|(false)|(0)|(1)
     * @var string
     */
    public $callingPartyInfo;
    /**
     * The calledPartyInfo
     * Meta informations extracted from the WSDL
     * - default: false
     * - maxOccurs: 1
     * - minOccurs: 0
     * - nillable: false
     * - pattern: (t)|(f)|(true)|(false)|(0)|(1)
     * @var string
     */
    public $calledPartyInfo;
    /**
     * Constructor method for callInfoForPickupNotification
     * @uses CallInfoForPickupNotification::setCallingPartyInfo()
     * @uses CallInfoForPickupNotification::setCalledPartyInfo()
     * @param string $callingPartyInfo
     * @param string $calledPartyInfo
     */
    public function __construct($callingPartyInfo = false, $calledPartyInfo = false)
    {
        $this
            ->setCallingPartyInfo($callingPartyInfo)
            ->setCalledPartyInfo($calledPartyInfo);
    }
    /**
     * Get callingPartyInfo value
     * @return string|null
     */
    public function getCallingPartyInfo()
    {
        return $this->callingPartyInfo;
    }
    /**
     * Set callingPartyInfo value
     * @param string $callingPartyInfo
     * @return CallInfoForPickupNotification
     */
    public function setCallingPartyInfo($callingPartyInfo = false)
    {
        // validation for constraint: pattern
        if (is_scalar($callingPartyInfo) && !preg_match('/(t)|(f)|(true)|(false)|(0)|(1)/', $callingPartyInfo)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a scalar value that matches "(t)|(f)|(true)|(false)|(0)|(1)", "%s" given', var_export($callingPartyInfo, true)), __LINE__);
        }
        // validation for constraint: string
        if (!is_null($callingPartyInfo) && !is_string($callingPartyInfo)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($callingPartyInfo)), __LINE__);
        }
        $this->callingPartyInfo = $callingPartyInfo;
        return $this;
    }
    /**
     * Get calledPartyInfo value
     * @return string|null
     */
    public function getCalledPartyInfo()
    {
        return $this->calledPartyInfo;
    }
    /**
     * Set calledPartyInfo value
     * @param string $calledPartyInfo
     * @return CallInfoForPickupNotification
     */
    public function setCalledPartyInfo($calledPartyInfo = false)
    {
        // validation for constraint: pattern
        if (is_scalar($calledPartyInfo) && !preg_match('/(t)|(f)|(true)|(false)|(0)|(1)/', $calledPartyInfo)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a scalar value that matches "(t)|(f)|(true)|(false)|(0)|(1)", "%s" given', var_export($calledPartyInfo, true)), __LINE__);
        }
        // validation for constraint: string
        if (!is_null($calledPartyInfo) && !is_string($calledPartyInfo)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($calledPartyInfo)), __LINE__);
        }
        $this->calledPartyInfo = $calledPartyInfo;
        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 CallInfoForPickupNotification
     */
    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__;
    }
}
