<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for ContactAccessRoles StructType
 * @subpackage Structs
 */
class ContactAccessRoles extends AbstractStructBase
{
    /**
     * The giveAccess
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var bool
     */
    public $giveAccess;
    /**
     * The contact
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\RecordRef
     */
    public $contact;
    /**
     * The email
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var string
     */
    public $email;
    /**
     * The role
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var \StructType\RecordRef
     */
    public $role;
    /**
     * The password
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var string
     */
    public $password;
    /**
     * The password2
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var string
     */
    public $password2;
    /**
     * The sendEmail
     * Meta information extracted from the WSDL
     * - minOccurs: 0
     * @var bool
     */
    public $sendEmail;
    /**
     * Constructor method for ContactAccessRoles
     * @uses ContactAccessRoles::setGiveAccess()
     * @uses ContactAccessRoles::setContact()
     * @uses ContactAccessRoles::setEmail()
     * @uses ContactAccessRoles::setRole()
     * @uses ContactAccessRoles::setPassword()
     * @uses ContactAccessRoles::setPassword2()
     * @uses ContactAccessRoles::setSendEmail()
     * @param bool $giveAccess
     * @param \StructType\RecordRef $contact
     * @param string $email
     * @param \StructType\RecordRef $role
     * @param string $password
     * @param string $password2
     * @param bool $sendEmail
     */
    public function __construct($giveAccess = null, \StructType\RecordRef $contact = null, $email = null, \StructType\RecordRef $role = null, $password = null, $password2 = null, $sendEmail = null)
    {
        $this
            ->setGiveAccess($giveAccess)
            ->setContact($contact)
            ->setEmail($email)
            ->setRole($role)
            ->setPassword($password)
            ->setPassword2($password2)
            ->setSendEmail($sendEmail);
    }
    /**
     * Get giveAccess value
     * @return bool|null
     */
    public function getGiveAccess()
    {
        return $this->giveAccess;
    }
    /**
     * Set giveAccess value
     * @param bool $giveAccess
     * @return \StructType\ContactAccessRoles
     */
    public function setGiveAccess($giveAccess = null)
    {
        // validation for constraint: boolean
        if (!is_null($giveAccess) && !is_bool($giveAccess)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($giveAccess, true), gettype($giveAccess)), __LINE__);
        }
        $this->giveAccess = $giveAccess;
        return $this;
    }
    /**
     * Get contact value
     * @return \StructType\RecordRef|null
     */
    public function getContact()
    {
        return $this->contact;
    }
    /**
     * Set contact value
     * @param \StructType\RecordRef $contact
     * @return \StructType\ContactAccessRoles
     */
    public function setContact(\StructType\RecordRef $contact = null)
    {
        $this->contact = $contact;
        return $this;
    }
    /**
     * Get email value
     * @return string|null
     */
    public function getEmail()
    {
        return $this->email;
    }
    /**
     * Set email value
     * @param string $email
     * @return \StructType\ContactAccessRoles
     */
    public function setEmail($email = null)
    {
        // validation for constraint: string
        if (!is_null($email) && !is_string($email)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($email, true), gettype($email)), __LINE__);
        }
        $this->email = $email;
        return $this;
    }
    /**
     * Get role value
     * @return \StructType\RecordRef|null
     */
    public function getRole()
    {
        return $this->role;
    }
    /**
     * Set role value
     * @param \StructType\RecordRef $role
     * @return \StructType\ContactAccessRoles
     */
    public function setRole(\StructType\RecordRef $role = null)
    {
        $this->role = $role;
        return $this;
    }
    /**
     * Get password value
     * @return string|null
     */
    public function getPassword()
    {
        return $this->password;
    }
    /**
     * Set password value
     * @param string $password
     * @return \StructType\ContactAccessRoles
     */
    public function setPassword($password = null)
    {
        // validation for constraint: string
        if (!is_null($password) && !is_string($password)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($password, true), gettype($password)), __LINE__);
        }
        $this->password = $password;
        return $this;
    }
    /**
     * Get password2 value
     * @return string|null
     */
    public function getPassword2()
    {
        return $this->password2;
    }
    /**
     * Set password2 value
     * @param string $password2
     * @return \StructType\ContactAccessRoles
     */
    public function setPassword2($password2 = null)
    {
        // validation for constraint: string
        if (!is_null($password2) && !is_string($password2)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a string, %s given', var_export($password2, true), gettype($password2)), __LINE__);
        }
        $this->password2 = $password2;
        return $this;
    }
    /**
     * Get sendEmail value
     * @return bool|null
     */
    public function getSendEmail()
    {
        return $this->sendEmail;
    }
    /**
     * Set sendEmail value
     * @param bool $sendEmail
     * @return \StructType\ContactAccessRoles
     */
    public function setSendEmail($sendEmail = null)
    {
        // validation for constraint: boolean
        if (!is_null($sendEmail) && !is_bool($sendEmail)) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($sendEmail, true), gettype($sendEmail)), __LINE__);
        }
        $this->sendEmail = $sendEmail;
        return $this;
    }
}
