<?php

namespace patest\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for Security.SecurityTokenDefaultAccessRules StructType
 * @subpackage Structs
 */
class Security_SecurityTokenDefaultAccessRules extends AnyEntity
{
    /**
     * The IsAdminModifyAllowed
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var int
     */
    public $IsAdminModifyAllowed;
    /**
     * The IsAdminViewAllowed
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var int
     */
    public $IsAdminViewAllowed;
    /**
     * The IsCrmAllowed
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var int
     */
    public $IsCrmAllowed;
    /**
     * The IsMarketingAllowed
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var int
     */
    public $IsMarketingAllowed;
    /**
     * The IsReportsAllowed
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var int
     */
    public $IsReportsAllowed;
    /**
     * The IsSalesAllowed
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * - nillable: true
     * @var int
     */
    public $IsSalesAllowed;
    /**
     * Constructor method for Security.SecurityTokenDefaultAccessRules
     * @uses Security_SecurityTokenDefaultAccessRules::setIsAdminModifyAllowed()
     * @uses Security_SecurityTokenDefaultAccessRules::setIsAdminViewAllowed()
     * @uses Security_SecurityTokenDefaultAccessRules::setIsCrmAllowed()
     * @uses Security_SecurityTokenDefaultAccessRules::setIsMarketingAllowed()
     * @uses Security_SecurityTokenDefaultAccessRules::setIsReportsAllowed()
     * @uses Security_SecurityTokenDefaultAccessRules::setIsSalesAllowed()
     * @param int $isAdminModifyAllowed
     * @param int $isAdminViewAllowed
     * @param int $isCrmAllowed
     * @param int $isMarketingAllowed
     * @param int $isReportsAllowed
     * @param int $isSalesAllowed
     */
    public function __construct($isAdminModifyAllowed = null, $isAdminViewAllowed = null, $isCrmAllowed = null, $isMarketingAllowed = null, $isReportsAllowed = null, $isSalesAllowed = null)
    {
        $this
            ->setIsAdminModifyAllowed($isAdminModifyAllowed)
            ->setIsAdminViewAllowed($isAdminViewAllowed)
            ->setIsCrmAllowed($isCrmAllowed)
            ->setIsMarketingAllowed($isMarketingAllowed)
            ->setIsReportsAllowed($isReportsAllowed)
            ->setIsSalesAllowed($isSalesAllowed);
    }
    /**
     * Get IsAdminModifyAllowed 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 getIsAdminModifyAllowed()
    {
        return isset($this->IsAdminModifyAllowed) ? $this->IsAdminModifyAllowed : null;
    }
    /**
     * Set IsAdminModifyAllowed 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 $isAdminModifyAllowed
     * @return \patest\StructType\Security_SecurityTokenDefaultAccessRules
     */
    public function setIsAdminModifyAllowed($isAdminModifyAllowed = null)
    {
        // validation for constraint: int
        if (!is_null($isAdminModifyAllowed) && !(is_int($isAdminModifyAllowed) || ctype_digit($isAdminModifyAllowed))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($isAdminModifyAllowed, true), gettype($isAdminModifyAllowed)), __LINE__);
        }
        if (is_null($isAdminModifyAllowed) || (is_array($isAdminModifyAllowed) && empty($isAdminModifyAllowed))) {
            unset($this->IsAdminModifyAllowed);
        } else {
            $this->IsAdminModifyAllowed = $isAdminModifyAllowed;
        }
        return $this;
    }
    /**
     * Get IsAdminViewAllowed 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 getIsAdminViewAllowed()
    {
        return isset($this->IsAdminViewAllowed) ? $this->IsAdminViewAllowed : null;
    }
    /**
     * Set IsAdminViewAllowed 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 $isAdminViewAllowed
     * @return \patest\StructType\Security_SecurityTokenDefaultAccessRules
     */
    public function setIsAdminViewAllowed($isAdminViewAllowed = null)
    {
        // validation for constraint: int
        if (!is_null($isAdminViewAllowed) && !(is_int($isAdminViewAllowed) || ctype_digit($isAdminViewAllowed))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($isAdminViewAllowed, true), gettype($isAdminViewAllowed)), __LINE__);
        }
        if (is_null($isAdminViewAllowed) || (is_array($isAdminViewAllowed) && empty($isAdminViewAllowed))) {
            unset($this->IsAdminViewAllowed);
        } else {
            $this->IsAdminViewAllowed = $isAdminViewAllowed;
        }
        return $this;
    }
    /**
     * Get IsCrmAllowed 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 getIsCrmAllowed()
    {
        return isset($this->IsCrmAllowed) ? $this->IsCrmAllowed : null;
    }
    /**
     * Set IsCrmAllowed 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 $isCrmAllowed
     * @return \patest\StructType\Security_SecurityTokenDefaultAccessRules
     */
    public function setIsCrmAllowed($isCrmAllowed = null)
    {
        // validation for constraint: int
        if (!is_null($isCrmAllowed) && !(is_int($isCrmAllowed) || ctype_digit($isCrmAllowed))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($isCrmAllowed, true), gettype($isCrmAllowed)), __LINE__);
        }
        if (is_null($isCrmAllowed) || (is_array($isCrmAllowed) && empty($isCrmAllowed))) {
            unset($this->IsCrmAllowed);
        } else {
            $this->IsCrmAllowed = $isCrmAllowed;
        }
        return $this;
    }
    /**
     * Get IsMarketingAllowed 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 getIsMarketingAllowed()
    {
        return isset($this->IsMarketingAllowed) ? $this->IsMarketingAllowed : null;
    }
    /**
     * Set IsMarketingAllowed 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 $isMarketingAllowed
     * @return \patest\StructType\Security_SecurityTokenDefaultAccessRules
     */
    public function setIsMarketingAllowed($isMarketingAllowed = null)
    {
        // validation for constraint: int
        if (!is_null($isMarketingAllowed) && !(is_int($isMarketingAllowed) || ctype_digit($isMarketingAllowed))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($isMarketingAllowed, true), gettype($isMarketingAllowed)), __LINE__);
        }
        if (is_null($isMarketingAllowed) || (is_array($isMarketingAllowed) && empty($isMarketingAllowed))) {
            unset($this->IsMarketingAllowed);
        } else {
            $this->IsMarketingAllowed = $isMarketingAllowed;
        }
        return $this;
    }
    /**
     * Get IsReportsAllowed 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 getIsReportsAllowed()
    {
        return isset($this->IsReportsAllowed) ? $this->IsReportsAllowed : null;
    }
    /**
     * Set IsReportsAllowed 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 $isReportsAllowed
     * @return \patest\StructType\Security_SecurityTokenDefaultAccessRules
     */
    public function setIsReportsAllowed($isReportsAllowed = null)
    {
        // validation for constraint: int
        if (!is_null($isReportsAllowed) && !(is_int($isReportsAllowed) || ctype_digit($isReportsAllowed))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($isReportsAllowed, true), gettype($isReportsAllowed)), __LINE__);
        }
        if (is_null($isReportsAllowed) || (is_array($isReportsAllowed) && empty($isReportsAllowed))) {
            unset($this->IsReportsAllowed);
        } else {
            $this->IsReportsAllowed = $isReportsAllowed;
        }
        return $this;
    }
    /**
     * Get IsSalesAllowed 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 getIsSalesAllowed()
    {
        return isset($this->IsSalesAllowed) ? $this->IsSalesAllowed : null;
    }
    /**
     * Set IsSalesAllowed 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 $isSalesAllowed
     * @return \patest\StructType\Security_SecurityTokenDefaultAccessRules
     */
    public function setIsSalesAllowed($isSalesAllowed = null)
    {
        // validation for constraint: int
        if (!is_null($isSalesAllowed) && !(is_int($isSalesAllowed) || ctype_digit($isSalesAllowed))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($isSalesAllowed, true), gettype($isSalesAllowed)), __LINE__);
        }
        if (is_null($isSalesAllowed) || (is_array($isSalesAllowed) && empty($isSalesAllowed))) {
            unset($this->IsSalesAllowed);
        } else {
            $this->IsSalesAllowed = $isSalesAllowed;
        }
        return $this;
    }
}
