<?php

namespace Struct;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for AddPoints Struct
 * @subpackage Structs
 * @date 2019-10-21
 */
class AddPoints extends AbstractStructBase
{
    /**
     * The source
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $source;
    /**
     * The channel
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $channel;
    /**
     * The externalReferenceId
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var int
     */
    public $externalReferenceId;
    /**
     * The subscriberId
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $subscriberId;
    /**
     * The subscriberIdType
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var string
     */
    public $subscriberIdType;
    /**
     * The userId
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var int
     */
    public $userId;
    /**
     * The language
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $language;
    /**
     * The walletType
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $walletType;
    /**
     * The points
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var int
     */
    public $points;
    /**
     * The validFrom
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $validFrom;
    /**
     * The validTo
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $validTo;
    /**
     * The overwriteDefaultValidFrom
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var bool
     */
    public $overwriteDefaultValidFrom;
    /**
     * The overwriteDefaultValidTo
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var bool
     */
    public $overwriteDefaultValidTo;
    /**
     * The reasonId
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var int
     */
    public $reasonId;
    /**
     * The optionalLong
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var int
     */
    public $optionalLong;
    /**
     * The optionalString
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $optionalString;
    /**
     * The pointOrigin
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var string
     */
    public $pointOrigin;
    /**
     * Constructor method for AddPoints
     * @uses AddPoints::setSource()
     * @uses AddPoints::setChannel()
     * @uses AddPoints::setExternalReferenceId()
     * @uses AddPoints::setSubscriberId()
     * @uses AddPoints::setSubscriberIdType()
     * @uses AddPoints::setUserId()
     * @uses AddPoints::setLanguage()
     * @uses AddPoints::setWalletType()
     * @uses AddPoints::setPoints()
     * @uses AddPoints::setValidFrom()
     * @uses AddPoints::setValidTo()
     * @uses AddPoints::setOverwriteDefaultValidFrom()
     * @uses AddPoints::setOverwriteDefaultValidTo()
     * @uses AddPoints::setReasonId()
     * @uses AddPoints::setOptionalLong()
     * @uses AddPoints::setOptionalString()
     * @uses AddPoints::setPointOrigin()
     * @param string $source
     * @param string $channel
     * @param int $externalReferenceId
     * @param string $subscriberId
     * @param string $subscriberIdType
     * @param int $userId
     * @param string $language
     * @param string $walletType
     * @param int $points
     * @param string $validFrom
     * @param string $validTo
     * @param bool $overwriteDefaultValidFrom
     * @param bool $overwriteDefaultValidTo
     * @param int $reasonId
     * @param int $optionalLong
     * @param string $optionalString
     * @param string $pointOrigin
     */
    public function __construct($source = null, $channel = null, $externalReferenceId = null, $subscriberId = null, $subscriberIdType = null, $userId = null, $language = null, $walletType = null, $points = null, $validFrom = null, $validTo = null, $overwriteDefaultValidFrom = null, $overwriteDefaultValidTo = null, $reasonId = null, $optionalLong = null, $optionalString = null, $pointOrigin = null)
    {
        $this
            ->setSource($source)
            ->setChannel($channel)
            ->setExternalReferenceId($externalReferenceId)
            ->setSubscriberId($subscriberId)
            ->setSubscriberIdType($subscriberIdType)
            ->setUserId($userId)
            ->setLanguage($language)
            ->setWalletType($walletType)
            ->setPoints($points)
            ->setValidFrom($validFrom)
            ->setValidTo($validTo)
            ->setOverwriteDefaultValidFrom($overwriteDefaultValidFrom)
            ->setOverwriteDefaultValidTo($overwriteDefaultValidTo)
            ->setReasonId($reasonId)
            ->setOptionalLong($optionalLong)
            ->setOptionalString($optionalString)
            ->setPointOrigin($pointOrigin);
    }
    /**
     * Get source 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 getSource()
    {
        return isset($this->source) ? $this->source : null;
    }
    /**
     * Set source 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 $source
     * @return \Struct\AddPoints
     */
    public function setSource($source = null)
    {
        // validation for constraint: string
        if (!is_null($source) && !is_string($source)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($source, true), gettype($source)), __LINE__);
        }
        if (is_null($source) || (is_array($source) && empty($source))) {
            unset($this->source);
        } else {
            $this->source = $source;
        }
        return $this;
    }
    /**
     * Get channel 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 getChannel()
    {
        return isset($this->channel) ? $this->channel : null;
    }
    /**
     * Set channel 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 $channel
     * @return \Struct\AddPoints
     */
    public function setChannel($channel = null)
    {
        // validation for constraint: string
        if (!is_null($channel) && !is_string($channel)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($channel, true), gettype($channel)), __LINE__);
        }
        if (is_null($channel) || (is_array($channel) && empty($channel))) {
            unset($this->channel);
        } else {
            $this->channel = $channel;
        }
        return $this;
    }
    /**
     * Get externalReferenceId value
     * @return int|null
     */
    public function getExternalReferenceId()
    {
        return $this->externalReferenceId;
    }
    /**
     * Set externalReferenceId value
     * @param int $externalReferenceId
     * @return \Struct\AddPoints
     */
    public function setExternalReferenceId($externalReferenceId = null)
    {
        // validation for constraint: int
        if (!is_null($externalReferenceId) && !(is_int($externalReferenceId) || ctype_digit($externalReferenceId))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($externalReferenceId, true), gettype($externalReferenceId)), __LINE__);
        }
        $this->externalReferenceId = $externalReferenceId;
        return $this;
    }
    /**
     * Get subscriberId 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 getSubscriberId()
    {
        return isset($this->subscriberId) ? $this->subscriberId : null;
    }
    /**
     * Set subscriberId 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 $subscriberId
     * @return \Struct\AddPoints
     */
    public function setSubscriberId($subscriberId = null)
    {
        // validation for constraint: string
        if (!is_null($subscriberId) && !is_string($subscriberId)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($subscriberId, true), gettype($subscriberId)), __LINE__);
        }
        if (is_null($subscriberId) || (is_array($subscriberId) && empty($subscriberId))) {
            unset($this->subscriberId);
        } else {
            $this->subscriberId = $subscriberId;
        }
        return $this;
    }
    /**
     * Get subscriberIdType value
     * @return string|null
     */
    public function getSubscriberIdType()
    {
        return $this->subscriberIdType;
    }
    /**
     * Set subscriberIdType value
     * @uses \Enum\ParamType::valueIsValid()
     * @uses \Enum\ParamType::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $subscriberIdType
     * @return \Struct\AddPoints
     */
    public function setSubscriberIdType($subscriberIdType = null)
    {
        // validation for constraint: enumeration
        if (!\Enum\ParamType::valueIsValid($subscriberIdType)) {
            throw new \InvalidArgumentException(sprintf('Invalid value(s) %s, please use one of: %s from enumeration class \Enum\ParamType', is_array($subscriberIdType) ? implode(', ', $subscriberIdType) : var_export($subscriberIdType, true), implode(', ', \Enum\ParamType::getValidValues())), __LINE__);
        }
        $this->subscriberIdType = $subscriberIdType;
        return $this;
    }
    /**
     * Get userId 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 int|null
     */
    public function getUserId()
    {
        return isset($this->userId) ? $this->userId : null;
    }
    /**
     * Set userId 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 int $userId
     * @return \Struct\AddPoints
     */
    public function setUserId($userId = null)
    {
        // validation for constraint: int
        if (!is_null($userId) && !(is_int($userId) || ctype_digit($userId))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($userId, true), gettype($userId)), __LINE__);
        }
        if (is_null($userId) || (is_array($userId) && empty($userId))) {
            unset($this->userId);
        } else {
            $this->userId = $userId;
        }
        return $this;
    }
    /**
     * Get language 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 getLanguage()
    {
        return isset($this->language) ? $this->language : null;
    }
    /**
     * Set language 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 $language
     * @return \Struct\AddPoints
     */
    public function setLanguage($language = null)
    {
        // validation for constraint: string
        if (!is_null($language) && !is_string($language)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($language, true), gettype($language)), __LINE__);
        }
        if (is_null($language) || (is_array($language) && empty($language))) {
            unset($this->language);
        } else {
            $this->language = $language;
        }
        return $this;
    }
    /**
     * Get walletType 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 getWalletType()
    {
        return isset($this->walletType) ? $this->walletType : null;
    }
    /**
     * Set walletType 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 $walletType
     * @return \Struct\AddPoints
     */
    public function setWalletType($walletType = null)
    {
        // validation for constraint: string
        if (!is_null($walletType) && !is_string($walletType)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($walletType, true), gettype($walletType)), __LINE__);
        }
        if (is_null($walletType) || (is_array($walletType) && empty($walletType))) {
            unset($this->walletType);
        } else {
            $this->walletType = $walletType;
        }
        return $this;
    }
    /**
     * Get points value
     * @return int|null
     */
    public function getPoints()
    {
        return $this->points;
    }
    /**
     * Set points value
     * @param int $points
     * @return \Struct\AddPoints
     */
    public function setPoints($points = null)
    {
        // validation for constraint: int
        if (!is_null($points) && !(is_int($points) || ctype_digit($points))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($points, true), gettype($points)), __LINE__);
        }
        $this->points = $points;
        return $this;
    }
    /**
     * Get validFrom 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 getValidFrom()
    {
        return isset($this->validFrom) ? $this->validFrom : null;
    }
    /**
     * Set validFrom 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 $validFrom
     * @return \Struct\AddPoints
     */
    public function setValidFrom($validFrom = null)
    {
        // validation for constraint: string
        if (!is_null($validFrom) && !is_string($validFrom)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($validFrom, true), gettype($validFrom)), __LINE__);
        }
        if (is_null($validFrom) || (is_array($validFrom) && empty($validFrom))) {
            unset($this->validFrom);
        } else {
            $this->validFrom = $validFrom;
        }
        return $this;
    }
    /**
     * Get validTo 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 getValidTo()
    {
        return isset($this->validTo) ? $this->validTo : null;
    }
    /**
     * Set validTo 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 $validTo
     * @return \Struct\AddPoints
     */
    public function setValidTo($validTo = null)
    {
        // validation for constraint: string
        if (!is_null($validTo) && !is_string($validTo)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($validTo, true), gettype($validTo)), __LINE__);
        }
        if (is_null($validTo) || (is_array($validTo) && empty($validTo))) {
            unset($this->validTo);
        } else {
            $this->validTo = $validTo;
        }
        return $this;
    }
    /**
     * Get overwriteDefaultValidFrom value
     * @return bool|null
     */
    public function getOverwriteDefaultValidFrom()
    {
        return $this->overwriteDefaultValidFrom;
    }
    /**
     * Set overwriteDefaultValidFrom value
     * @param bool $overwriteDefaultValidFrom
     * @return \Struct\AddPoints
     */
    public function setOverwriteDefaultValidFrom($overwriteDefaultValidFrom = null)
    {
        // validation for constraint: boolean
        if (!is_null($overwriteDefaultValidFrom) && !is_bool($overwriteDefaultValidFrom)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($overwriteDefaultValidFrom, true), gettype($overwriteDefaultValidFrom)), __LINE__);
        }
        $this->overwriteDefaultValidFrom = $overwriteDefaultValidFrom;
        return $this;
    }
    /**
     * Get overwriteDefaultValidTo value
     * @return bool|null
     */
    public function getOverwriteDefaultValidTo()
    {
        return $this->overwriteDefaultValidTo;
    }
    /**
     * Set overwriteDefaultValidTo value
     * @param bool $overwriteDefaultValidTo
     * @return \Struct\AddPoints
     */
    public function setOverwriteDefaultValidTo($overwriteDefaultValidTo = null)
    {
        // validation for constraint: boolean
        if (!is_null($overwriteDefaultValidTo) && !is_bool($overwriteDefaultValidTo)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($overwriteDefaultValidTo, true), gettype($overwriteDefaultValidTo)), __LINE__);
        }
        $this->overwriteDefaultValidTo = $overwriteDefaultValidTo;
        return $this;
    }
    /**
     * Get reasonId 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 int|null
     */
    public function getReasonId()
    {
        return isset($this->reasonId) ? $this->reasonId : null;
    }
    /**
     * Set reasonId 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 int $reasonId
     * @return \Struct\AddPoints
     */
    public function setReasonId($reasonId = null)
    {
        // validation for constraint: int
        if (!is_null($reasonId) && !(is_int($reasonId) || ctype_digit($reasonId))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($reasonId, true), gettype($reasonId)), __LINE__);
        }
        if (is_null($reasonId) || (is_array($reasonId) && empty($reasonId))) {
            unset($this->reasonId);
        } else {
            $this->reasonId = $reasonId;
        }
        return $this;
    }
    /**
     * Get optionalLong 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 int|null
     */
    public function getOptionalLong()
    {
        return isset($this->optionalLong) ? $this->optionalLong : null;
    }
    /**
     * Set optionalLong 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 int $optionalLong
     * @return \Struct\AddPoints
     */
    public function setOptionalLong($optionalLong = null)
    {
        // validation for constraint: int
        if (!is_null($optionalLong) && !(is_int($optionalLong) || ctype_digit($optionalLong))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($optionalLong, true), gettype($optionalLong)), __LINE__);
        }
        if (is_null($optionalLong) || (is_array($optionalLong) && empty($optionalLong))) {
            unset($this->optionalLong);
        } else {
            $this->optionalLong = $optionalLong;
        }
        return $this;
    }
    /**
     * Get optionalString 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 getOptionalString()
    {
        return isset($this->optionalString) ? $this->optionalString : null;
    }
    /**
     * Set optionalString 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 $optionalString
     * @return \Struct\AddPoints
     */
    public function setOptionalString($optionalString = null)
    {
        // validation for constraint: string
        if (!is_null($optionalString) && !is_string($optionalString)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($optionalString, true), gettype($optionalString)), __LINE__);
        }
        if (is_null($optionalString) || (is_array($optionalString) && empty($optionalString))) {
            unset($this->optionalString);
        } else {
            $this->optionalString = $optionalString;
        }
        return $this;
    }
    /**
     * Get pointOrigin 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 getPointOrigin()
    {
        return isset($this->pointOrigin) ? $this->pointOrigin : null;
    }
    /**
     * Set pointOrigin 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 $pointOrigin
     * @return \Struct\AddPoints
     */
    public function setPointOrigin($pointOrigin = null)
    {
        // validation for constraint: string
        if (!is_null($pointOrigin) && !is_string($pointOrigin)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($pointOrigin, true), gettype($pointOrigin)), __LINE__);
        }
        if (is_null($pointOrigin) || (is_array($pointOrigin) && empty($pointOrigin))) {
            unset($this->pointOrigin);
        } else {
            $this->pointOrigin = $pointOrigin;
        }
        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 \Struct\AddPoints
     */
    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__;
    }
}
