<?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.CreateRoomRequest</code>
 */
class CreateRoomRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * name of the room
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    protected $name = '';
    /**
     * configuration to use for this room parameters. Setting parameters below override the config defaults.
     *
     * Generated from protobuf field <code>string config_name = 12;</code>
     */
    protected $config_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 = 10;</code>
     */
    protected $departure_timeout = 0;
    /**
     * limit number of participants that can be in a room
     *
     * Generated from protobuf field <code>uint32 max_participants = 3;</code>
     */
    protected $max_participants = 0;
    /**
     * override the node room is allocated to, for debugging
     *
     * Generated from protobuf field <code>string node_id = 4;</code>
     */
    protected $node_id = '';
    /**
     * metadata of room
     *
     * Generated from protobuf field <code>string metadata = 5;</code>
     */
    protected $metadata = '';
    /**
     * egress
     *
     * Generated from protobuf field <code>.livekit.RoomEgress egress = 6;</code>
     */
    protected $egress = null;
    /**
     * agent
     *
     * Generated from protobuf field <code>.livekit.RoomAgent agent = 11;</code>
     */
    protected $agent = 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;
    /**
     * replay
     *
     * Generated from protobuf field <code>bool replay_enabled = 13;</code>
     */
    protected $replay_enabled = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           name of the room
     *     @type string $config_name
     *           configuration to use for this room parameters. Setting parameters below override the config defaults.
     *     @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
     *     @type string $node_id
     *           override the node room is allocated to, for debugging
     *     @type string $metadata
     *           metadata of room
     *     @type \Livekit\RoomEgress $egress
     *           egress
     *     @type \Livekit\RoomAgent $agent
     *           agent
     *     @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 bool $replay_enabled
     *           replay
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitRoom::initOnce();
        parent::__construct($data);
    }

    /**
     * name of the room
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * name of the room
     *
     * 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;
    }

    /**
     * configuration to use for this room parameters. Setting parameters below override the config defaults.
     *
     * Generated from protobuf field <code>string config_name = 12;</code>
     * @return string
     */
    public function getConfigName()
    {
        return $this->config_name;
    }

    /**
     * configuration to use for this room parameters. Setting parameters below override the config defaults.
     *
     * Generated from protobuf field <code>string config_name = 12;</code>
     * @param string $var
     * @return $this
     */
    public function setConfigName($var)
    {
        GPBUtil::checkString($var, True);
        $this->config_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 = 10;</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 = 10;</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
     *
     * Generated from protobuf field <code>uint32 max_participants = 3;</code>
     * @return int
     */
    public function getMaxParticipants()
    {
        return $this->max_participants;
    }

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

        return $this;
    }

    /**
     * override the node room is allocated to, for debugging
     *
     * Generated from protobuf field <code>string node_id = 4;</code>
     * @return string
     */
    public function getNodeId()
    {
        return $this->node_id;
    }

    /**
     * override the node room is allocated to, for debugging
     *
     * Generated from protobuf field <code>string node_id = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setNodeId($var)
    {
        GPBUtil::checkString($var, True);
        $this->node_id = $var;

        return $this;
    }

    /**
     * metadata of room
     *
     * Generated from protobuf field <code>string metadata = 5;</code>
     * @return string
     */
    public function getMetadata()
    {
        return $this->metadata;
    }

    /**
     * metadata of room
     *
     * Generated from protobuf field <code>string metadata = 5;</code>
     * @param string $var
     * @return $this
     */
    public function setMetadata($var)
    {
        GPBUtil::checkString($var, True);
        $this->metadata = $var;

        return $this;
    }

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

        return $this;
    }

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

    public function hasAgent()
    {
        return isset($this->agent);
    }

    public function clearAgent()
    {
        unset($this->agent);
    }

    /**
     * agent
     *
     * Generated from protobuf field <code>.livekit.RoomAgent agent = 11;</code>
     * @param \Livekit\RoomAgent $var
     * @return $this
     */
    public function setAgent($var)
    {
        GPBUtil::checkMessage($var, \Livekit\RoomAgent::class);
        $this->agent = $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;
    }

    /**
     * replay
     *
     * Generated from protobuf field <code>bool replay_enabled = 13;</code>
     * @return bool
     */
    public function getReplayEnabled()
    {
        return $this->replay_enabled;
    }

    /**
     * replay
     *
     * Generated from protobuf field <code>bool replay_enabled = 13;</code>
     * @param bool $var
     * @return $this
     */
    public function setReplayEnabled($var)
    {
        GPBUtil::checkBool($var);
        $this->replay_enabled = $var;

        return $this;
    }

}

