<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: livekit_sip.proto

namespace Livekit;

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

/**
 * Generated from protobuf message <code>livekit.SIPDispatchRuleUpdate</code>
 */
class SIPDispatchRuleUpdate extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>.livekit.ListUpdate trunk_ids = 1;</code>
     */
    protected $trunk_ids = null;
    /**
     * Generated from protobuf field <code>.livekit.SIPDispatchRule rule = 2;</code>
     */
    protected $rule = null;
    /**
     * Generated from protobuf field <code>optional string name = 3;</code>
     */
    protected $name = null;
    /**
     * Generated from protobuf field <code>optional string metadata = 4;</code>
     */
    protected $metadata = null;
    /**
     * Generated from protobuf field <code>map<string, string> attributes = 5;</code>
     */
    private $attributes;
    /**
     * Generated from protobuf field <code>optional .livekit.SIPMediaEncryption media_encryption = 6;</code>
     */
    protected $media_encryption = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Livekit\ListUpdate $trunk_ids
     *     @type \Livekit\SIPDispatchRule $rule
     *     @type string $name
     *     @type string $metadata
     *     @type array|\Google\Protobuf\Internal\MapField $attributes
     *     @type int $media_encryption
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\LivekitSip::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>.livekit.ListUpdate trunk_ids = 1;</code>
     * @return \Livekit\ListUpdate|null
     */
    public function getTrunkIds()
    {
        return $this->trunk_ids;
    }

    public function hasTrunkIds()
    {
        return isset($this->trunk_ids);
    }

    public function clearTrunkIds()
    {
        unset($this->trunk_ids);
    }

    /**
     * Generated from protobuf field <code>.livekit.ListUpdate trunk_ids = 1;</code>
     * @param \Livekit\ListUpdate $var
     * @return $this
     */
    public function setTrunkIds($var)
    {
        GPBUtil::checkMessage($var, \Livekit\ListUpdate::class);
        $this->trunk_ids = $var;

        return $this;
    }

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

    public function hasRule()
    {
        return isset($this->rule);
    }

    public function clearRule()
    {
        unset($this->rule);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional string name = 3;</code>
     * @return string
     */
    public function getName()
    {
        return isset($this->name) ? $this->name : '';
    }

    public function hasName()
    {
        return isset($this->name);
    }

    public function clearName()
    {
        unset($this->name);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional string metadata = 4;</code>
     * @return string
     */
    public function getMetadata()
    {
        return isset($this->metadata) ? $this->metadata : '';
    }

    public function hasMetadata()
    {
        return isset($this->metadata);
    }

    public function clearMetadata()
    {
        unset($this->metadata);
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>map<string, string> attributes = 5;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getAttributes()
    {
        return $this->attributes;
    }

    /**
     * Generated from protobuf field <code>map<string, string> attributes = 5;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setAttributes($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->attributes = $arr;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional .livekit.SIPMediaEncryption media_encryption = 6;</code>
     * @return int
     */
    public function getMediaEncryption()
    {
        return isset($this->media_encryption) ? $this->media_encryption : 0;
    }

    public function hasMediaEncryption()
    {
        return isset($this->media_encryption);
    }

    public function clearMediaEncryption()
    {
        unset($this->media_encryption);
    }

    /**
     * Generated from protobuf field <code>optional .livekit.SIPMediaEncryption media_encryption = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setMediaEncryption($var)
    {
        GPBUtil::checkEnum($var, \Livekit\SIPMediaEncryption::class);
        $this->media_encryption = $var;

        return $this;
    }

}

