<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: livekit_models.proto

namespace Livekit;

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

/**
 * Generated from protobuf message <code>livekit.ParticipantInfo</code>
 */
class ParticipantInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string sid = 1;</code>
     */
    protected $sid = '';
    /**
     * Generated from protobuf field <code>string identity = 2;</code>
     */
    protected $identity = '';
    /**
     * Generated from protobuf field <code>.livekit.ParticipantInfo.State state = 3;</code>
     */
    protected $state = 0;
    /**
     * Generated from protobuf field <code>repeated .livekit.TrackInfo tracks = 4;</code>
     */
    private $tracks;
    /**
     * Generated from protobuf field <code>string metadata = 5 [(.logger.redact) = true, (.logger.redact_format) = "<redacted ({{ .Size }} bytes)>"];</code>
     */
    protected $metadata = '';
    /**
     * timestamp when participant joined room, in seconds
     *
     * Generated from protobuf field <code>int64 joined_at = 6;</code>
     */
    protected $joined_at = 0;
    /**
     * timestamp when participant joined room, in milliseconds
     *
     * Generated from protobuf field <code>int64 joined_at_ms = 17;</code>
     */
    protected $joined_at_ms = 0;
    /**
     * Generated from protobuf field <code>string name = 9 [(.logger.redact) = true];</code>
     */
    protected $name = '';
    /**
     * Generated from protobuf field <code>uint32 version = 10;</code>
     */
    protected $version = 0;
    /**
     * Generated from protobuf field <code>.livekit.ParticipantPermission permission = 11;</code>
     */
    protected $permission = null;
    /**
     * Generated from protobuf field <code>string region = 12;</code>
     */
    protected $region = '';
    /**
     * indicates the participant has an active publisher connection
     * and can publish to the server
     *
     * Generated from protobuf field <code>bool is_publisher = 13;</code>
     */
    protected $is_publisher = false;
    /**
     * Generated from protobuf field <code>.livekit.ParticipantInfo.Kind kind = 14;</code>
     */
    protected $kind = 0;
    /**
     * Generated from protobuf field <code>map<string, string> attributes = 15 [(.logger.redact) = true, (.logger.redact_format) = "<redacted ({{ .Size }} bytes)>"];</code>
     */
    private $attributes;
    /**
     * Generated from protobuf field <code>.livekit.DisconnectReason disconnect_reason = 16;</code>
     */
    protected $disconnect_reason = 0;
    /**
     * Generated from protobuf field <code>repeated .livekit.ParticipantInfo.KindDetail kind_details = 18;</code>
     */
    private $kind_details;
    /**
     * Generated from protobuf field <code>repeated .livekit.DataTrackInfo data_tracks = 19;</code>
     */
    private $data_tracks;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $sid
     *     @type string $identity
     *     @type int $state
     *     @type \Livekit\TrackInfo[]|\Google\Protobuf\Internal\RepeatedField $tracks
     *     @type string $metadata
     *     @type int|string $joined_at
     *           timestamp when participant joined room, in seconds
     *     @type int|string $joined_at_ms
     *           timestamp when participant joined room, in milliseconds
     *     @type string $name
     *     @type int $version
     *     @type \Livekit\ParticipantPermission $permission
     *     @type string $region
     *     @type bool $is_publisher
     *           indicates the participant has an active publisher connection
     *           and can publish to the server
     *     @type int $kind
     *     @type array|\Google\Protobuf\Internal\MapField $attributes
     *     @type int $disconnect_reason
     *     @type int[]|\Google\Protobuf\Internal\RepeatedField $kind_details
     *     @type \Livekit\DataTrackInfo[]|\Google\Protobuf\Internal\RepeatedField $data_tracks
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitModels::initOnce();
        parent::__construct($data);
    }

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

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

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.ParticipantInfo.State state = 3;</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .livekit.TrackInfo tracks = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getTracks()
    {
        return $this->tracks;
    }

    /**
     * Generated from protobuf field <code>repeated .livekit.TrackInfo tracks = 4;</code>
     * @param \Livekit\TrackInfo[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setTracks($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Livekit\TrackInfo::class);
        $this->tracks = $arr;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string metadata = 5 [(.logger.redact) = true, (.logger.redact_format) = "<redacted ({{ .Size }} bytes)>"];</code>
     * @return string
     */
    public function getMetadata()
    {
        return $this->metadata;
    }

    /**
     * Generated from protobuf field <code>string metadata = 5 [(.logger.redact) = true, (.logger.redact_format) = "<redacted ({{ .Size }} bytes)>"];</code>
     * @param string $var
     * @return $this
     */
    public function setMetadata($var)
    {
        GPBUtil::checkString($var, True);
        $this->metadata = $var;

        return $this;
    }

    /**
     * timestamp when participant joined room, in seconds
     *
     * Generated from protobuf field <code>int64 joined_at = 6;</code>
     * @return int|string
     */
    public function getJoinedAt()
    {
        return $this->joined_at;
    }

    /**
     * timestamp when participant joined room, in seconds
     *
     * Generated from protobuf field <code>int64 joined_at = 6;</code>
     * @param int|string $var
     * @return $this
     */
    public function setJoinedAt($var)
    {
        GPBUtil::checkInt64($var);
        $this->joined_at = $var;

        return $this;
    }

    /**
     * timestamp when participant joined room, in milliseconds
     *
     * Generated from protobuf field <code>int64 joined_at_ms = 17;</code>
     * @return int|string
     */
    public function getJoinedAtMs()
    {
        return $this->joined_at_ms;
    }

    /**
     * timestamp when participant joined room, in milliseconds
     *
     * Generated from protobuf field <code>int64 joined_at_ms = 17;</code>
     * @param int|string $var
     * @return $this
     */
    public function setJoinedAtMs($var)
    {
        GPBUtil::checkInt64($var);
        $this->joined_at_ms = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string name = 9 [(.logger.redact) = true];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Generated from protobuf field <code>string name = 9 [(.logger.redact) = true];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>uint32 version = 10;</code>
     * @return int
     */
    public function getVersion()
    {
        return $this->version;
    }

    /**
     * Generated from protobuf field <code>uint32 version = 10;</code>
     * @param int $var
     * @return $this
     */
    public function setVersion($var)
    {
        GPBUtil::checkUint32($var);
        $this->version = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.ParticipantPermission permission = 11;</code>
     * @return \Livekit\ParticipantPermission|null
     */
    public function getPermission()
    {
        return $this->permission;
    }

    public function hasPermission()
    {
        return isset($this->permission);
    }

    public function clearPermission()
    {
        unset($this->permission);
    }

    /**
     * Generated from protobuf field <code>.livekit.ParticipantPermission permission = 11;</code>
     * @param \Livekit\ParticipantPermission $var
     * @return $this
     */
    public function setPermission($var)
    {
        GPBUtil::checkMessage($var, \Livekit\ParticipantPermission::class);
        $this->permission = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>string region = 12;</code>
     * @return string
     */
    public function getRegion()
    {
        return $this->region;
    }

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

        return $this;
    }

    /**
     * indicates the participant has an active publisher connection
     * and can publish to the server
     *
     * Generated from protobuf field <code>bool is_publisher = 13;</code>
     * @return bool
     */
    public function getIsPublisher()
    {
        return $this->is_publisher;
    }

    /**
     * indicates the participant has an active publisher connection
     * and can publish to the server
     *
     * Generated from protobuf field <code>bool is_publisher = 13;</code>
     * @param bool $var
     * @return $this
     */
    public function setIsPublisher($var)
    {
        GPBUtil::checkBool($var);
        $this->is_publisher = $var;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>map<string, string> attributes = 15 [(.logger.redact) = true, (.logger.redact_format) = "<redacted ({{ .Size }} bytes)>"];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getAttributes()
    {
        return $this->attributes;
    }

    /**
     * Generated from protobuf field <code>map<string, string> attributes = 15 [(.logger.redact) = true, (.logger.redact_format) = "<redacted ({{ .Size }} bytes)>"];</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setAttributes($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->attributes = $arr;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.DisconnectReason disconnect_reason = 16;</code>
     * @return int
     */
    public function getDisconnectReason()
    {
        return $this->disconnect_reason;
    }

    /**
     * Generated from protobuf field <code>.livekit.DisconnectReason disconnect_reason = 16;</code>
     * @param int $var
     * @return $this
     */
    public function setDisconnectReason($var)
    {
        GPBUtil::checkEnum($var, \Livekit\DisconnectReason::class);
        $this->disconnect_reason = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .livekit.ParticipantInfo.KindDetail kind_details = 18;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getKindDetails()
    {
        return $this->kind_details;
    }

    /**
     * Generated from protobuf field <code>repeated .livekit.ParticipantInfo.KindDetail kind_details = 18;</code>
     * @param int[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setKindDetails($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Livekit\ParticipantInfo\KindDetail::class);
        $this->kind_details = $arr;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .livekit.DataTrackInfo data_tracks = 19;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getDataTracks()
    {
        return $this->data_tracks;
    }

    /**
     * Generated from protobuf field <code>repeated .livekit.DataTrackInfo data_tracks = 19;</code>
     * @param \Livekit\DataTrackInfo[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setDataTracks($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Livekit\DataTrackInfo::class);
        $this->data_tracks = $arr;

        return $this;
    }

}

