<?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.RoomConfiguration</code>
 */
class RoomConfiguration extends \Google\Protobuf\Internal\Message
{
    /**
     * Used as ID, must be unique
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    protected $name = '';
    /**
     * number of seconds to keep the room open if no one joins
     *
     * Generated from protobuf field <code>uint32 empty_timeout = 2;</code>
     */
    protected $empty_timeout = 0;
    /**
     * number of seconds to keep the room open after everyone leaves
     *
     * Generated from protobuf field <code>uint32 departure_timeout = 3;</code>
     */
    protected $departure_timeout = 0;
    /**
     * limit number of participants that can be in a room, excluding Egress and Ingress participants
     *
     * Generated from protobuf field <code>uint32 max_participants = 4;</code>
     */
    protected $max_participants = 0;
    /**
     * egress
     *
     * Generated from protobuf field <code>.livekit.RoomEgress egress = 5;</code>
     */
    protected $egress = null;
    /**
     * playout delay of subscriber
     *
     * Generated from protobuf field <code>uint32 min_playout_delay = 7;</code>
     */
    protected $min_playout_delay = 0;
    /**
     * Generated from protobuf field <code>uint32 max_playout_delay = 8;</code>
     */
    protected $max_playout_delay = 0;
    /**
     * improves A/V sync when playout_delay set to a value larger than 200ms. It will disables transceiver re-use
     * so not recommended for rooms with frequent subscription changes
     *
     * Generated from protobuf field <code>bool sync_streams = 9;</code>
     */
    protected $sync_streams = false;
    /**
     * Define agents that should be dispatched to this room
     *
     * Generated from protobuf field <code>repeated .livekit.RoomAgentDispatch agents = 10;</code>
     */
    private $agents;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Used as ID, must be unique
     *     @type int $empty_timeout
     *           number of seconds to keep the room open if no one joins
     *     @type int $departure_timeout
     *           number of seconds to keep the room open after everyone leaves
     *     @type int $max_participants
     *           limit number of participants that can be in a room, excluding Egress and Ingress participants
     *     @type \Livekit\RoomEgress $egress
     *           egress
     *     @type int $min_playout_delay
     *           playout delay of subscriber
     *     @type int $max_playout_delay
     *     @type bool $sync_streams
     *           improves A/V sync when playout_delay set to a value larger than 200ms. It will disables transceiver re-use
     *           so not recommended for rooms with frequent subscription changes
     *     @type \Livekit\RoomAgentDispatch[]|\Google\Protobuf\Internal\RepeatedField $agents
     *           Define agents that should be dispatched to this room
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitRoom::initOnce();
        parent::__construct($data);
    }

    /**
     * Used as ID, must be unique
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Used as ID, must be unique
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * number of seconds to keep the room open if no one joins
     *
     * Generated from protobuf field <code>uint32 empty_timeout = 2;</code>
     * @return int
     */
    public function getEmptyTimeout()
    {
        return $this->empty_timeout;
    }

    /**
     * number of seconds to keep the room open if no one joins
     *
     * Generated from protobuf field <code>uint32 empty_timeout = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setEmptyTimeout($var)
    {
        GPBUtil::checkUint32($var);
        $this->empty_timeout = $var;

        return $this;
    }

    /**
     * number of seconds to keep the room open after everyone leaves
     *
     * Generated from protobuf field <code>uint32 departure_timeout = 3;</code>
     * @return int
     */
    public function getDepartureTimeout()
    {
        return $this->departure_timeout;
    }

    /**
     * number of seconds to keep the room open after everyone leaves
     *
     * Generated from protobuf field <code>uint32 departure_timeout = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setDepartureTimeout($var)
    {
        GPBUtil::checkUint32($var);
        $this->departure_timeout = $var;

        return $this;
    }

    /**
     * limit number of participants that can be in a room, excluding Egress and Ingress participants
     *
     * Generated from protobuf field <code>uint32 max_participants = 4;</code>
     * @return int
     */
    public function getMaxParticipants()
    {
        return $this->max_participants;
    }

    /**
     * limit number of participants that can be in a room, excluding Egress and Ingress participants
     *
     * Generated from protobuf field <code>uint32 max_participants = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setMaxParticipants($var)
    {
        GPBUtil::checkUint32($var);
        $this->max_participants = $var;

        return $this;
    }

    /**
     * egress
     *
     * Generated from protobuf field <code>.livekit.RoomEgress egress = 5;</code>
     * @return \Livekit\RoomEgress|null
     */
    public function getEgress()
    {
        return $this->egress;
    }

    public function hasEgress()
    {
        return isset($this->egress);
    }

    public function clearEgress()
    {
        unset($this->egress);
    }

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

        return $this;
    }

    /**
     * playout delay of subscriber
     *
     * Generated from protobuf field <code>uint32 min_playout_delay = 7;</code>
     * @return int
     */
    public function getMinPlayoutDelay()
    {
        return $this->min_playout_delay;
    }

    /**
     * playout delay of subscriber
     *
     * Generated from protobuf field <code>uint32 min_playout_delay = 7;</code>
     * @param int $var
     * @return $this
     */
    public function setMinPlayoutDelay($var)
    {
        GPBUtil::checkUint32($var);
        $this->min_playout_delay = $var;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * improves A/V sync when playout_delay set to a value larger than 200ms. It will disables transceiver re-use
     * so not recommended for rooms with frequent subscription changes
     *
     * Generated from protobuf field <code>bool sync_streams = 9;</code>
     * @return bool
     */
    public function getSyncStreams()
    {
        return $this->sync_streams;
    }

    /**
     * improves A/V sync when playout_delay set to a value larger than 200ms. It will disables transceiver re-use
     * so not recommended for rooms with frequent subscription changes
     *
     * Generated from protobuf field <code>bool sync_streams = 9;</code>
     * @param bool $var
     * @return $this
     */
    public function setSyncStreams($var)
    {
        GPBUtil::checkBool($var);
        $this->sync_streams = $var;

        return $this;
    }

    /**
     * Define agents that should be dispatched to this room
     *
     * Generated from protobuf field <code>repeated .livekit.RoomAgentDispatch agents = 10;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAgents()
    {
        return $this->agents;
    }

    /**
     * Define agents that should be dispatched to this room
     *
     * Generated from protobuf field <code>repeated .livekit.RoomAgentDispatch agents = 10;</code>
     * @param \Livekit\RoomAgentDispatch[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAgents($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Livekit\RoomAgentDispatch::class);
        $this->agents = $arr;

        return $this;
    }

}

