<?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.KeepInChatMessage</code>
 */
class KeepInChatMessage 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 .proto.KeepType keepType = 2;</code>
     */
    protected $keepType = null;
    /**
     * Generated from protobuf field <code>optional int64 timestampMs = 3;</code>
     */
    protected $timestampMs = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \PhpWA\Protocol\Proto\MessageKey $key
     *     @type int $keepType
     *     @type int|string $timestampMs
     * }
     */
    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 .proto.KeepType keepType = 2;</code>
     * @return int
     */
    public function getKeepType()
    {
        return isset($this->keepType) ? $this->keepType : 0;
    }

    public function hasKeepType()
    {
        return isset($this->keepType);
    }

    public function clearKeepType()
    {
        unset($this->keepType);
    }

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

        return $this;
    }

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

    public function hasTimestampMs()
    {
        return isset($this->timestampMs);
    }

    public function clearTimestampMs()
    {
        unset($this->timestampMs);
    }

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

        return $this;
    }

}

