<?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.SystemProperties</code>
 */
class SystemProperties extends \Google\Protobuf\Internal\Message
{
    /**
     * Tag, which is optional.
     *
     * Generated from protobuf field <code>optional string tag = 1;</code>
     */
    protected $tag = null;
    /**
     * Message keys
     *
     * Generated from protobuf field <code>repeated string keys = 2;</code>
     */
    private $keys;
    /**
     * Message identifier, client-side generated, remains unique.
     * if message_id is empty, the send message request will be aborted with
     * status `INVALID_ARGUMENT`
     *
     * Generated from protobuf field <code>string message_id = 3;</code>
     */
    protected $message_id = '';
    /**
     * Message body digest
     *
     * Generated from protobuf field <code>.apache.rocketmq.v2.Digest body_digest = 4;</code>
     */
    protected $body_digest = null;
    /**
     * Message body encoding. Candidate options are identity, gzip, snappy etc.
     *
     * Generated from protobuf field <code>.apache.rocketmq.v2.Encoding body_encoding = 5;</code>
     */
    protected $body_encoding = 0;
    /**
     * Message type, normal, FIFO or transactional.
     *
     * Generated from protobuf field <code>.apache.rocketmq.v2.MessageType message_type = 6;</code>
     */
    protected $message_type = 0;
    /**
     * Message born time-point.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp born_timestamp = 7;</code>
     */
    protected $born_timestamp = null;
    /**
     * Message born host. Valid options are IPv4, IPv6 or client host domain name.
     *
     * Generated from protobuf field <code>string born_host = 8;</code>
     */
    protected $born_host = '';
    /**
     * Time-point at which the message is stored in the broker, which is absent
     * for message publishing.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Timestamp store_timestamp = 9;</code>
     */
    protected $store_timestamp = null;
    /**
     * The broker that stores this message. It may be broker name, IP or arbitrary
     * identifier that uniquely identify the server.
     *
     * Generated from protobuf field <code>string store_host = 10;</code>
     */
    protected $store_host = '';
    /**
     * Time-point at which broker delivers to clients, which is optional.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Timestamp delivery_timestamp = 11;</code>
     */
    protected $delivery_timestamp = null;
    /**
     * If a message is acquired by way of POP, this field holds the receipt,
     * which is absent for message publishing.
     * Clients use the receipt to acknowledge or negatively acknowledge the
     * message.
     *
     * Generated from protobuf field <code>optional string receipt_handle = 12;</code>
     */
    protected $receipt_handle = null;
    /**
     * Message queue identifier in which a message is physically stored.
     *
     * Generated from protobuf field <code>int32 queue_id = 13;</code>
     */
    protected $queue_id = 0;
    /**
     * Message-queue offset at which a message is stored, which is absent for
     * message publishing.
     *
     * Generated from protobuf field <code>optional int64 queue_offset = 14;</code>
     */
    protected $queue_offset = null;
    /**
     * Period of time servers would remain invisible once a message is acquired.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Duration invisible_duration = 15;</code>
     */
    protected $invisible_duration = null;
    /**
     * Business code may failed to process messages for the moment. Hence, clients
     * may request servers to deliver them again using certain back-off strategy,
     * the attempt is 1 not 0 if message is delivered first time, and it is absent
     * for message publishing.
     *
     * Generated from protobuf field <code>optional int32 delivery_attempt = 16;</code>
     */
    protected $delivery_attempt = null;
    /**
     * Define the group name of message in the same topic, which is optional.
     *
     * Generated from protobuf field <code>optional string message_group = 17;</code>
     */
    protected $message_group = null;
    /**
     * Trace context for each message, which is optional.
     *
     * Generated from protobuf field <code>optional string trace_context = 18;</code>
     */
    protected $trace_context = null;
    /**
     * If a transactional message stay unresolved for more than
     * `transaction_orphan_threshold`, it would be regarded as an
     * orphan. Servers that manages orphan messages would pick up
     * a capable publisher to resolve
     *
     * Generated from protobuf field <code>optional .google.protobuf.Duration orphaned_transaction_recovery_duration = 19;</code>
     */
    protected $orphaned_transaction_recovery_duration = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $tag
     *           Tag, which is optional.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $keys
     *           Message keys
     *     @type string $message_id
     *           Message identifier, client-side generated, remains unique.
     *           if message_id is empty, the send message request will be aborted with
     *           status `INVALID_ARGUMENT`
     *     @type \Apache\Rocketmq\V2\Digest $body_digest
     *           Message body digest
     *     @type int $body_encoding
     *           Message body encoding. Candidate options are identity, gzip, snappy etc.
     *     @type int $message_type
     *           Message type, normal, FIFO or transactional.
     *     @type \Google\Protobuf\Timestamp $born_timestamp
     *           Message born time-point.
     *     @type string $born_host
     *           Message born host. Valid options are IPv4, IPv6 or client host domain name.
     *     @type \Google\Protobuf\Timestamp $store_timestamp
     *           Time-point at which the message is stored in the broker, which is absent
     *           for message publishing.
     *     @type string $store_host
     *           The broker that stores this message. It may be broker name, IP or arbitrary
     *           identifier that uniquely identify the server.
     *     @type \Google\Protobuf\Timestamp $delivery_timestamp
     *           Time-point at which broker delivers to clients, which is optional.
     *     @type string $receipt_handle
     *           If a message is acquired by way of POP, this field holds the receipt,
     *           which is absent for message publishing.
     *           Clients use the receipt to acknowledge or negatively acknowledge the
     *           message.
     *     @type int $queue_id
     *           Message queue identifier in which a message is physically stored.
     *     @type int|string $queue_offset
     *           Message-queue offset at which a message is stored, which is absent for
     *           message publishing.
     *     @type \Google\Protobuf\Duration $invisible_duration
     *           Period of time servers would remain invisible once a message is acquired.
     *     @type int $delivery_attempt
     *           Business code may failed to process messages for the moment. Hence, clients
     *           may request servers to deliver them again using certain back-off strategy,
     *           the attempt is 1 not 0 if message is delivered first time, and it is absent
     *           for message publishing.
     *     @type string $message_group
     *           Define the group name of message in the same topic, which is optional.
     *     @type string $trace_context
     *           Trace context for each message, which is optional.
     *     @type \Google\Protobuf\Duration $orphaned_transaction_recovery_duration
     *           If a transactional message stay unresolved for more than
     *           `transaction_orphan_threshold`, it would be regarded as an
     *           orphan. Servers that manages orphan messages would pick up
     *           a capable publisher to resolve
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Apache\Rocketmq\V2\Definition::initOnce();
        parent::__construct($data);
    }

    /**
     * Tag, which is optional.
     *
     * Generated from protobuf field <code>optional string tag = 1;</code>
     * @return string
     */
    public function getTag()
    {
        return isset($this->tag) ? $this->tag : '';
    }

    public function hasTag()
    {
        return isset($this->tag);
    }

    public function clearTag()
    {
        unset($this->tag);
    }

    /**
     * Tag, which is optional.
     *
     * Generated from protobuf field <code>optional string tag = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setTag($var)
    {
        GPBUtil::checkString($var, True);
        $this->tag = $var;

        return $this;
    }

    /**
     * Message keys
     *
     * Generated from protobuf field <code>repeated string keys = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getKeys()
    {
        return $this->keys;
    }

    /**
     * Message keys
     *
     * Generated from protobuf field <code>repeated string keys = 2;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setKeys($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->keys = $arr;

        return $this;
    }

    /**
     * Message identifier, client-side generated, remains unique.
     * if message_id is empty, the send message request will be aborted with
     * status `INVALID_ARGUMENT`
     *
     * Generated from protobuf field <code>string message_id = 3;</code>
     * @return string
     */
    public function getMessageId()
    {
        return $this->message_id;
    }

    /**
     * Message identifier, client-side generated, remains unique.
     * if message_id is empty, the send message request will be aborted with
     * status `INVALID_ARGUMENT`
     *
     * Generated from protobuf field <code>string message_id = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setMessageId($var)
    {
        GPBUtil::checkString($var, True);
        $this->message_id = $var;

        return $this;
    }

    /**
     * Message body digest
     *
     * Generated from protobuf field <code>.apache.rocketmq.v2.Digest body_digest = 4;</code>
     * @return \Apache\Rocketmq\V2\Digest|null
     */
    public function getBodyDigest()
    {
        return $this->body_digest;
    }

    public function hasBodyDigest()
    {
        return isset($this->body_digest);
    }

    public function clearBodyDigest()
    {
        unset($this->body_digest);
    }

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

        return $this;
    }

    /**
     * Message body encoding. Candidate options are identity, gzip, snappy etc.
     *
     * Generated from protobuf field <code>.apache.rocketmq.v2.Encoding body_encoding = 5;</code>
     * @return int
     */
    public function getBodyEncoding()
    {
        return $this->body_encoding;
    }

    /**
     * Message body encoding. Candidate options are identity, gzip, snappy etc.
     *
     * Generated from protobuf field <code>.apache.rocketmq.v2.Encoding body_encoding = 5;</code>
     * @param int $var
     * @return $this
     */
    public function setBodyEncoding($var)
    {
        GPBUtil::checkEnum($var, \Apache\Rocketmq\V2\Encoding::class);
        $this->body_encoding = $var;

        return $this;
    }

    /**
     * Message type, normal, FIFO or transactional.
     *
     * Generated from protobuf field <code>.apache.rocketmq.v2.MessageType message_type = 6;</code>
     * @return int
     */
    public function getMessageType()
    {
        return $this->message_type;
    }

    /**
     * Message type, normal, FIFO or transactional.
     *
     * Generated from protobuf field <code>.apache.rocketmq.v2.MessageType message_type = 6;</code>
     * @param int $var
     * @return $this
     */
    public function setMessageType($var)
    {
        GPBUtil::checkEnum($var, \Apache\Rocketmq\V2\MessageType::class);
        $this->message_type = $var;

        return $this;
    }

    /**
     * Message born time-point.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp born_timestamp = 7;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getBornTimestamp()
    {
        return $this->born_timestamp;
    }

    public function hasBornTimestamp()
    {
        return isset($this->born_timestamp);
    }

    public function clearBornTimestamp()
    {
        unset($this->born_timestamp);
    }

    /**
     * Message born time-point.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp born_timestamp = 7;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setBornTimestamp($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->born_timestamp = $var;

        return $this;
    }

    /**
     * Message born host. Valid options are IPv4, IPv6 or client host domain name.
     *
     * Generated from protobuf field <code>string born_host = 8;</code>
     * @return string
     */
    public function getBornHost()
    {
        return $this->born_host;
    }

    /**
     * Message born host. Valid options are IPv4, IPv6 or client host domain name.
     *
     * Generated from protobuf field <code>string born_host = 8;</code>
     * @param string $var
     * @return $this
     */
    public function setBornHost($var)
    {
        GPBUtil::checkString($var, True);
        $this->born_host = $var;

        return $this;
    }

    /**
     * Time-point at which the message is stored in the broker, which is absent
     * for message publishing.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Timestamp store_timestamp = 9;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getStoreTimestamp()
    {
        return $this->store_timestamp;
    }

    public function hasStoreTimestamp()
    {
        return isset($this->store_timestamp);
    }

    public function clearStoreTimestamp()
    {
        unset($this->store_timestamp);
    }

    /**
     * Time-point at which the message is stored in the broker, which is absent
     * for message publishing.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Timestamp store_timestamp = 9;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setStoreTimestamp($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->store_timestamp = $var;

        return $this;
    }

    /**
     * The broker that stores this message. It may be broker name, IP or arbitrary
     * identifier that uniquely identify the server.
     *
     * Generated from protobuf field <code>string store_host = 10;</code>
     * @return string
     */
    public function getStoreHost()
    {
        return $this->store_host;
    }

    /**
     * The broker that stores this message. It may be broker name, IP or arbitrary
     * identifier that uniquely identify the server.
     *
     * Generated from protobuf field <code>string store_host = 10;</code>
     * @param string $var
     * @return $this
     */
    public function setStoreHost($var)
    {
        GPBUtil::checkString($var, True);
        $this->store_host = $var;

        return $this;
    }

    /**
     * Time-point at which broker delivers to clients, which is optional.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Timestamp delivery_timestamp = 11;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getDeliveryTimestamp()
    {
        return $this->delivery_timestamp;
    }

    public function hasDeliveryTimestamp()
    {
        return isset($this->delivery_timestamp);
    }

    public function clearDeliveryTimestamp()
    {
        unset($this->delivery_timestamp);
    }

    /**
     * Time-point at which broker delivers to clients, which is optional.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Timestamp delivery_timestamp = 11;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setDeliveryTimestamp($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->delivery_timestamp = $var;

        return $this;
    }

    /**
     * If a message is acquired by way of POP, this field holds the receipt,
     * which is absent for message publishing.
     * Clients use the receipt to acknowledge or negatively acknowledge the
     * message.
     *
     * Generated from protobuf field <code>optional string receipt_handle = 12;</code>
     * @return string
     */
    public function getReceiptHandle()
    {
        return isset($this->receipt_handle) ? $this->receipt_handle : '';
    }

    public function hasReceiptHandle()
    {
        return isset($this->receipt_handle);
    }

    public function clearReceiptHandle()
    {
        unset($this->receipt_handle);
    }

    /**
     * If a message is acquired by way of POP, this field holds the receipt,
     * which is absent for message publishing.
     * Clients use the receipt to acknowledge or negatively acknowledge the
     * message.
     *
     * Generated from protobuf field <code>optional string receipt_handle = 12;</code>
     * @param string $var
     * @return $this
     */
    public function setReceiptHandle($var)
    {
        GPBUtil::checkString($var, True);
        $this->receipt_handle = $var;

        return $this;
    }

    /**
     * Message queue identifier in which a message is physically stored.
     *
     * Generated from protobuf field <code>int32 queue_id = 13;</code>
     * @return int
     */
    public function getQueueId()
    {
        return $this->queue_id;
    }

    /**
     * Message queue identifier in which a message is physically stored.
     *
     * Generated from protobuf field <code>int32 queue_id = 13;</code>
     * @param int $var
     * @return $this
     */
    public function setQueueId($var)
    {
        GPBUtil::checkInt32($var);
        $this->queue_id = $var;

        return $this;
    }

    /**
     * Message-queue offset at which a message is stored, which is absent for
     * message publishing.
     *
     * Generated from protobuf field <code>optional int64 queue_offset = 14;</code>
     * @return int|string
     */
    public function getQueueOffset()
    {
        return isset($this->queue_offset) ? $this->queue_offset : 0;
    }

    public function hasQueueOffset()
    {
        return isset($this->queue_offset);
    }

    public function clearQueueOffset()
    {
        unset($this->queue_offset);
    }

    /**
     * Message-queue offset at which a message is stored, which is absent for
     * message publishing.
     *
     * Generated from protobuf field <code>optional int64 queue_offset = 14;</code>
     * @param int|string $var
     * @return $this
     */
    public function setQueueOffset($var)
    {
        GPBUtil::checkInt64($var);
        $this->queue_offset = $var;

        return $this;
    }

    /**
     * Period of time servers would remain invisible once a message is acquired.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Duration invisible_duration = 15;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getInvisibleDuration()
    {
        return $this->invisible_duration;
    }

    public function hasInvisibleDuration()
    {
        return isset($this->invisible_duration);
    }

    public function clearInvisibleDuration()
    {
        unset($this->invisible_duration);
    }

    /**
     * Period of time servers would remain invisible once a message is acquired.
     *
     * Generated from protobuf field <code>optional .google.protobuf.Duration invisible_duration = 15;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setInvisibleDuration($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->invisible_duration = $var;

        return $this;
    }

    /**
     * Business code may failed to process messages for the moment. Hence, clients
     * may request servers to deliver them again using certain back-off strategy,
     * the attempt is 1 not 0 if message is delivered first time, and it is absent
     * for message publishing.
     *
     * Generated from protobuf field <code>optional int32 delivery_attempt = 16;</code>
     * @return int
     */
    public function getDeliveryAttempt()
    {
        return isset($this->delivery_attempt) ? $this->delivery_attempt : 0;
    }

    public function hasDeliveryAttempt()
    {
        return isset($this->delivery_attempt);
    }

    public function clearDeliveryAttempt()
    {
        unset($this->delivery_attempt);
    }

    /**
     * Business code may failed to process messages for the moment. Hence, clients
     * may request servers to deliver them again using certain back-off strategy,
     * the attempt is 1 not 0 if message is delivered first time, and it is absent
     * for message publishing.
     *
     * Generated from protobuf field <code>optional int32 delivery_attempt = 16;</code>
     * @param int $var
     * @return $this
     */
    public function setDeliveryAttempt($var)
    {
        GPBUtil::checkInt32($var);
        $this->delivery_attempt = $var;

        return $this;
    }

    /**
     * Define the group name of message in the same topic, which is optional.
     *
     * Generated from protobuf field <code>optional string message_group = 17;</code>
     * @return string
     */
    public function getMessageGroup()
    {
        return isset($this->message_group) ? $this->message_group : '';
    }

    public function hasMessageGroup()
    {
        return isset($this->message_group);
    }

    public function clearMessageGroup()
    {
        unset($this->message_group);
    }

    /**
     * Define the group name of message in the same topic, which is optional.
     *
     * Generated from protobuf field <code>optional string message_group = 17;</code>
     * @param string $var
     * @return $this
     */
    public function setMessageGroup($var)
    {
        GPBUtil::checkString($var, True);
        $this->message_group = $var;

        return $this;
    }

    /**
     * Trace context for each message, which is optional.
     *
     * Generated from protobuf field <code>optional string trace_context = 18;</code>
     * @return string
     */
    public function getTraceContext()
    {
        return isset($this->trace_context) ? $this->trace_context : '';
    }

    public function hasTraceContext()
    {
        return isset($this->trace_context);
    }

    public function clearTraceContext()
    {
        unset($this->trace_context);
    }

    /**
     * Trace context for each message, which is optional.
     *
     * Generated from protobuf field <code>optional string trace_context = 18;</code>
     * @param string $var
     * @return $this
     */
    public function setTraceContext($var)
    {
        GPBUtil::checkString($var, True);
        $this->trace_context = $var;

        return $this;
    }

    /**
     * If a transactional message stay unresolved for more than
     * `transaction_orphan_threshold`, it would be regarded as an
     * orphan. Servers that manages orphan messages would pick up
     * a capable publisher to resolve
     *
     * Generated from protobuf field <code>optional .google.protobuf.Duration orphaned_transaction_recovery_duration = 19;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getOrphanedTransactionRecoveryDuration()
    {
        return $this->orphaned_transaction_recovery_duration;
    }

    public function hasOrphanedTransactionRecoveryDuration()
    {
        return isset($this->orphaned_transaction_recovery_duration);
    }

    public function clearOrphanedTransactionRecoveryDuration()
    {
        unset($this->orphaned_transaction_recovery_duration);
    }

    /**
     * If a transactional message stay unresolved for more than
     * `transaction_orphan_threshold`, it would be regarded as an
     * orphan. Servers that manages orphan messages would pick up
     * a capable publisher to resolve
     *
     * Generated from protobuf field <code>optional .google.protobuf.Duration orphaned_transaction_recovery_duration = 19;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setOrphanedTransactionRecoveryDuration($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->orphaned_transaction_recovery_duration = $var;

        return $this;
    }

}

