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

namespace Livekit\UpdateDataSubscription;

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

/**
 * Generated from protobuf message <code>livekit.UpdateDataSubscription.Update</code>
 */
class Update extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>string track_sid = 1;</code>
     */
    protected $track_sid = '';
    /**
     * Generated from protobuf field <code>bool subscribe = 2;</code>
     */
    protected $subscribe = false;
    /**
     * Options to apply when initially subscribing or updating an existing subscription.
     * When unsubscribing, this field is ignored.
     *
     * Generated from protobuf field <code>.livekit.DataTrackSubscriptionOptions options = 3;</code>
     */
    protected $options = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $track_sid
     *     @type bool $subscribe
     *     @type \Livekit\DataTrackSubscriptionOptions $options
     *           Options to apply when initially subscribing or updating an existing subscription.
     *           When unsubscribing, this field is ignored.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitRtc::initOnce();
        parent::__construct($data);
    }

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

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>bool subscribe = 2;</code>
     * @return bool
     */
    public function getSubscribe()
    {
        return $this->subscribe;
    }

    /**
     * Generated from protobuf field <code>bool subscribe = 2;</code>
     * @param bool $var
     * @return $this
     */
    public function setSubscribe($var)
    {
        GPBUtil::checkBool($var);
        $this->subscribe = $var;

        return $this;
    }

    /**
     * Options to apply when initially subscribing or updating an existing subscription.
     * When unsubscribing, this field is ignored.
     *
     * Generated from protobuf field <code>.livekit.DataTrackSubscriptionOptions options = 3;</code>
     * @return \Livekit\DataTrackSubscriptionOptions|null
     */
    public function getOptions()
    {
        return $this->options;
    }

    public function hasOptions()
    {
        return isset($this->options);
    }

    public function clearOptions()
    {
        unset($this->options);
    }

    /**
     * Options to apply when initially subscribing or updating an existing subscription.
     * When unsubscribing, this field is ignored.
     *
     * Generated from protobuf field <code>.livekit.DataTrackSubscriptionOptions options = 3;</code>
     * @param \Livekit\DataTrackSubscriptionOptions $var
     * @return $this
     */
    public function setOptions($var)
    {
        GPBUtil::checkMessage($var, \Livekit\DataTrackSubscriptionOptions::class);
        $this->options = $var;

        return $this;
    }

}

