<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: plugnmeet_nats_msg.proto

namespace Mynaparrot\PlugnmeetProto;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 * Generated from protobuf message <code>plugnmeet.ChatMessage</code>
 */
class ChatMessage extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string id = 1;</code>
     */
    protected $id = '';
    /**
     * Generated from protobuf field <code>string from_name = 2;</code>
     */
    protected $from_name = '';
    /**
     * Generated from protobuf field <code>string from_user_id = 3;</code>
     */
    protected $from_user_id = '';
    /**
     * Generated from protobuf field <code>int64 sent_at = 4;</code>
     */
    protected $sent_at = 0;
    /**
     * Generated from protobuf field <code>optional string to_user_id = 5;</code>
     */
    protected $to_user_id = null;
    /**
     * Generated from protobuf field <code>bool is_private = 6;</code>
     */
    protected $is_private = false;
    /**
     * Generated from protobuf field <code>string message = 7;</code>
     */
    protected $message = '';
    /**
     * Generated from protobuf field <code>bool from_admin = 8;</code>
     */
    protected $from_admin = false;
    /**
     * Generated from protobuf field <code>optional string source_lang = 9;</code>
     */
    protected $source_lang = null;
    /**
     * Generated from protobuf field <code>map<string, string> translations = 10;</code>
     */
    private $translations;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $id
     *     @type string $from_name
     *     @type string $from_user_id
     *     @type int|string $sent_at
     *     @type string $to_user_id
     *     @type bool $is_private
     *     @type string $message
     *     @type bool $from_admin
     *     @type string $source_lang
     *     @type array|\Google\Protobuf\Internal\MapField $translations
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\PlugnmeetNatsMsg::initOnce();
        parent::__construct($data);
    }

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

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>string from_name = 2;</code>
     * @return string
     */
    public function getFromName()
    {
        return $this->from_name;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>string from_user_id = 3;</code>
     * @return string
     */
    public function getFromUserId()
    {
        return $this->from_user_id;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>int64 sent_at = 4;</code>
     * @return int|string
     */
    public function getSentAt()
    {
        return $this->sent_at;
    }

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

        return $this;
    }

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

    public function hasToUserId()
    {
        return isset($this->to_user_id);
    }

    public function clearToUserId()
    {
        unset($this->to_user_id);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>bool is_private = 6;</code>
     * @return bool
     */
    public function getIsPrivate()
    {
        return $this->is_private;
    }

    /**
     * Generated from protobuf field <code>bool is_private = 6;</code>
     * @param bool $var
     * @return $this
     */
    public function setIsPrivate($var)
    {
        GPBUtil::checkBool($var);
        $this->is_private = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string message = 7;</code>
     * @return string
     */
    public function getMessage()
    {
        return $this->message;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>bool from_admin = 8;</code>
     * @return bool
     */
    public function getFromAdmin()
    {
        return $this->from_admin;
    }

    /**
     * Generated from protobuf field <code>bool from_admin = 8;</code>
     * @param bool $var
     * @return $this
     */
    public function setFromAdmin($var)
    {
        GPBUtil::checkBool($var);
        $this->from_admin = $var;

        return $this;
    }

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

    public function hasSourceLang()
    {
        return isset($this->source_lang);
    }

    public function clearSourceLang()
    {
        unset($this->source_lang);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>map<string, string> translations = 10;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getTranslations()
    {
        return $this->translations;
    }

    /**
     * Generated from protobuf field <code>map<string, string> translations = 10;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setTranslations($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->translations = $arr;

        return $this;
    }

}

