<?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.MessageHistoryMetadata</code>
 */
class MessageHistoryMetadata extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>repeated string historyReceivers = 1;</code>
     */
    private $historyReceivers;
    /**
     * Generated from protobuf field <code>optional int64 oldestMessageTimestamp = 2;</code>
     */
    protected $oldestMessageTimestamp = null;
    /**
     * Generated from protobuf field <code>optional int64 messageCount = 3;</code>
     */
    protected $messageCount = null;

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

    /**
     * Generated from protobuf field <code>repeated string historyReceivers = 1;</code>
     * @return RepeatedField<string>
     */
    public function getHistoryReceivers()
    {
        return $this->historyReceivers;
    }

    /**
     * Generated from protobuf field <code>repeated string historyReceivers = 1;</code>
     * @param string[] $var
     * @return $this
     */
    public function setHistoryReceivers($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->historyReceivers = $arr;

        return $this;
    }

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

    public function hasOldestMessageTimestamp()
    {
        return isset($this->oldestMessageTimestamp);
    }

    public function clearOldestMessageTimestamp()
    {
        unset($this->oldestMessageTimestamp);
    }

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

        return $this;
    }

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

    public function hasMessageCount()
    {
        return isset($this->messageCount);
    }

    public function clearMessageCount()
    {
        unset($this->messageCount);
    }

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

        return $this;
    }

}

