<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: livekit_room.proto

namespace Livekit;

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

/**
 * 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 room_preset = 12;</code>
     */
    protected $room_preset = '';
    /**
     * 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 [(.logger.name) = "nodeID"];</code>
     */
    protected $node_id = '';
    /**
     * metadata of room
     *
     * Generated from protobuf field <code>string metadata = 5 [(.logger.redact) = true, (.logger.redact_format) = "<redacted ({{ .Size }} bytes)>"];</code>
     */
    protected $metadata = '';
    /**
     * auto-egress configurations
     *
     * Generated from protobuf field <code>.livekit.RoomEgress egress = 6;</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;
    /**
     * replay
     *
     * Generated from protobuf field <code>bool replay_enabled = 13;</code>
     */
    protected $replay_enabled = false;
    /**
     * Define agents that should be dispatched to this room
     *
     * Generated from protobuf field <code>repeated .livekit.RoomAgentDispatch agents = 14;</code>
     */
    private $agents;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           name of the room
     *     @type string $room_preset
     *           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
     *           auto-egress configurations
     *     @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
     *     @type \Livekit\RoomAgentDispatch[] $agents
     *           Define agents that should be dispatched to this room
     * }
     */
    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 room_preset = 12;</code>
     * @return string
     */
    public function getRoomPreset()
    {
        return $this->room_preset;
    }

    /**
     * configuration to use for this room parameters. Setting parameters below override the config defaults.
     *
     * Generated from protobuf field <code>string room_preset = 12;</code>
     * @param string $var
     * @return $this
     */
    public function setRoomPreset($var)
    {
        GPBUtil::checkString($var, True);
        $this->room_preset = $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 [(.logger.name) = "nodeID"];</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 [(.logger.name) = "nodeID"];</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 [(.logger.redact) = true, (.logger.redact_format) = "<redacted ({{ .Size }} bytes)>"];</code>
     * @return string
     */
    public function getMetadata()
    {
        return $this->metadata;
    }

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

    /**
     * auto-egress configurations
     *
     * 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);
    }

    /**
     * auto-egress configurations
     *
     * 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;
    }

    /**
     * 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;
    }

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

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

        return $this;
    }

}

