<?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.PinInChat</code>
 */
class PinInChat extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional .proto.PinInChat.Type type = 1;</code>
     */
    protected $type = null;
    /**
     * Generated from protobuf field <code>optional .proto.MessageKey key = 2;</code>
     */
    protected $key = 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 .proto.MessageAddOnContextInfo messageAddOnContextInfo = 5;</code>
     */
    protected $messageAddOnContextInfo = null;

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

    /**
     * Generated from protobuf field <code>optional .proto.PinInChat.Type type = 1;</code>
     * @return int
     */
    public function getType()
    {
        return isset($this->type) ? $this->type : 0;
    }

    public function hasType()
    {
        return isset($this->type);
    }

    public function clearType()
    {
        unset($this->type);
    }

    /**
     * Generated from protobuf field <code>optional .proto.PinInChat.Type type = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \PhpWA\Protocol\Proto\PinInChat\Type::class);
        $this->type = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .proto.MessageKey key = 2;</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 = 2;</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 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 .proto.MessageAddOnContextInfo messageAddOnContextInfo = 5;</code>
     * @return \PhpWA\Protocol\Proto\MessageAddOnContextInfo|null
     */
    public function getMessageAddOnContextInfo()
    {
        return $this->messageAddOnContextInfo;
    }

    public function hasMessageAddOnContextInfo()
    {
        return isset($this->messageAddOnContextInfo);
    }

    public function clearMessageAddOnContextInfo()
    {
        unset($this->messageAddOnContextInfo);
    }

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

        return $this;
    }

}

