<?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.UserReceipt</code>
 */
class UserReceipt extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional string userJid = 1;</code>
     */
    protected $userJid = null;
    /**
     * Generated from protobuf field <code>optional int64 receiptTimestamp = 2;</code>
     */
    protected $receiptTimestamp = null;
    /**
     * Generated from protobuf field <code>optional int64 readTimestamp = 3;</code>
     */
    protected $readTimestamp = null;
    /**
     * Generated from protobuf field <code>optional int64 playedTimestamp = 4;</code>
     */
    protected $playedTimestamp = null;
    /**
     * Generated from protobuf field <code>repeated string pendingDeviceJid = 5;</code>
     */
    private $pendingDeviceJid;
    /**
     * Generated from protobuf field <code>repeated string deliveredDeviceJid = 6;</code>
     */
    private $deliveredDeviceJid;

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

    /**
     * Generated from protobuf field <code>optional string userJid = 1;</code>
     * @return string
     */
    public function getUserJid()
    {
        return isset($this->userJid) ? $this->userJid : '';
    }

    public function hasUserJid()
    {
        return isset($this->userJid);
    }

    public function clearUserJid()
    {
        unset($this->userJid);
    }

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

        return $this;
    }

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

    public function hasReceiptTimestamp()
    {
        return isset($this->receiptTimestamp);
    }

    public function clearReceiptTimestamp()
    {
        unset($this->receiptTimestamp);
    }

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

        return $this;
    }

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

    public function hasReadTimestamp()
    {
        return isset($this->readTimestamp);
    }

    public function clearReadTimestamp()
    {
        unset($this->readTimestamp);
    }

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

        return $this;
    }

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

    public function hasPlayedTimestamp()
    {
        return isset($this->playedTimestamp);
    }

    public function clearPlayedTimestamp()
    {
        unset($this->playedTimestamp);
    }

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

        return $this;
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

}

