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

namespace Livekit;

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

/**
 * Generated from protobuf message <code>livekit.StartEgressRequest</code>
 */
class StartEgressRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string room_name = 1;</code>
     */
    protected $room_name = '';
    /**
     * At least one required
     *
     * Generated from protobuf field <code>repeated .livekit.Output outputs = 7;</code>
     */
    private $outputs;
    /**
     * Request-level storage default
     *
     * Generated from protobuf field <code>.livekit.StorageConfig storage = 8;</code>
     */
    protected $storage = null;
    /**
     * Optional additional webhook config
     *
     * Generated from protobuf field <code>repeated .livekit.WebhookConfig webhooks = 9;</code>
     */
    private $webhooks;
    protected $source;
    protected $encoding;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $room_name
     *     @type \Livekit\TemplateSource $template
     *     @type \Livekit\WebSource $web
     *     @type \Livekit\MediaSource $media
     *     @type int $preset
     *     @type \Livekit\EncodingOptions $advanced
     *     @type \Livekit\Output[] $outputs
     *           At least one required
     *     @type \Livekit\StorageConfig $storage
     *           Request-level storage default
     *     @type \Livekit\WebhookConfig[] $webhooks
     *           Optional additional webhook config
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitEgress::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>string room_name = 1;</code>
     * @return string
     */
    public function getRoomName()
    {
        return $this->room_name;
    }

    /**
     * Generated from protobuf field <code>string room_name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setRoomName($var)
    {
        GPBUtil::checkString($var, True);
        $this->room_name = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.TemplateSource template = 2;</code>
     * @return \Livekit\TemplateSource|null
     */
    public function getTemplate()
    {
        return $this->readOneof(2);
    }

    public function hasTemplate()
    {
        return $this->hasOneof(2);
    }

    /**
     * Generated from protobuf field <code>.livekit.TemplateSource template = 2;</code>
     * @param \Livekit\TemplateSource $var
     * @return $this
     */
    public function setTemplate($var)
    {
        GPBUtil::checkMessage($var, \Livekit\TemplateSource::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.WebSource web = 3;</code>
     * @return \Livekit\WebSource|null
     */
    public function getWeb()
    {
        return $this->readOneof(3);
    }

    public function hasWeb()
    {
        return $this->hasOneof(3);
    }

    /**
     * Generated from protobuf field <code>.livekit.WebSource web = 3;</code>
     * @param \Livekit\WebSource $var
     * @return $this
     */
    public function setWeb($var)
    {
        GPBUtil::checkMessage($var, \Livekit\WebSource::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.MediaSource media = 4;</code>
     * @return \Livekit\MediaSource|null
     */
    public function getMedia()
    {
        return $this->readOneof(4);
    }

    public function hasMedia()
    {
        return $this->hasOneof(4);
    }

    /**
     * Generated from protobuf field <code>.livekit.MediaSource media = 4;</code>
     * @param \Livekit\MediaSource $var
     * @return $this
     */
    public function setMedia($var)
    {
        GPBUtil::checkMessage($var, \Livekit\MediaSource::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.EncodingOptionsPreset preset = 5;</code>
     * @return int
     */
    public function getPreset()
    {
        return $this->readOneof(5);
    }

    public function hasPreset()
    {
        return $this->hasOneof(5);
    }

    /**
     * Generated from protobuf field <code>.livekit.EncodingOptionsPreset preset = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setPreset($var)
    {
        GPBUtil::checkEnum($var, \Livekit\EncodingOptionsPreset::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.livekit.EncodingOptions advanced = 6;</code>
     * @return \Livekit\EncodingOptions|null
     */
    public function getAdvanced()
    {
        return $this->readOneof(6);
    }

    public function hasAdvanced()
    {
        return $this->hasOneof(6);
    }

    /**
     * Generated from protobuf field <code>.livekit.EncodingOptions advanced = 6;</code>
     * @param \Livekit\EncodingOptions $var
     * @return $this
     */
    public function setAdvanced($var)
    {
        GPBUtil::checkMessage($var, \Livekit\EncodingOptions::class);
        $this->writeOneof(6, $var);

        return $this;
    }

    /**
     * At least one required
     *
     * Generated from protobuf field <code>repeated .livekit.Output outputs = 7;</code>
     * @return RepeatedField<\Livekit\Output>
     */
    public function getOutputs()
    {
        return $this->outputs;
    }

    /**
     * At least one required
     *
     * Generated from protobuf field <code>repeated .livekit.Output outputs = 7;</code>
     * @param \Livekit\Output[] $var
     * @return $this
     */
    public function setOutputs($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Livekit\Output::class);
        $this->outputs = $arr;

        return $this;
    }

    /**
     * Request-level storage default
     *
     * Generated from protobuf field <code>.livekit.StorageConfig storage = 8;</code>
     * @return \Livekit\StorageConfig|null
     */
    public function getStorage()
    {
        return $this->storage;
    }

    public function hasStorage()
    {
        return isset($this->storage);
    }

    public function clearStorage()
    {
        unset($this->storage);
    }

    /**
     * Request-level storage default
     *
     * Generated from protobuf field <code>.livekit.StorageConfig storage = 8;</code>
     * @param \Livekit\StorageConfig $var
     * @return $this
     */
    public function setStorage($var)
    {
        GPBUtil::checkMessage($var, \Livekit\StorageConfig::class);
        $this->storage = $var;

        return $this;
    }

    /**
     * Optional additional webhook config
     *
     * Generated from protobuf field <code>repeated .livekit.WebhookConfig webhooks = 9;</code>
     * @return RepeatedField<\Livekit\WebhookConfig>
     */
    public function getWebhooks()
    {
        return $this->webhooks;
    }

    /**
     * Optional additional webhook config
     *
     * Generated from protobuf field <code>repeated .livekit.WebhookConfig webhooks = 9;</code>
     * @param \Livekit\WebhookConfig[] $var
     * @return $this
     */
    public function setWebhooks($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Livekit\WebhookConfig::class);
        $this->webhooks = $arr;

        return $this;
    }

    /**
     * @return string
     */
    public function getSource()
    {
        return $this->whichOneof("source");
    }

    /**
     * @return string
     */
    public function getEncoding()
    {
        return $this->whichOneof("encoding");
    }

}

