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

namespace Livekit;

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

/**
 * ListUpdate is used for updated APIs where 'repeated string' field is modified.
 *
 * Generated from protobuf message <code>livekit.ListUpdate</code>
 */
class ListUpdate extends \Google\Protobuf\Internal\Message
{
    /**
     * set the field to a new list
     *
     * Generated from protobuf field <code>repeated string set = 1;</code>
     */
    private $set;
    /**
     * append items to a list, avoiding duplicates
     *
     * Generated from protobuf field <code>repeated string add = 2;</code>
     */
    private $add;
    /**
     * delete items from a list
     *
     * Generated from protobuf field <code>repeated string remove = 3;</code>
     */
    private $remove;
    /**
     * sets the list to an empty list
     *
     * Generated from protobuf field <code>bool clear = 4;</code>
     */
    protected $clear = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string[] $set
     *           set the field to a new list
     *     @type string[] $add
     *           append items to a list, avoiding duplicates
     *     @type string[] $remove
     *           delete items from a list
     *     @type bool $clear
     *           sets the list to an empty list
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitModels::initOnce();
        parent::__construct($data);
    }

    /**
     * set the field to a new list
     *
     * Generated from protobuf field <code>repeated string set = 1;</code>
     * @return RepeatedField<string>
     */
    public function getSet()
    {
        return $this->set;
    }

    /**
     * set the field to a new list
     *
     * Generated from protobuf field <code>repeated string set = 1;</code>
     * @param string[] $var
     * @return $this
     */
    public function setSet($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->set = $arr;

        return $this;
    }

    /**
     * append items to a list, avoiding duplicates
     *
     * Generated from protobuf field <code>repeated string add = 2;</code>
     * @return RepeatedField<string>
     */
    public function getAdd()
    {
        return $this->add;
    }

    /**
     * append items to a list, avoiding duplicates
     *
     * Generated from protobuf field <code>repeated string add = 2;</code>
     * @param string[] $var
     * @return $this
     */
    public function setAdd($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->add = $arr;

        return $this;
    }

    /**
     * delete items from a list
     *
     * Generated from protobuf field <code>repeated string remove = 3;</code>
     * @return RepeatedField<string>
     */
    public function getRemove()
    {
        return $this->remove;
    }

    /**
     * delete items from a list
     *
     * Generated from protobuf field <code>repeated string remove = 3;</code>
     * @param string[] $var
     * @return $this
     */
    public function setRemove($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->remove = $arr;

        return $this;
    }

    /**
     * sets the list to an empty list
     *
     * Generated from protobuf field <code>bool clear = 4;</code>
     * @return bool
     */
    public function getClear()
    {
        return $this->clear;
    }

    /**
     * sets the list to an empty list
     *
     * Generated from protobuf field <code>bool clear = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setClear($var)
    {
        GPBUtil::checkBool($var);
        $this->clear = $var;

        return $this;
    }

}

