<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: apache/rocketmq/v2/definition.proto

namespace Apache\Rocketmq\V2;

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

/**
 * Generated from protobuf message <code>apache.rocketmq.v2.MessageQueue</code>
 */
class MessageQueue extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>.apache.rocketmq.v2.Resource topic = 1;</code>
     */
    protected $topic = null;
    /**
     * Generated from protobuf field <code>int32 id = 2;</code>
     */
    protected $id = 0;
    /**
     * Generated from protobuf field <code>.apache.rocketmq.v2.Permission permission = 3;</code>
     */
    protected $permission = 0;
    /**
     * Generated from protobuf field <code>.apache.rocketmq.v2.Broker broker = 4;</code>
     */
    protected $broker = null;
    /**
     * Generated from protobuf field <code>repeated .apache.rocketmq.v2.MessageType accept_message_types = 5;</code>
     */
    private $accept_message_types;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Apache\Rocketmq\V2\Resource $topic
     *     @type int $id
     *     @type int $permission
     *     @type \Apache\Rocketmq\V2\Broker $broker
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $accept_message_types
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Apache\Rocketmq\V2\Definition::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>.apache.rocketmq.v2.Resource topic = 1;</code>
     * @return \Apache\Rocketmq\V2\Resource|null
     */
    public function getTopic()
    {
        return $this->topic;
    }

    public function hasTopic()
    {
        return isset($this->topic);
    }

    public function clearTopic()
    {
        unset($this->topic);
    }

    /**
     * Generated from protobuf field <code>.apache.rocketmq.v2.Resource topic = 1;</code>
     * @param \Apache\Rocketmq\V2\Resource $var
     * @return $this
     */
    public function setTopic($var)
    {
        GPBUtil::checkMessage($var, \Apache\Rocketmq\V2\Resource::class);
        $this->topic = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>int32 id = 2;</code>
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Generated from protobuf field <code>int32 id = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkInt32($var);
        $this->id = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.apache.rocketmq.v2.Permission permission = 3;</code>
     * @return int
     */
    public function getPermission()
    {
        return $this->permission;
    }

    /**
     * Generated from protobuf field <code>.apache.rocketmq.v2.Permission permission = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setPermission($var)
    {
        GPBUtil::checkEnum($var, \Apache\Rocketmq\V2\Permission::class);
        $this->permission = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>.apache.rocketmq.v2.Broker broker = 4;</code>
     * @return \Apache\Rocketmq\V2\Broker|null
     */
    public function getBroker()
    {
        return $this->broker;
    }

    public function hasBroker()
    {
        return isset($this->broker);
    }

    public function clearBroker()
    {
        unset($this->broker);
    }

    /**
     * Generated from protobuf field <code>.apache.rocketmq.v2.Broker broker = 4;</code>
     * @param \Apache\Rocketmq\V2\Broker $var
     * @return $this
     */
    public function setBroker($var)
    {
        GPBUtil::checkMessage($var, \Apache\Rocketmq\V2\Broker::class);
        $this->broker = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .apache.rocketmq.v2.MessageType accept_message_types = 5;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAcceptMessageTypes()
    {
        return $this->accept_message_types;
    }

    /**
     * Generated from protobuf field <code>repeated .apache.rocketmq.v2.MessageType accept_message_types = 5;</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAcceptMessageTypes($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Apache\Rocketmq\V2\MessageType::class);
        $this->accept_message_types = $arr;

        return $this;
    }

}

