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

namespace PhpWA\Protocol\Proto\Message;

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

/**
 * Generated from protobuf message <code>proto.Message.PollUpdateMessage</code>
 */
class PollUpdateMessage extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional .proto.MessageKey pollCreationMessageKey = 1;</code>
     */
    protected $pollCreationMessageKey = null;
    /**
     * Generated from protobuf field <code>optional .proto.Message.PollEncValue vote = 2;</code>
     */
    protected $vote = null;
    /**
     * Generated from protobuf field <code>optional .proto.Message.PollUpdateMessageMetadata metadata = 3;</code>
     */
    protected $metadata = null;
    /**
     * Generated from protobuf field <code>optional int64 senderTimestampMs = 4;</code>
     */
    protected $senderTimestampMs = null;

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

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

    public function hasPollCreationMessageKey()
    {
        return isset($this->pollCreationMessageKey);
    }

    public function clearPollCreationMessageKey()
    {
        unset($this->pollCreationMessageKey);
    }

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

        return $this;
    }

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

        return $this;
    }

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

    public function hasMetadata()
    {
        return isset($this->metadata);
    }

    public function clearMetadata()
    {
        unset($this->metadata);
    }

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

        return $this;
    }

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

        return $this;
    }

}

