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

namespace OS\PB;

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

/**
 * Generated from protobuf message <code>OS.PB.OSDPEvent</code>
 */
class OSDPEvent extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>uint32 Address = 2;</code>
     */
    protected $Address = 0;
    /**
     * Generated by a Raw event, Reader Number reported by Reader
     *
     * Generated from protobuf field <code>uint32 ReaderNo = 4;</code>
     */
    protected $ReaderNo = 0;
    /**
     * Generated by a Raw event, Direction reported by the Reader                            
     *
     * Generated from protobuf field <code>.OS.PB.OSDPDirectionType ReaderDirection = 5;</code>
     */
    protected $ReaderDirection = 0;
    /**
     * if format is Wiegand, then it is how many bits. 
     *
     * Generated from protobuf field <code>uint32 WiegandBits = 6;</code>
     */
    protected $WiegandBits = 0;
    /**
     * OSDP VendorCode
     *
     * Generated from protobuf field <code>uint32 VendorCode = 20;</code>
     */
    protected $VendorCode = 0;
    /**
     * OSDP Model
     *
     * Generated from protobuf field <code>uint32 ModelNumber = 21;</code>
     */
    protected $ModelNumber = 0;
    /**
     * OSDP Version
     *
     * Generated from protobuf field <code>uint32 ModelVersion = 22;</code>
     */
    protected $ModelVersion = 0;
    /**
     * OSDP Serial
     *
     * Generated from protobuf field <code>uint32 SerialNumber = 23;</code>
     */
    protected $SerialNumber = 0;
    /**
     * OSDP Firmware Version    
     *
     * Generated from protobuf field <code>uint32 FirmwareVersion = 24;</code>
     */
    protected $FirmwareVersion = 0;
    protected $Format;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $Address
     *     @type int $ReaderNo
     *           Generated by a Raw event, Reader Number reported by Reader
     *     @type int $ReaderDirection
     *           Generated by a Raw event, Direction reported by the Reader                            
     *     @type int $WiegandBits
     *           if format is Wiegand, then it is how many bits. 
     *     @type string $Unspecified
     *           Generated by a Raw event
     *     @type string $Wiegand
     *           Generated by a Raw event
     *     @type string $Ascii
     *           Generated by a Raw event
     *     @type int|string $PinCode
     *           Generated by Keypad Mode Logic
     *     @type int $VendorCode
     *           OSDP VendorCode
     *     @type int $ModelNumber
     *           OSDP Model
     *     @type int $ModelVersion
     *           OSDP Version
     *     @type int $SerialNumber
     *           OSDP Serial
     *     @type int $FirmwareVersion
     *           OSDP Firmware Version    
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Osdp::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>uint32 Address = 2;</code>
     * @return int
     */
    public function getAddress()
    {
        return $this->Address;
    }

    /**
     * Generated from protobuf field <code>uint32 Address = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setAddress($var)
    {
        GPBUtil::checkUint32($var);
        $this->Address = $var;

        return $this;
    }

    /**
     * Generated by a Raw event, Reader Number reported by Reader
     *
     * Generated from protobuf field <code>uint32 ReaderNo = 4;</code>
     * @return int
     */
    public function getReaderNo()
    {
        return $this->ReaderNo;
    }

    /**
     * Generated by a Raw event, Reader Number reported by Reader
     *
     * Generated from protobuf field <code>uint32 ReaderNo = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setReaderNo($var)
    {
        GPBUtil::checkUint32($var);
        $this->ReaderNo = $var;

        return $this;
    }

    /**
     * Generated by a Raw event, Direction reported by the Reader                            
     *
     * Generated from protobuf field <code>.OS.PB.OSDPDirectionType ReaderDirection = 5;</code>
     * @return int
     */
    public function getReaderDirection()
    {
        return $this->ReaderDirection;
    }

    /**
     * Generated by a Raw event, Direction reported by the Reader                            
     *
     * Generated from protobuf field <code>.OS.PB.OSDPDirectionType ReaderDirection = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setReaderDirection($var)
    {
        GPBUtil::checkEnum($var, \OS\PB\OSDPDirectionType::class);
        $this->ReaderDirection = $var;

        return $this;
    }

    /**
     * if format is Wiegand, then it is how many bits. 
     *
     * Generated from protobuf field <code>uint32 WiegandBits = 6;</code>
     * @return int
     */
    public function getWiegandBits()
    {
        return $this->WiegandBits;
    }

    /**
     * if format is Wiegand, then it is how many bits. 
     *
     * Generated from protobuf field <code>uint32 WiegandBits = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setWiegandBits($var)
    {
        GPBUtil::checkUint32($var);
        $this->WiegandBits = $var;

        return $this;
    }

    /**
     * Generated by a Raw event
     *
     * Generated from protobuf field <code>bytes Unspecified = 8;</code>
     * @return string
     */
    public function getUnspecified()
    {
        return $this->readOneof(8);
    }

    public function hasUnspecified()
    {
        return $this->hasOneof(8);
    }

    /**
     * Generated by a Raw event
     *
     * Generated from protobuf field <code>bytes Unspecified = 8;</code>
     * @param string $var
     * @return $this
     */
    public function setUnspecified($var)
    {
        GPBUtil::checkString($var, False);
        $this->writeOneof(8, $var);

        return $this;
    }

    /**
     * Generated by a Raw event
     *
     * Generated from protobuf field <code>bytes Wiegand = 9;</code>
     * @return string
     */
    public function getWiegand()
    {
        return $this->readOneof(9);
    }

    public function hasWiegand()
    {
        return $this->hasOneof(9);
    }

    /**
     * Generated by a Raw event
     *
     * Generated from protobuf field <code>bytes Wiegand = 9;</code>
     * @param string $var
     * @return $this
     */
    public function setWiegand($var)
    {
        GPBUtil::checkString($var, False);
        $this->writeOneof(9, $var);

        return $this;
    }

    /**
     * Generated by a Raw event
     *
     * Generated from protobuf field <code>string Ascii = 10;</code>
     * @return string
     */
    public function getAscii()
    {
        return $this->readOneof(10);
    }

    public function hasAscii()
    {
        return $this->hasOneof(10);
    }

    /**
     * Generated by a Raw event
     *
     * Generated from protobuf field <code>string Ascii = 10;</code>
     * @param string $var
     * @return $this
     */
    public function setAscii($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(10, $var);

        return $this;
    }

    /**
     * Generated by Keypad Mode Logic
     *
     * Generated from protobuf field <code>uint64 PinCode = 11;</code>
     * @return int|string
     */
    public function getPinCode()
    {
        return $this->readOneof(11);
    }

    public function hasPinCode()
    {
        return $this->hasOneof(11);
    }

    /**
     * Generated by Keypad Mode Logic
     *
     * Generated from protobuf field <code>uint64 PinCode = 11;</code>
     * @param int|string $var
     * @return $this
     */
    public function setPinCode($var)
    {
        GPBUtil::checkUint64($var);
        $this->writeOneof(11, $var);

        return $this;
    }

    /**
     * OSDP VendorCode
     *
     * Generated from protobuf field <code>uint32 VendorCode = 20;</code>
     * @return int
     */
    public function getVendorCode()
    {
        return $this->VendorCode;
    }

    /**
     * OSDP VendorCode
     *
     * Generated from protobuf field <code>uint32 VendorCode = 20;</code>
     * @param int $var
     * @return $this
     */
    public function setVendorCode($var)
    {
        GPBUtil::checkUint32($var);
        $this->VendorCode = $var;

        return $this;
    }

    /**
     * OSDP Model
     *
     * Generated from protobuf field <code>uint32 ModelNumber = 21;</code>
     * @return int
     */
    public function getModelNumber()
    {
        return $this->ModelNumber;
    }

    /**
     * OSDP Model
     *
     * Generated from protobuf field <code>uint32 ModelNumber = 21;</code>
     * @param int $var
     * @return $this
     */
    public function setModelNumber($var)
    {
        GPBUtil::checkUint32($var);
        $this->ModelNumber = $var;

        return $this;
    }

    /**
     * OSDP Version
     *
     * Generated from protobuf field <code>uint32 ModelVersion = 22;</code>
     * @return int
     */
    public function getModelVersion()
    {
        return $this->ModelVersion;
    }

    /**
     * OSDP Version
     *
     * Generated from protobuf field <code>uint32 ModelVersion = 22;</code>
     * @param int $var
     * @return $this
     */
    public function setModelVersion($var)
    {
        GPBUtil::checkUint32($var);
        $this->ModelVersion = $var;

        return $this;
    }

    /**
     * OSDP Serial
     *
     * Generated from protobuf field <code>uint32 SerialNumber = 23;</code>
     * @return int
     */
    public function getSerialNumber()
    {
        return $this->SerialNumber;
    }

    /**
     * OSDP Serial
     *
     * Generated from protobuf field <code>uint32 SerialNumber = 23;</code>
     * @param int $var
     * @return $this
     */
    public function setSerialNumber($var)
    {
        GPBUtil::checkUint32($var);
        $this->SerialNumber = $var;

        return $this;
    }

    /**
     * OSDP Firmware Version    
     *
     * Generated from protobuf field <code>uint32 FirmwareVersion = 24;</code>
     * @return int
     */
    public function getFirmwareVersion()
    {
        return $this->FirmwareVersion;
    }

    /**
     * OSDP Firmware Version    
     *
     * Generated from protobuf field <code>uint32 FirmwareVersion = 24;</code>
     * @param int $var
     * @return $this
     */
    public function setFirmwareVersion($var)
    {
        GPBUtil::checkUint32($var);
        $this->FirmwareVersion = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getFormat()
    {
        return $this->whichOneof("Format");
    }

}

