123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220 |
- <?php
- # Generated by the protocol buffer compiler. DO NOT EDIT!
- # source: protos/ydb_topic.proto
- namespace Ydb\Topic\StreamReadMessage\ReadResponse;
- use Google\Protobuf\Internal\GPBType;
- use Google\Protobuf\Internal\RepeatedField;
- use Google\Protobuf\Internal\GPBUtil;
- /**
- * Representation of sequence of client messages from one write session.
- *
- * Generated from protobuf message <code>Ydb.Topic.StreamReadMessage.ReadResponse.Batch</code>
- */
- class Batch extends \Google\Protobuf\Internal\Message
- {
- /**
- * List of client messages.
- *
- * Generated from protobuf field <code>repeated .Ydb.Topic.StreamReadMessage.ReadResponse.MessageData message_data = 1;</code>
- */
- private $message_data;
- /**
- * Producer identifier provided by client for this batch of client messages.
- *
- * Generated from protobuf field <code>string producer_id = 2;</code>
- */
- protected $producer_id = '';
- /**
- * Client metadata attached to write session, the same for all messages in batch.
- *
- * Generated from protobuf field <code>map<string, string> write_session_meta = 3;</code>
- */
- private $write_session_meta;
- /**
- * Codec that is used for data compression.
- * See enum Codec above for values.
- *
- * Generated from protobuf field <code>int32 codec = 4;</code>
- */
- protected $codec = 0;
- /**
- * Persist timestamp on server for batch.
- *
- * Generated from protobuf field <code>.google.protobuf.Timestamp written_at = 5;</code>
- */
- protected $written_at = null;
- /**
- * Constructor.
- *
- * @param array $data {
- * Optional. Data for populating the Message object.
- *
- * @type array<\Ydb\Topic\StreamReadMessage\ReadResponse\MessageData>|\Google\Protobuf\Internal\RepeatedField $message_data
- * List of client messages.
- * @type string $producer_id
- * Producer identifier provided by client for this batch of client messages.
- * @type array|\Google\Protobuf\Internal\MapField $write_session_meta
- * Client metadata attached to write session, the same for all messages in batch.
- * @type int $codec
- * Codec that is used for data compression.
- * See enum Codec above for values.
- * @type \Google\Protobuf\Timestamp $written_at
- * Persist timestamp on server for batch.
- * }
- */
- public function __construct($data = NULL) {
- \GPBMetadata\Protos\YdbTopic::initOnce();
- parent::__construct($data);
- }
- /**
- * List of client messages.
- *
- * Generated from protobuf field <code>repeated .Ydb.Topic.StreamReadMessage.ReadResponse.MessageData message_data = 1;</code>
- * @return \Google\Protobuf\Internal\RepeatedField
- */
- public function getMessageData()
- {
- return $this->message_data;
- }
- /**
- * List of client messages.
- *
- * Generated from protobuf field <code>repeated .Ydb.Topic.StreamReadMessage.ReadResponse.MessageData message_data = 1;</code>
- * @param array<\Ydb\Topic\StreamReadMessage\ReadResponse\MessageData>|\Google\Protobuf\Internal\RepeatedField $var
- * @return $this
- */
- public function setMessageData($var)
- {
- $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Ydb\Topic\StreamReadMessage\ReadResponse\MessageData::class);
- $this->message_data = $arr;
- return $this;
- }
- /**
- * Producer identifier provided by client for this batch of client messages.
- *
- * Generated from protobuf field <code>string producer_id = 2;</code>
- * @return string
- */
- public function getProducerId()
- {
- return $this->producer_id;
- }
- /**
- * Producer identifier provided by client for this batch of client messages.
- *
- * Generated from protobuf field <code>string producer_id = 2;</code>
- * @param string $var
- * @return $this
- */
- public function setProducerId($var)
- {
- GPBUtil::checkString($var, True);
- $this->producer_id = $var;
- return $this;
- }
- /**
- * Client metadata attached to write session, the same for all messages in batch.
- *
- * Generated from protobuf field <code>map<string, string> write_session_meta = 3;</code>
- * @return \Google\Protobuf\Internal\MapField
- */
- public function getWriteSessionMeta()
- {
- return $this->write_session_meta;
- }
- /**
- * Client metadata attached to write session, the same for all messages in batch.
- *
- * Generated from protobuf field <code>map<string, string> write_session_meta = 3;</code>
- * @param array|\Google\Protobuf\Internal\MapField $var
- * @return $this
- */
- public function setWriteSessionMeta($var)
- {
- $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
- $this->write_session_meta = $arr;
- return $this;
- }
- /**
- * Codec that is used for data compression.
- * See enum Codec above for values.
- *
- * Generated from protobuf field <code>int32 codec = 4;</code>
- * @return int
- */
- public function getCodec()
- {
- return $this->codec;
- }
- /**
- * Codec that is used for data compression.
- * See enum Codec above for values.
- *
- * Generated from protobuf field <code>int32 codec = 4;</code>
- * @param int $var
- * @return $this
- */
- public function setCodec($var)
- {
- GPBUtil::checkInt32($var);
- $this->codec = $var;
- return $this;
- }
- /**
- * Persist timestamp on server for batch.
- *
- * Generated from protobuf field <code>.google.protobuf.Timestamp written_at = 5;</code>
- * @return \Google\Protobuf\Timestamp|null
- */
- public function getWrittenAt()
- {
- return $this->written_at;
- }
- public function hasWrittenAt()
- {
- return isset($this->written_at);
- }
- public function clearWrittenAt()
- {
- unset($this->written_at);
- }
- /**
- * Persist timestamp on server for batch.
- *
- * Generated from protobuf field <code>.google.protobuf.Timestamp written_at = 5;</code>
- * @param \Google\Protobuf\Timestamp $var
- * @return $this
- */
- public function setWrittenAt($var)
- {
- GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
- $this->written_at = $var;
- return $this;
- }
- }
- // Adding a class alias for backwards compatibility with the previous class name.
- class_alias(Batch::class, \Ydb\Topic\StreamReadMessage_ReadResponse_Batch::class);
|