<?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.PastParticipant</code>
 */
class PastParticipant extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional string userJid = 1;</code>
     */
    protected $userJid = null;
    /**
     * Generated from protobuf field <code>optional .proto.PastParticipant.LeaveReason leaveReason = 2;</code>
     */
    protected $leaveReason = null;
    /**
     * Generated from protobuf field <code>optional uint64 leaveTs = 3;</code>
     */
    protected $leaveTs = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $userJid
     *     @type int $leaveReason
     *     @type int|string $leaveTs
     * }
     */
    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 .proto.PastParticipant.LeaveReason leaveReason = 2;</code>
     * @return int
     */
    public function getLeaveReason()
    {
        return isset($this->leaveReason) ? $this->leaveReason : 0;
    }

    public function hasLeaveReason()
    {
        return isset($this->leaveReason);
    }

    public function clearLeaveReason()
    {
        unset($this->leaveReason);
    }

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

        return $this;
    }

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

    public function hasLeaveTs()
    {
        return isset($this->leaveTs);
    }

    public function clearLeaveTs()
    {
        unset($this->leaveTs);
    }

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

        return $this;
    }

}

