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

namespace Livekit;

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

/**
 * Generated from protobuf message <code>livekit.SendDataRequest</code>
 */
class SendDataRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string room = 1;</code>
     */
    protected $room = '';
    /**
     * Generated from protobuf field <code>bytes data = 2;</code>
     */
    protected $data = '';
    /**
     * Generated from protobuf field <code>.livekit.DataPacket.Kind kind = 3;</code>
     */
    protected $kind = 0;
    /**
     * mark deprecated
     *
     * Generated from protobuf field <code>repeated string destination_sids = 4 [deprecated = true];</code>
     * @deprecated
     */
    private $destination_sids;
    /**
     * when set, only forward to these identities
     *
     * Generated from protobuf field <code>repeated string destination_identities = 6;</code>
     */
    private $destination_identities;
    /**
     * Generated from protobuf field <code>optional string topic = 5;</code>
     */
    protected $topic = null;
    /**
     * added by SDK to enable de-duping of messages, for INTERNAL USE ONLY
     *
     * Generated from protobuf field <code>bytes nonce = 7;</code>
     */
    protected $nonce = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $room
     *     @type string $data
     *     @type int $kind
     *     @type string[] $destination_sids
     *           mark deprecated
     *     @type string[] $destination_identities
     *           when set, only forward to these identities
     *     @type string $topic
     *     @type string $nonce
     *           added by SDK to enable de-duping of messages, for INTERNAL USE ONLY
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitRoom::initOnce();
        parent::__construct($data);
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.DataPacket.Kind kind = 3;</code>
     * @return int
     */
    public function getKind()
    {
        return $this->kind;
    }

    /**
     * Generated from protobuf field <code>.livekit.DataPacket.Kind kind = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setKind($var)
    {
        GPBUtil::checkEnum($var, \Livekit\DataPacket\Kind::class);
        $this->kind = $var;

        return $this;
    }

    /**
     * mark deprecated
     *
     * Generated from protobuf field <code>repeated string destination_sids = 4 [deprecated = true];</code>
     * @return RepeatedField<string>
     * @deprecated
     */
    public function getDestinationSids()
    {
        if (count($this->destination_sids) !== 0) {
            @trigger_error('destination_sids is deprecated.', E_USER_DEPRECATED);
        }
        return $this->destination_sids;
    }

    /**
     * mark deprecated
     *
     * Generated from protobuf field <code>repeated string destination_sids = 4 [deprecated = true];</code>
     * @param string[] $var
     * @return $this
     * @deprecated
     */
    public function setDestinationSids($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        if (count($arr) !== 0) {
            @trigger_error('destination_sids is deprecated.', E_USER_DEPRECATED);
        }
        $this->destination_sids = $arr;

        return $this;
    }

    /**
     * when set, only forward to these identities
     *
     * Generated from protobuf field <code>repeated string destination_identities = 6;</code>
     * @return RepeatedField<string>
     */
    public function getDestinationIdentities()
    {
        return $this->destination_identities;
    }

    /**
     * when set, only forward to these identities
     *
     * Generated from protobuf field <code>repeated string destination_identities = 6;</code>
     * @param string[] $var
     * @return $this
     */
    public function setDestinationIdentities($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->destination_identities = $arr;

        return $this;
    }

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

    public function hasTopic()
    {
        return isset($this->topic);
    }

    public function clearTopic()
    {
        unset($this->topic);
    }

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

        return $this;
    }

    /**
     * added by SDK to enable de-duping of messages, for INTERNAL USE ONLY
     *
     * Generated from protobuf field <code>bytes nonce = 7;</code>
     * @return string
     */
    public function getNonce()
    {
        return $this->nonce;
    }

    /**
     * added by SDK to enable de-duping of messages, for INTERNAL USE ONLY
     *
     * Generated from protobuf field <code>bytes nonce = 7;</code>
     * @param string $var
     * @return $this
     */
    public function setNonce($var)
    {
        GPBUtil::checkString($var, False);
        $this->nonce = $var;

        return $this;
    }

}

