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

namespace Livekit;

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

/**
 * Generated from protobuf message <code>livekit.UserPacket</code>
 */
class UserPacket extends \Google\Protobuf\Internal\Message
{
    /**
     * participant ID of user that sent the message
     *
     * Generated from protobuf field <code>string participant_sid = 1 [deprecated = true];</code>
     * @deprecated
     */
    protected $participant_sid = '';
    /**
     * Generated from protobuf field <code>string participant_identity = 5 [deprecated = true];</code>
     * @deprecated
     */
    protected $participant_identity = '';
    /**
     * user defined payload
     *
     * Generated from protobuf field <code>bytes payload = 2;</code>
     */
    protected $payload = '';
    /**
     * the ID of the participants who will receive the message (sent to all by default)
     *
     * Generated from protobuf field <code>repeated string destination_sids = 3 [deprecated = true];</code>
     * @deprecated
     */
    private $destination_sids;
    /**
     * identities of participants who will receive the message (sent to all by default)
     *
     * Generated from protobuf field <code>repeated string destination_identities = 6 [deprecated = true];</code>
     * @deprecated
     */
    private $destination_identities;
    /**
     * topic under which the message was published
     *
     * Generated from protobuf field <code>optional string topic = 4;</code>
     */
    protected $topic = null;
    /**
     * Unique ID to identify the message
     *
     * Generated from protobuf field <code>optional string id = 8;</code>
     */
    protected $id = null;
    /**
     * start and end time allow relating the message to specific media time
     *
     * Generated from protobuf field <code>optional uint64 start_time = 9;</code>
     */
    protected $start_time = null;
    /**
     * Generated from protobuf field <code>optional uint64 end_time = 10;</code>
     */
    protected $end_time = null;
    /**
     * added by SDK to enable de-duping of messages, for INTERNAL USE ONLY
     *
     * Generated from protobuf field <code>bytes nonce = 11;</code>
     */
    protected $nonce = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $participant_sid
     *           participant ID of user that sent the message
     *     @type string $participant_identity
     *     @type string $payload
     *           user defined payload
     *     @type string[] $destination_sids
     *           the ID of the participants who will receive the message (sent to all by default)
     *     @type string[] $destination_identities
     *           identities of participants who will receive the message (sent to all by default)
     *     @type string $topic
     *           topic under which the message was published
     *     @type string $id
     *           Unique ID to identify the message
     *     @type int|string $start_time
     *           start and end time allow relating the message to specific media time
     *     @type int|string $end_time
     *     @type string $nonce
     *           added by SDK to enable de-duping of messages, for INTERNAL USE ONLY
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitModels::initOnce();
        parent::__construct($data);
    }

    /**
     * participant ID of user that sent the message
     *
     * Generated from protobuf field <code>string participant_sid = 1 [deprecated = true];</code>
     * @return string
     * @deprecated
     */
    public function getParticipantSid()
    {
        if ($this->participant_sid !== '') {
            @trigger_error('participant_sid is deprecated.', E_USER_DEPRECATED);
        }
        return $this->participant_sid;
    }

    /**
     * participant ID of user that sent the message
     *
     * Generated from protobuf field <code>string participant_sid = 1 [deprecated = true];</code>
     * @param string $var
     * @return $this
     * @deprecated
     */
    public function setParticipantSid($var)
    {
        @trigger_error('participant_sid is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkString($var, True);
        $this->participant_sid = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string participant_identity = 5 [deprecated = true];</code>
     * @return string
     * @deprecated
     */
    public function getParticipantIdentity()
    {
        if ($this->participant_identity !== '') {
            @trigger_error('participant_identity is deprecated.', E_USER_DEPRECATED);
        }
        return $this->participant_identity;
    }

    /**
     * Generated from protobuf field <code>string participant_identity = 5 [deprecated = true];</code>
     * @param string $var
     * @return $this
     * @deprecated
     */
    public function setParticipantIdentity($var)
    {
        @trigger_error('participant_identity is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkString($var, True);
        $this->participant_identity = $var;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * the ID of the participants who will receive the message (sent to all by default)
     *
     * Generated from protobuf field <code>repeated string destination_sids = 3 [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;
    }

    /**
     * the ID of the participants who will receive the message (sent to all by default)
     *
     * Generated from protobuf field <code>repeated string destination_sids = 3 [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;
    }

    /**
     * identities of participants who will receive the message (sent to all by default)
     *
     * Generated from protobuf field <code>repeated string destination_identities = 6 [deprecated = true];</code>
     * @return RepeatedField<string>
     * @deprecated
     */
    public function getDestinationIdentities()
    {
        if (count($this->destination_identities) !== 0) {
            @trigger_error('destination_identities is deprecated.', E_USER_DEPRECATED);
        }
        return $this->destination_identities;
    }

    /**
     * identities of participants who will receive the message (sent to all by default)
     *
     * Generated from protobuf field <code>repeated string destination_identities = 6 [deprecated = true];</code>
     * @param string[] $var
     * @return $this
     * @deprecated
     */
    public function setDestinationIdentities($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        if (count($arr) !== 0) {
            @trigger_error('destination_identities is deprecated.', E_USER_DEPRECATED);
        }
        $this->destination_identities = $arr;

        return $this;
    }

    /**
     * topic under which the message was published
     *
     * Generated from protobuf field <code>optional string topic = 4;</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);
    }

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

        return $this;
    }

    /**
     * Unique ID to identify the message
     *
     * Generated from protobuf field <code>optional string id = 8;</code>
     * @return string
     */
    public function getId()
    {
        return isset($this->id) ? $this->id : '';
    }

    public function hasId()
    {
        return isset($this->id);
    }

    public function clearId()
    {
        unset($this->id);
    }

    /**
     * Unique ID to identify the message
     *
     * Generated from protobuf field <code>optional string id = 8;</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * start and end time allow relating the message to specific media time
     *
     * Generated from protobuf field <code>optional uint64 start_time = 9;</code>
     * @return int|string
     */
    public function getStartTime()
    {
        return isset($this->start_time) ? $this->start_time : 0;
    }

    public function hasStartTime()
    {
        return isset($this->start_time);
    }

    public function clearStartTime()
    {
        unset($this->start_time);
    }

    /**
     * start and end time allow relating the message to specific media time
     *
     * Generated from protobuf field <code>optional uint64 start_time = 9;</code>
     * @param int|string $var
     * @return $this
     */
    public function setStartTime($var)
    {
        GPBUtil::checkUint64($var);
        $this->start_time = $var;

        return $this;
    }

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

    public function hasEndTime()
    {
        return isset($this->end_time);
    }

    public function clearEndTime()
    {
        unset($this->end_time);
    }

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

        return $this;
    }

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

        return $this;
    }

}

