<?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.ParticipantPermission</code>
 */
class ParticipantPermission extends \Google\Protobuf\Internal\Message
{
    /**
     * allow participant to subscribe to other tracks in the room
     *
     * Generated from protobuf field <code>bool can_subscribe = 1;</code>
     */
    protected $can_subscribe = false;
    /**
     * allow participant to publish new tracks to room
     *
     * Generated from protobuf field <code>bool can_publish = 2;</code>
     */
    protected $can_publish = false;
    /**
     * allow participant to publish data
     *
     * Generated from protobuf field <code>bool can_publish_data = 3;</code>
     */
    protected $can_publish_data = false;
    /**
     * sources that are allowed to be published
     *
     * Generated from protobuf field <code>repeated .livekit.TrackSource can_publish_sources = 9;</code>
     */
    private $can_publish_sources;
    /**
     * indicates that it's hidden to others
     *
     * Generated from protobuf field <code>bool hidden = 7;</code>
     */
    protected $hidden = false;
    /**
     * indicates it's a recorder instance
     * deprecated: use ParticipantInfo.kind instead
     *
     * Generated from protobuf field <code>bool recorder = 8 [deprecated = true];</code>
     * @deprecated
     */
    protected $recorder = false;
    /**
     * indicates that participant can update own metadata and attributes
     *
     * Generated from protobuf field <code>bool can_update_metadata = 10;</code>
     */
    protected $can_update_metadata = false;
    /**
     * indicates that participant is an agent
     * deprecated: use ParticipantInfo.kind instead
     *
     * Generated from protobuf field <code>bool agent = 11 [deprecated = true];</code>
     * @deprecated
     */
    protected $agent = false;
    /**
     * if a participant can subscribe to metrics
     *
     * Generated from protobuf field <code>bool can_subscribe_metrics = 12;</code>
     */
    protected $can_subscribe_metrics = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $can_subscribe
     *           allow participant to subscribe to other tracks in the room
     *     @type bool $can_publish
     *           allow participant to publish new tracks to room
     *     @type bool $can_publish_data
     *           allow participant to publish data
     *     @type int[]|\Google\Protobuf\Internal\RepeatedField $can_publish_sources
     *           sources that are allowed to be published
     *     @type bool $hidden
     *           indicates that it's hidden to others
     *     @type bool $recorder
     *           indicates it's a recorder instance
     *           deprecated: use ParticipantInfo.kind instead
     *     @type bool $can_update_metadata
     *           indicates that participant can update own metadata and attributes
     *     @type bool $agent
     *           indicates that participant is an agent
     *           deprecated: use ParticipantInfo.kind instead
     *     @type bool $can_subscribe_metrics
     *           if a participant can subscribe to metrics
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitModels::initOnce();
        parent::__construct($data);
    }

    /**
     * allow participant to subscribe to other tracks in the room
     *
     * Generated from protobuf field <code>bool can_subscribe = 1;</code>
     * @return bool
     */
    public function getCanSubscribe()
    {
        return $this->can_subscribe;
    }

    /**
     * allow participant to subscribe to other tracks in the room
     *
     * Generated from protobuf field <code>bool can_subscribe = 1;</code>
     * @param bool $var
     * @return $this
     */
    public function setCanSubscribe($var)
    {
        GPBUtil::checkBool($var);
        $this->can_subscribe = $var;

        return $this;
    }

    /**
     * allow participant to publish new tracks to room
     *
     * Generated from protobuf field <code>bool can_publish = 2;</code>
     * @return bool
     */
    public function getCanPublish()
    {
        return $this->can_publish;
    }

    /**
     * allow participant to publish new tracks to room
     *
     * Generated from protobuf field <code>bool can_publish = 2;</code>
     * @param bool $var
     * @return $this
     */
    public function setCanPublish($var)
    {
        GPBUtil::checkBool($var);
        $this->can_publish = $var;

        return $this;
    }

    /**
     * allow participant to publish data
     *
     * Generated from protobuf field <code>bool can_publish_data = 3;</code>
     * @return bool
     */
    public function getCanPublishData()
    {
        return $this->can_publish_data;
    }

    /**
     * allow participant to publish data
     *
     * Generated from protobuf field <code>bool can_publish_data = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setCanPublishData($var)
    {
        GPBUtil::checkBool($var);
        $this->can_publish_data = $var;

        return $this;
    }

    /**
     * sources that are allowed to be published
     *
     * Generated from protobuf field <code>repeated .livekit.TrackSource can_publish_sources = 9;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getCanPublishSources()
    {
        return $this->can_publish_sources;
    }

    /**
     * sources that are allowed to be published
     *
     * Generated from protobuf field <code>repeated .livekit.TrackSource can_publish_sources = 9;</code>
     * @param int[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setCanPublishSources($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Livekit\TrackSource::class);
        $this->can_publish_sources = $arr;

        return $this;
    }

    /**
     * indicates that it's hidden to others
     *
     * Generated from protobuf field <code>bool hidden = 7;</code>
     * @return bool
     */
    public function getHidden()
    {
        return $this->hidden;
    }

    /**
     * indicates that it's hidden to others
     *
     * Generated from protobuf field <code>bool hidden = 7;</code>
     * @param bool $var
     * @return $this
     */
    public function setHidden($var)
    {
        GPBUtil::checkBool($var);
        $this->hidden = $var;

        return $this;
    }

    /**
     * indicates it's a recorder instance
     * deprecated: use ParticipantInfo.kind instead
     *
     * Generated from protobuf field <code>bool recorder = 8 [deprecated = true];</code>
     * @return bool
     * @deprecated
     */
    public function getRecorder()
    {
        @trigger_error('recorder is deprecated.', E_USER_DEPRECATED);
        return $this->recorder;
    }

    /**
     * indicates it's a recorder instance
     * deprecated: use ParticipantInfo.kind instead
     *
     * Generated from protobuf field <code>bool recorder = 8 [deprecated = true];</code>
     * @param bool $var
     * @return $this
     * @deprecated
     */
    public function setRecorder($var)
    {
        @trigger_error('recorder is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkBool($var);
        $this->recorder = $var;

        return $this;
    }

    /**
     * indicates that participant can update own metadata and attributes
     *
     * Generated from protobuf field <code>bool can_update_metadata = 10;</code>
     * @return bool
     */
    public function getCanUpdateMetadata()
    {
        return $this->can_update_metadata;
    }

    /**
     * indicates that participant can update own metadata and attributes
     *
     * Generated from protobuf field <code>bool can_update_metadata = 10;</code>
     * @param bool $var
     * @return $this
     */
    public function setCanUpdateMetadata($var)
    {
        GPBUtil::checkBool($var);
        $this->can_update_metadata = $var;

        return $this;
    }

    /**
     * indicates that participant is an agent
     * deprecated: use ParticipantInfo.kind instead
     *
     * Generated from protobuf field <code>bool agent = 11 [deprecated = true];</code>
     * @return bool
     * @deprecated
     */
    public function getAgent()
    {
        @trigger_error('agent is deprecated.', E_USER_DEPRECATED);
        return $this->agent;
    }

    /**
     * indicates that participant is an agent
     * deprecated: use ParticipantInfo.kind instead
     *
     * Generated from protobuf field <code>bool agent = 11 [deprecated = true];</code>
     * @param bool $var
     * @return $this
     * @deprecated
     */
    public function setAgent($var)
    {
        @trigger_error('agent is deprecated.', E_USER_DEPRECATED);
        GPBUtil::checkBool($var);
        $this->agent = $var;

        return $this;
    }

    /**
     * if a participant can subscribe to metrics
     *
     * Generated from protobuf field <code>bool can_subscribe_metrics = 12;</code>
     * @return bool
     */
    public function getCanSubscribeMetrics()
    {
        return $this->can_subscribe_metrics;
    }

    /**
     * if a participant can subscribe to metrics
     *
     * Generated from protobuf field <code>bool can_subscribe_metrics = 12;</code>
     * @param bool $var
     * @return $this
     */
    public function setCanSubscribeMetrics($var)
    {
        GPBUtil::checkBool($var);
        $this->can_subscribe_metrics = $var;

        return $this;
    }

}

