<?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.Reaction</code>
 */
class Reaction extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional .proto.MessageKey key = 1;</code>
     */
    protected $key = null;
    /**
     * Generated from protobuf field <code>optional string text = 2;</code>
     */
    protected $text = null;
    /**
     * Generated from protobuf field <code>optional string groupingKey = 3;</code>
     */
    protected $groupingKey = null;
    /**
     * Generated from protobuf field <code>optional int64 senderTimestampMs = 4;</code>
     */
    protected $senderTimestampMs = 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 $key
     *     @type string $text
     *     @type string $groupingKey
     *     @type int|string $senderTimestampMs
     *     @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 key = 1;</code>
     * @return \PhpWA\Protocol\Proto\MessageKey|null
     */
    public function getKey()
    {
        return $this->key;
    }

    public function hasKey()
    {
        return isset($this->key);
    }

    public function clearKey()
    {
        unset($this->key);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional string text = 2;</code>
     * @return string
     */
    public function getText()
    {
        return isset($this->text) ? $this->text : '';
    }

    public function hasText()
    {
        return isset($this->text);
    }

    public function clearText()
    {
        unset($this->text);
    }

    /**
     * Generated from protobuf field <code>optional string text = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setText($var)
    {
        GPBUtil::checkString($var, True);
        $this->text = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional string groupingKey = 3;</code>
     * @return string
     */
    public function getGroupingKey()
    {
        return isset($this->groupingKey) ? $this->groupingKey : '';
    }

    public function hasGroupingKey()
    {
        return isset($this->groupingKey);
    }

    public function clearGroupingKey()
    {
        unset($this->groupingKey);
    }

    /**
     * Generated from protobuf field <code>optional string groupingKey = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setGroupingKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->groupingKey = $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;
    }

    /**
     * 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;
    }

}

