<?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.WebNotificationsInfo</code>
 */
class WebNotificationsInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional uint64 timestamp = 2;</code>
     */
    protected $timestamp = null;
    /**
     * Generated from protobuf field <code>optional uint32 unreadChats = 3;</code>
     */
    protected $unreadChats = null;
    /**
     * Generated from protobuf field <code>optional uint32 notifyMessageCount = 4;</code>
     */
    protected $notifyMessageCount = null;
    /**
     * Generated from protobuf field <code>repeated .proto.WebMessageInfo notifyMessages = 5;</code>
     */
    private $notifyMessages;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $timestamp
     *     @type int $unreadChats
     *     @type int $notifyMessageCount
     *     @type \PhpWA\Protocol\Proto\WebMessageInfo[] $notifyMessages
     * }
     */
    public function __construct($data = NULL) {
        \PhpWA\Protocol\Proto\Metadata\WAProto::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>optional uint64 timestamp = 2;</code>
     * @return int|string
     */
    public function getTimestamp()
    {
        return isset($this->timestamp) ? $this->timestamp : 0;
    }

    public function hasTimestamp()
    {
        return isset($this->timestamp);
    }

    public function clearTimestamp()
    {
        unset($this->timestamp);
    }

    /**
     * Generated from protobuf field <code>optional uint64 timestamp = 2;</code>
     * @param int|string $var
     * @return $this
     */
    public function setTimestamp($var)
    {
        GPBUtil::checkUint64($var);
        $this->timestamp = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional uint32 unreadChats = 3;</code>
     * @return int
     */
    public function getUnreadChats()
    {
        return isset($this->unreadChats) ? $this->unreadChats : 0;
    }

    public function hasUnreadChats()
    {
        return isset($this->unreadChats);
    }

    public function clearUnreadChats()
    {
        unset($this->unreadChats);
    }

    /**
     * Generated from protobuf field <code>optional uint32 unreadChats = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setUnreadChats($var)
    {
        GPBUtil::checkUint32($var);
        $this->unreadChats = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional uint32 notifyMessageCount = 4;</code>
     * @return int
     */
    public function getNotifyMessageCount()
    {
        return isset($this->notifyMessageCount) ? $this->notifyMessageCount : 0;
    }

    public function hasNotifyMessageCount()
    {
        return isset($this->notifyMessageCount);
    }

    public function clearNotifyMessageCount()
    {
        unset($this->notifyMessageCount);
    }

    /**
     * Generated from protobuf field <code>optional uint32 notifyMessageCount = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setNotifyMessageCount($var)
    {
        GPBUtil::checkUint32($var);
        $this->notifyMessageCount = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .proto.WebMessageInfo notifyMessages = 5;</code>
     * @return RepeatedField<\PhpWA\Protocol\Proto\WebMessageInfo>
     */
    public function getNotifyMessages()
    {
        return $this->notifyMessages;
    }

    /**
     * Generated from protobuf field <code>repeated .proto.WebMessageInfo notifyMessages = 5;</code>
     * @param \PhpWA\Protocol\Proto\WebMessageInfo[] $var
     * @return $this
     */
    public function setNotifyMessages($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \PhpWA\Protocol\Proto\WebMessageInfo::class);
        $this->notifyMessages = $arr;

        return $this;
    }

}

