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

namespace PhpWA\Protocol\Proto;

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

/**
 * Generated from protobuf message <code>proto.PollUpdate</code>
 */
class PollUpdate extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional .proto.MessageKey pollUpdateMessageKey = 1;</code>
     */
    protected $pollUpdateMessageKey = null;
    /**
     * Generated from protobuf field <code>optional .proto.Message.PollVoteMessage vote = 2;</code>
     */
    protected $vote = null;
    /**
     * Generated from protobuf field <code>optional int64 senderTimestampMs = 3;</code>
     */
    protected $senderTimestampMs = null;
    /**
     * Generated from protobuf field <code>optional int64 serverTimestampMs = 4;</code>
     */
    protected $serverTimestampMs = null;
    /**
     * Generated from protobuf field <code>optional bool unread = 5;</code>
     */
    protected $unread = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \PhpWA\Protocol\Proto\MessageKey $pollUpdateMessageKey
     *     @type \PhpWA\Protocol\Proto\Message\PollVoteMessage $vote
     *     @type int|string $senderTimestampMs
     *     @type int|string $serverTimestampMs
     *     @type bool $unread
     * }
     */
    public function __construct($data = NULL) {
        \PhpWA\Protocol\Proto\Metadata\WAProto::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>optional .proto.MessageKey pollUpdateMessageKey = 1;</code>
     * @return \PhpWA\Protocol\Proto\MessageKey|null
     */
    public function getPollUpdateMessageKey()
    {
        return $this->pollUpdateMessageKey;
    }

    public function hasPollUpdateMessageKey()
    {
        return isset($this->pollUpdateMessageKey);
    }

    public function clearPollUpdateMessageKey()
    {
        unset($this->pollUpdateMessageKey);
    }

    /**
     * Generated from protobuf field <code>optional .proto.MessageKey pollUpdateMessageKey = 1;</code>
     * @param \PhpWA\Protocol\Proto\MessageKey $var
     * @return $this
     */
    public function setPollUpdateMessageKey($var)
    {
        GPBUtil::checkMessage($var, \PhpWA\Protocol\Proto\MessageKey::class);
        $this->pollUpdateMessageKey = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .proto.Message.PollVoteMessage vote = 2;</code>
     * @return \PhpWA\Protocol\Proto\Message\PollVoteMessage|null
     */
    public function getVote()
    {
        return $this->vote;
    }

    public function hasVote()
    {
        return isset($this->vote);
    }

    public function clearVote()
    {
        unset($this->vote);
    }

    /**
     * Generated from protobuf field <code>optional .proto.Message.PollVoteMessage vote = 2;</code>
     * @param \PhpWA\Protocol\Proto\Message\PollVoteMessage $var
     * @return $this
     */
    public function setVote($var)
    {
        GPBUtil::checkMessage($var, \PhpWA\Protocol\Proto\Message\PollVoteMessage::class);
        $this->vote = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional int64 senderTimestampMs = 3;</code>
     * @return int|string
     */
    public function getSenderTimestampMs()
    {
        return isset($this->senderTimestampMs) ? $this->senderTimestampMs : 0;
    }

    public function hasSenderTimestampMs()
    {
        return isset($this->senderTimestampMs);
    }

    public function clearSenderTimestampMs()
    {
        unset($this->senderTimestampMs);
    }

    /**
     * Generated from protobuf field <code>optional int64 senderTimestampMs = 3;</code>
     * @param int|string $var
     * @return $this
     */
    public function setSenderTimestampMs($var)
    {
        GPBUtil::checkInt64($var);
        $this->senderTimestampMs = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional int64 serverTimestampMs = 4;</code>
     * @return int|string
     */
    public function getServerTimestampMs()
    {
        return isset($this->serverTimestampMs) ? $this->serverTimestampMs : 0;
    }

    public function hasServerTimestampMs()
    {
        return isset($this->serverTimestampMs);
    }

    public function clearServerTimestampMs()
    {
        unset($this->serverTimestampMs);
    }

    /**
     * Generated from protobuf field <code>optional int64 serverTimestampMs = 4;</code>
     * @param int|string $var
     * @return $this
     */
    public function setServerTimestampMs($var)
    {
        GPBUtil::checkInt64($var);
        $this->serverTimestampMs = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional bool unread = 5;</code>
     * @return bool
     */
    public function getUnread()
    {
        return isset($this->unread) ? $this->unread : false;
    }

    public function hasUnread()
    {
        return isset($this->unread);
    }

    public function clearUnread()
    {
        unset($this->unread);
    }

    /**
     * Generated from protobuf field <code>optional bool unread = 5;</code>
     * @param bool $var
     * @return $this
     */
    public function setUnread($var)
    {
        GPBUtil::checkBool($var);
        $this->unread = $var;

        return $this;
    }

}

