<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: access.proto

namespace OS\PB;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 ** \@brief An event generated when Access is denied
 *
 * Generated from protobuf message <code>OS.PB.AccessEvent</code>
 */
class AccessEvent extends \Google\Protobuf\Internal\Message
{
    /**
     * Best attempt at displaying what reader reported the access method
     *
     * Generated from protobuf field <code>.OS.PB.AccessReader Reader = 1;</code>
     */
    protected $Reader = null;
    /**
     * If reader is known, then only Id is provided unless VerboseEvents is enabled
     *
     * Generated from protobuf field <code>uint64 ReaderId = 2;</code>
     */
    protected $ReaderId = 0;
    /**
     * If it was an entry or an exit
     *
     * Generated from protobuf field <code>.OS.PB.AccessDirectionType ReaderDirection = 3;</code>
     */
    protected $ReaderDirection = 0;
    /**
     * Any fields that were denied due to Method
     *
     * Generated from protobuf field <code>.OS.PB.AccessMethodConfig Method = 4;</code>
     */
    protected $Method = null;
    /**
     * Any fields that were denied due to User
     *
     * Generated from protobuf field <code>.OS.PB.AccessUserConfig User = 5;</code>
     */
    protected $User = null;
    /**
     * The user id - important for distinguishing pincodes from older pin codes
     *
     * Generated from protobuf field <code>uint64 UserId = 6;</code>
     */
    protected $UserId = 0;
    /**
     * Any fields that were denied due to Access Rights
     *
     * Generated from protobuf field <code>.OS.PB.AccessRightsConfig Rights = 7;</code>
     */
    protected $Rights = null;
    /**
     * If the rights is known, then only Id is provided unless VerboseEvents is enabled 
     *
     * Generated from protobuf field <code>uint64 RightsId = 8;</code>
     */
    protected $RightsId = 0;
    /**
     * How many entries have now been used
     *
     * Generated from protobuf field <code>uint32 EntriesRedeemed = 10;</code>
     */
    protected $EntriesRedeemed = 0;
    /**
     * How many exits have now been used
     *
     * Generated from protobuf field <code>uint32 ExitsRedeemed = 11;</code>
     */
    protected $ExitsRedeemed = 0;
    /**
     * Which button on the remote was pressed
     *
     * Generated from protobuf field <code>.OS.PB.AccessButtonType ButtonPressed = 12;</code>
     */
    protected $ButtonPressed = 0;
    /**
     * How far has the enrollment progress is
     *
     * Generated from protobuf field <code>uint32 Progress = 13;</code>
     */
    protected $Progress = 0;
    /**
     * How long did the access control logic take   
     *
     * Generated from protobuf field <code>uint32 TimeTakenMs = 15;</code>
     */
    protected $TimeTakenMs = 0;
    /**
     * Specifically for AccessMethodDeniedInvalidData event
     *
     * Generated from protobuf field <code>bytes InvalidData = 16;</code>
     */
    protected $InvalidData = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \OS\PB\AccessReader $Reader
     *           Best attempt at displaying what reader reported the access method
     *     @type int|string $ReaderId
     *           If reader is known, then only Id is provided unless VerboseEvents is enabled
     *     @type int $ReaderDirection
     *           If it was an entry or an exit
     *     @type \OS\PB\AccessMethodConfig $Method
     *           Any fields that were denied due to Method
     *     @type \OS\PB\AccessUserConfig $User
     *           Any fields that were denied due to User
     *     @type int|string $UserId
     *           The user id - important for distinguishing pincodes from older pin codes
     *     @type \OS\PB\AccessRightsConfig $Rights
     *           Any fields that were denied due to Access Rights
     *     @type int|string $RightsId
     *           If the rights is known, then only Id is provided unless VerboseEvents is enabled 
     *     @type int $EntriesRedeemed
     *           How many entries have now been used
     *     @type int $ExitsRedeemed
     *           How many exits have now been used
     *     @type int $ButtonPressed
     *           Which button on the remote was pressed
     *     @type int $Progress
     *           How far has the enrollment progress is
     *     @type int $TimeTakenMs
     *           How long did the access control logic take   
     *     @type string $InvalidData
     *           Specifically for AccessMethodDeniedInvalidData event
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Access::initOnce();
        parent::__construct($data);
    }

    /**
     * Best attempt at displaying what reader reported the access method
     *
     * Generated from protobuf field <code>.OS.PB.AccessReader Reader = 1;</code>
     * @return \OS\PB\AccessReader|null
     */
    public function getReader()
    {
        return $this->Reader;
    }

    public function hasReader()
    {
        return isset($this->Reader);
    }

    public function clearReader()
    {
        unset($this->Reader);
    }

    /**
     * Best attempt at displaying what reader reported the access method
     *
     * Generated from protobuf field <code>.OS.PB.AccessReader Reader = 1;</code>
     * @param \OS\PB\AccessReader $var
     * @return $this
     */
    public function setReader($var)
    {
        GPBUtil::checkMessage($var, \OS\PB\AccessReader::class);
        $this->Reader = $var;

        return $this;
    }

    /**
     * If reader is known, then only Id is provided unless VerboseEvents is enabled
     *
     * Generated from protobuf field <code>uint64 ReaderId = 2;</code>
     * @return int|string
     */
    public function getReaderId()
    {
        return $this->ReaderId;
    }

    /**
     * If reader is known, then only Id is provided unless VerboseEvents is enabled
     *
     * Generated from protobuf field <code>uint64 ReaderId = 2;</code>
     * @param int|string $var
     * @return $this
     */
    public function setReaderId($var)
    {
        GPBUtil::checkUint64($var);
        $this->ReaderId = $var;

        return $this;
    }

    /**
     * If it was an entry or an exit
     *
     * Generated from protobuf field <code>.OS.PB.AccessDirectionType ReaderDirection = 3;</code>
     * @return int
     */
    public function getReaderDirection()
    {
        return $this->ReaderDirection;
    }

    /**
     * If it was an entry or an exit
     *
     * Generated from protobuf field <code>.OS.PB.AccessDirectionType ReaderDirection = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setReaderDirection($var)
    {
        GPBUtil::checkEnum($var, \OS\PB\AccessDirectionType::class);
        $this->ReaderDirection = $var;

        return $this;
    }

    /**
     * Any fields that were denied due to Method
     *
     * Generated from protobuf field <code>.OS.PB.AccessMethodConfig Method = 4;</code>
     * @return \OS\PB\AccessMethodConfig|null
     */
    public function getMethod()
    {
        return $this->Method;
    }

    public function hasMethod()
    {
        return isset($this->Method);
    }

    public function clearMethod()
    {
        unset($this->Method);
    }

    /**
     * Any fields that were denied due to Method
     *
     * Generated from protobuf field <code>.OS.PB.AccessMethodConfig Method = 4;</code>
     * @param \OS\PB\AccessMethodConfig $var
     * @return $this
     */
    public function setMethod($var)
    {
        GPBUtil::checkMessage($var, \OS\PB\AccessMethodConfig::class);
        $this->Method = $var;

        return $this;
    }

    /**
     * Any fields that were denied due to User
     *
     * Generated from protobuf field <code>.OS.PB.AccessUserConfig User = 5;</code>
     * @return \OS\PB\AccessUserConfig|null
     */
    public function getUser()
    {
        return $this->User;
    }

    public function hasUser()
    {
        return isset($this->User);
    }

    public function clearUser()
    {
        unset($this->User);
    }

    /**
     * Any fields that were denied due to User
     *
     * Generated from protobuf field <code>.OS.PB.AccessUserConfig User = 5;</code>
     * @param \OS\PB\AccessUserConfig $var
     * @return $this
     */
    public function setUser($var)
    {
        GPBUtil::checkMessage($var, \OS\PB\AccessUserConfig::class);
        $this->User = $var;

        return $this;
    }

    /**
     * The user id - important for distinguishing pincodes from older pin codes
     *
     * Generated from protobuf field <code>uint64 UserId = 6;</code>
     * @return int|string
     */
    public function getUserId()
    {
        return $this->UserId;
    }

    /**
     * The user id - important for distinguishing pincodes from older pin codes
     *
     * Generated from protobuf field <code>uint64 UserId = 6;</code>
     * @param int|string $var
     * @return $this
     */
    public function setUserId($var)
    {
        GPBUtil::checkUint64($var);
        $this->UserId = $var;

        return $this;
    }

    /**
     * Any fields that were denied due to Access Rights
     *
     * Generated from protobuf field <code>.OS.PB.AccessRightsConfig Rights = 7;</code>
     * @return \OS\PB\AccessRightsConfig|null
     */
    public function getRights()
    {
        return $this->Rights;
    }

    public function hasRights()
    {
        return isset($this->Rights);
    }

    public function clearRights()
    {
        unset($this->Rights);
    }

    /**
     * Any fields that were denied due to Access Rights
     *
     * Generated from protobuf field <code>.OS.PB.AccessRightsConfig Rights = 7;</code>
     * @param \OS\PB\AccessRightsConfig $var
     * @return $this
     */
    public function setRights($var)
    {
        GPBUtil::checkMessage($var, \OS\PB\AccessRightsConfig::class);
        $this->Rights = $var;

        return $this;
    }

    /**
     * If the rights is known, then only Id is provided unless VerboseEvents is enabled 
     *
     * Generated from protobuf field <code>uint64 RightsId = 8;</code>
     * @return int|string
     */
    public function getRightsId()
    {
        return $this->RightsId;
    }

    /**
     * If the rights is known, then only Id is provided unless VerboseEvents is enabled 
     *
     * Generated from protobuf field <code>uint64 RightsId = 8;</code>
     * @param int|string $var
     * @return $this
     */
    public function setRightsId($var)
    {
        GPBUtil::checkUint64($var);
        $this->RightsId = $var;

        return $this;
    }

    /**
     * How many entries have now been used
     *
     * Generated from protobuf field <code>uint32 EntriesRedeemed = 10;</code>
     * @return int
     */
    public function getEntriesRedeemed()
    {
        return $this->EntriesRedeemed;
    }

    /**
     * How many entries have now been used
     *
     * Generated from protobuf field <code>uint32 EntriesRedeemed = 10;</code>
     * @param int $var
     * @return $this
     */
    public function setEntriesRedeemed($var)
    {
        GPBUtil::checkUint32($var);
        $this->EntriesRedeemed = $var;

        return $this;
    }

    /**
     * How many exits have now been used
     *
     * Generated from protobuf field <code>uint32 ExitsRedeemed = 11;</code>
     * @return int
     */
    public function getExitsRedeemed()
    {
        return $this->ExitsRedeemed;
    }

    /**
     * How many exits have now been used
     *
     * Generated from protobuf field <code>uint32 ExitsRedeemed = 11;</code>
     * @param int $var
     * @return $this
     */
    public function setExitsRedeemed($var)
    {
        GPBUtil::checkUint32($var);
        $this->ExitsRedeemed = $var;

        return $this;
    }

    /**
     * Which button on the remote was pressed
     *
     * Generated from protobuf field <code>.OS.PB.AccessButtonType ButtonPressed = 12;</code>
     * @return int
     */
    public function getButtonPressed()
    {
        return $this->ButtonPressed;
    }

    /**
     * Which button on the remote was pressed
     *
     * Generated from protobuf field <code>.OS.PB.AccessButtonType ButtonPressed = 12;</code>
     * @param int $var
     * @return $this
     */
    public function setButtonPressed($var)
    {
        GPBUtil::checkEnum($var, \OS\PB\AccessButtonType::class);
        $this->ButtonPressed = $var;

        return $this;
    }

    /**
     * How far has the enrollment progress is
     *
     * Generated from protobuf field <code>uint32 Progress = 13;</code>
     * @return int
     */
    public function getProgress()
    {
        return $this->Progress;
    }

    /**
     * How far has the enrollment progress is
     *
     * Generated from protobuf field <code>uint32 Progress = 13;</code>
     * @param int $var
     * @return $this
     */
    public function setProgress($var)
    {
        GPBUtil::checkUint32($var);
        $this->Progress = $var;

        return $this;
    }

    /**
     * How long did the access control logic take   
     *
     * Generated from protobuf field <code>uint32 TimeTakenMs = 15;</code>
     * @return int
     */
    public function getTimeTakenMs()
    {
        return $this->TimeTakenMs;
    }

    /**
     * How long did the access control logic take   
     *
     * Generated from protobuf field <code>uint32 TimeTakenMs = 15;</code>
     * @param int $var
     * @return $this
     */
    public function setTimeTakenMs($var)
    {
        GPBUtil::checkUint32($var);
        $this->TimeTakenMs = $var;

        return $this;
    }

    /**
     * Specifically for AccessMethodDeniedInvalidData event
     *
     * Generated from protobuf field <code>bytes InvalidData = 16;</code>
     * @return string
     */
    public function getInvalidData()
    {
        return $this->InvalidData;
    }

    /**
     * Specifically for AccessMethodDeniedInvalidData event
     *
     * Generated from protobuf field <code>bytes InvalidData = 16;</code>
     * @param string $var
     * @return $this
     */
    public function setInvalidData($var)
    {
        GPBUtil::checkString($var, False);
        $this->InvalidData = $var;

        return $this;
    }

}

