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

namespace Livekit;

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

/**
 * 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 [(.logger.redact_format) = "<redacted ({{ .Size }} bytes)>", (.logger.sensitivity) = SENSITIVITY_PII];</code>
     */
    protected $metadata = null;
    /**
     * Generated from protobuf field <code>map<string, string> attributes = 5 [(.logger.redact_format) = "<redacted ({{ .Size }} bytes)>", (.logger.sensitivity) = SENSITIVITY_PII];</code>
     */
    private $attributes;
    /**
     * Generated from protobuf field <code>optional .livekit.SIPMediaEncryption media_encryption = 6 [deprecated = true];</code>
     * @deprecated
     */
    protected $media_encryption = null;
    /**
     * Generated from protobuf field <code>.livekit.SIPMediaConfig media = 7;</code>
     */
    protected $media = 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
     *     @type \Livekit\SIPMediaConfig $media
     * }
     */
    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 [(.logger.redact_format) = "<redacted ({{ .Size }} bytes)>", (.logger.sensitivity) = SENSITIVITY_PII];</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 [(.logger.redact_format) = "<redacted ({{ .Size }} bytes)>", (.logger.sensitivity) = SENSITIVITY_PII];</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 [(.logger.redact_format) = "<redacted ({{ .Size }} bytes)>", (.logger.sensitivity) = SENSITIVITY_PII];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getAttributes()
    {
        return $this->attributes;
    }

    /**
     * Generated from protobuf field <code>map<string, string> attributes = 5 [(.logger.redact_format) = "<redacted ({{ .Size }} bytes)>", (.logger.sensitivity) = SENSITIVITY_PII];</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 [deprecated = true];</code>
     * @return int
     * @deprecated
     */
    public function getMediaEncryption()
    {
        if (isset($this->media_encryption)) {
            @trigger_error('media_encryption is deprecated.', E_USER_DEPRECATED);
        }
        return isset($this->media_encryption) ? $this->media_encryption : 0;
    }

    public function hasMediaEncryption()
    {
        if (isset($this->media_encryption)) {
            @trigger_error('media_encryption is deprecated.', E_USER_DEPRECATED);
        }
        return isset($this->media_encryption);
    }

    public function clearMediaEncryption()
    {
        @trigger_error('media_encryption is deprecated.', E_USER_DEPRECATED);
        unset($this->media_encryption);
    }

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

        return $this;
    }

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

    public function hasMedia()
    {
        return isset($this->media);
    }

    public function clearMedia()
    {
        unset($this->media);
    }

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

        return $this;
    }

}

