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

namespace Mynaparrot\PlugnmeetProto;

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

/**
 * Generated from protobuf message <code>plugnmeet.DataChannelMessage</code>
 */
class DataChannelMessage extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string id = 1;</code>
     */
    protected $id = '';
    /**
     * Generated from protobuf field <code>.plugnmeet.DataMsgBodyType type = 2;</code>
     */
    protected $type = 0;
    /**
     * Generated from protobuf field <code>string from_user_id = 3;</code>
     */
    protected $from_user_id = '';
    /**
     * Generated from protobuf field <code>optional string to_user_id = 4;</code>
     */
    protected $to_user_id = null;
    /**
     * Generated from protobuf field <code>string message = 5;</code>
     */
    protected $message = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $id
     *     @type int $type
     *     @type string $from_user_id
     *     @type string $to_user_id
     *     @type string $message
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\PlugnmeetDatamessage::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>.plugnmeet.DataMsgBodyType type = 2;</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Generated from protobuf field <code>.plugnmeet.DataMsgBodyType type = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Mynaparrot\PlugnmeetProto\DataMsgBodyType::class);
        $this->type = $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>optional string to_user_id = 4;</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 = 4;</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>string message = 5;</code>
     * @return string
     */
    public function getMessage()
    {
        return $this->message;
    }

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

        return $this;
    }

}

