<?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.KeepInChat</code>
 */
class KeepInChat extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional .proto.KeepType keepType = 1;</code>
     */
    protected $keepType = null;
    /**
     * Generated from protobuf field <code>optional int64 serverTimestamp = 2;</code>
     */
    protected $serverTimestamp = null;
    /**
     * Generated from protobuf field <code>optional .proto.MessageKey key = 3;</code>
     */
    protected $key = null;
    /**
     * Generated from protobuf field <code>optional string deviceJid = 4;</code>
     */
    protected $deviceJid = null;
    /**
     * Generated from protobuf field <code>optional int64 clientTimestampMs = 5;</code>
     */
    protected $clientTimestampMs = null;
    /**
     * Generated from protobuf field <code>optional int64 serverTimestampMs = 6;</code>
     */
    protected $serverTimestampMs = null;

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

    /**
     * Generated from protobuf field <code>optional .proto.KeepType keepType = 1;</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 = 1;</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 serverTimestamp = 2;</code>
     * @return int|string
     */
    public function getServerTimestamp()
    {
        return isset($this->serverTimestamp) ? $this->serverTimestamp : 0;
    }

    public function hasServerTimestamp()
    {
        return isset($this->serverTimestamp);
    }

    public function clearServerTimestamp()
    {
        unset($this->serverTimestamp);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .proto.MessageKey key = 3;</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 = 3;</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 deviceJid = 4;</code>
     * @return string
     */
    public function getDeviceJid()
    {
        return isset($this->deviceJid) ? $this->deviceJid : '';
    }

    public function hasDeviceJid()
    {
        return isset($this->deviceJid);
    }

    public function clearDeviceJid()
    {
        unset($this->deviceJid);
    }

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

        return $this;
    }

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

    public function hasClientTimestampMs()
    {
        return isset($this->clientTimestampMs);
    }

    public function clearClientTimestampMs()
    {
        unset($this->clientTimestampMs);
    }

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

        return $this;
    }

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

        return $this;
    }

}

