<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: apache/rocketmq/v2/service.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.EndTransactionRequest</code>
 */
class EndTransactionRequest 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>string message_id = 2;</code>
     */
    protected $message_id = '';
    /**
     * Generated from protobuf field <code>string transaction_id = 3;</code>
     */
    protected $transaction_id = '';
    /**
     * Generated from protobuf field <code>.apache.rocketmq.v2.TransactionResolution resolution = 4;</code>
     */
    protected $resolution = 0;
    /**
     * Generated from protobuf field <code>.apache.rocketmq.v2.TransactionSource source = 5;</code>
     */
    protected $source = 0;
    /**
     * Generated from protobuf field <code>string trace_context = 6;</code>
     */
    protected $trace_context = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Apache\Rocketmq\V2\Resource $topic
     *     @type string $message_id
     *     @type string $transaction_id
     *     @type int $resolution
     *     @type int $source
     *     @type string $trace_context
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Apache\Rocketmq\V2\Service::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>string message_id = 2;</code>
     * @return string
     */
    public function getMessageId()
    {
        return $this->message_id;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>string transaction_id = 3;</code>
     * @return string
     */
    public function getTransactionId()
    {
        return $this->transaction_id;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>.apache.rocketmq.v2.TransactionResolution resolution = 4;</code>
     * @return int
     */
    public function getResolution()
    {
        return $this->resolution;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>.apache.rocketmq.v2.TransactionSource source = 5;</code>
     * @return int
     */
    public function getSource()
    {
        return $this->source;
    }

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

        return $this;
    }

    /**
     * Generated from protobuf field <code>string trace_context = 6;</code>
     * @return string
     */
    public function getTraceContext()
    {
        return $this->trace_context;
    }

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

        return $this;
    }

}

