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

namespace Livekit;

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

/**
 * Generated from protobuf message <code>livekit.UpdateParticipantRequest</code>
 */
class UpdateParticipantRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string room = 1;</code>
     */
    protected $room = '';
    /**
     * Generated from protobuf field <code>string identity = 2;</code>
     */
    protected $identity = '';
    /**
     * metadata to update. skipping updates if left empty
     *
     * Generated from protobuf field <code>string metadata = 3 [(.logger.redact) = true, (.logger.redact_format) = "<redacted ({{ .Size }} bytes)>"];</code>
     */
    protected $metadata = '';
    /**
     * set to update the participant's permissions
     *
     * Generated from protobuf field <code>.livekit.ParticipantPermission permission = 4;</code>
     */
    protected $permission = null;
    /**
     * display name to update
     *
     * Generated from protobuf field <code>string name = 5 [(.logger.redact) = true, (.logger.redact_format) = "<redacted ({{ .Size }} bytes)>"];</code>
     */
    protected $name = '';
    /**
     * attributes to update. it only updates attributes that have been set
     * to delete attributes, set the value to an empty string
     *
     * Generated from protobuf field <code>map<string, string> attributes = 6 [(.logger.redact) = true, (.logger.redact_format) = "<redacted ({{ .Size }} bytes)>"];</code>
     */
    private $attributes;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $room
     *     @type string $identity
     *     @type string $metadata
     *           metadata to update. skipping updates if left empty
     *     @type \Livekit\ParticipantPermission $permission
     *           set to update the participant's permissions
     *     @type string $name
     *           display name to update
     *     @type array|\Google\Protobuf\Internal\MapField $attributes
     *           attributes to update. it only updates attributes that have been set
     *           to delete attributes, set the value to an empty string
     * }
     */
    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>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;
    }

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

    /**
     * metadata to update. skipping updates if left empty
     *
     * Generated from protobuf field <code>string metadata = 3 [(.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;
    }

    /**
     * set to update the participant's permissions
     *
     * Generated from protobuf field <code>.livekit.ParticipantPermission permission = 4;</code>
     * @return \Livekit\ParticipantPermission|null
     */
    public function getPermission()
    {
        return $this->permission;
    }

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

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

    /**
     * set to update the participant's permissions
     *
     * Generated from protobuf field <code>.livekit.ParticipantPermission permission = 4;</code>
     * @param \Livekit\ParticipantPermission $var
     * @return $this
     */
    public function setPermission($var)
    {
        GPBUtil::checkMessage($var, \Livekit\ParticipantPermission::class);
        $this->permission = $var;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * attributes to update. it only updates attributes that have been set
     * to delete attributes, set the value to an empty string
     *
     * Generated from protobuf field <code>map<string, string> attributes = 6 [(.logger.redact) = true, (.logger.redact_format) = "<redacted ({{ .Size }} bytes)>"];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getAttributes()
    {
        return $this->attributes;
    }

    /**
     * attributes to update. it only updates attributes that have been set
     * to delete attributes, set the value to an empty string
     *
     * Generated from protobuf field <code>map<string, string> attributes = 6 [(.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;
    }

}

