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

namespace Mynaparrot\PlugnmeetProto;

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

/**
 * Generated from protobuf message <code>plugnmeet.BroadcastToRoomReq</code>
 */
class BroadcastToRoomReq extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string room_id = 1 [(.buf.validate.field) = {</code>
     */
    protected $room_id = '';
    /**
     * Generated from protobuf field <code>bool only_to_admins = 2;</code>
     */
    protected $only_to_admins = false;
    /**
     * Generated from protobuf field <code>optional string to_user_id = 3;</code>
     */
    protected $to_user_id = null;
    protected $payload;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $room_id
     *     @type bool $only_to_admins
     *     @type string $to_user_id
     *     @type \Mynaparrot\PlugnmeetProto\BroadcastToRoomChatMessage $chat_msg
     *     @type \Mynaparrot\PlugnmeetProto\BroadcastToRoomNotificationMsg $notification_msg
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\PlugnmeetAuthRoom::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>string room_id = 1 [(.buf.validate.field) = {</code>
     * @return string
     */
    public function getRoomId()
    {
        return $this->room_id;
    }

    /**
     * Generated from protobuf field <code>string room_id = 1 [(.buf.validate.field) = {</code>
     * @param string $var
     * @return $this
     */
    public function setRoomId($var)
    {
        GPBUtil::checkString($var, True);
        $this->room_id = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>bool only_to_admins = 2;</code>
     * @return bool
     */
    public function getOnlyToAdmins()
    {
        return $this->only_to_admins;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional string to_user_id = 3;</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 = 3;</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>.plugnmeet.BroadcastToRoomChatMessage chat_msg = 4;</code>
     * @return \Mynaparrot\PlugnmeetProto\BroadcastToRoomChatMessage|null
     */
    public function getChatMsg()
    {
        return $this->readOneof(4);
    }

    public function hasChatMsg()
    {
        return $this->hasOneof(4);
    }

    /**
     * Generated from protobuf field <code>.plugnmeet.BroadcastToRoomChatMessage chat_msg = 4;</code>
     * @param \Mynaparrot\PlugnmeetProto\BroadcastToRoomChatMessage $var
     * @return $this
     */
    public function setChatMsg($var)
    {
        GPBUtil::checkMessage($var, \Mynaparrot\PlugnmeetProto\BroadcastToRoomChatMessage::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.plugnmeet.BroadcastToRoomNotificationMsg notification_msg = 5;</code>
     * @return \Mynaparrot\PlugnmeetProto\BroadcastToRoomNotificationMsg|null
     */
    public function getNotificationMsg()
    {
        return $this->readOneof(5);
    }

    public function hasNotificationMsg()
    {
        return $this->hasOneof(5);
    }

    /**
     * Generated from protobuf field <code>.plugnmeet.BroadcastToRoomNotificationMsg notification_msg = 5;</code>
     * @param \Mynaparrot\PlugnmeetProto\BroadcastToRoomNotificationMsg $var
     * @return $this
     */
    public function setNotificationMsg($var)
    {
        GPBUtil::checkMessage($var, \Mynaparrot\PlugnmeetProto\BroadcastToRoomNotificationMsg::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getPayload()
    {
        return $this->whichOneof("payload");
    }

}

