Batch.php 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_topic.proto
  4. namespace Ydb\Topic\StreamReadMessage\ReadResponse;
  5. use Google\Protobuf\Internal\GPBType;
  6. use Google\Protobuf\Internal\RepeatedField;
  7. use Google\Protobuf\Internal\GPBUtil;
  8. /**
  9. * Representation of sequence of client messages from one write session.
  10. *
  11. * Generated from protobuf message <code>Ydb.Topic.StreamReadMessage.ReadResponse.Batch</code>
  12. */
  13. class Batch extends \Google\Protobuf\Internal\Message
  14. {
  15. /**
  16. * List of client messages.
  17. *
  18. * Generated from protobuf field <code>repeated .Ydb.Topic.StreamReadMessage.ReadResponse.MessageData message_data = 1;</code>
  19. */
  20. private $message_data;
  21. /**
  22. * Producer identifier provided by client for this batch of client messages.
  23. *
  24. * Generated from protobuf field <code>string producer_id = 2;</code>
  25. */
  26. protected $producer_id = '';
  27. /**
  28. * Client metadata attached to write session, the same for all messages in batch.
  29. *
  30. * Generated from protobuf field <code>map<string, string> write_session_meta = 3;</code>
  31. */
  32. private $write_session_meta;
  33. /**
  34. * Codec that is used for data compression.
  35. * See enum Codec above for values.
  36. *
  37. * Generated from protobuf field <code>int32 codec = 4;</code>
  38. */
  39. protected $codec = 0;
  40. /**
  41. * Persist timestamp on server for batch.
  42. *
  43. * Generated from protobuf field <code>.google.protobuf.Timestamp written_at = 5;</code>
  44. */
  45. protected $written_at = null;
  46. /**
  47. * Constructor.
  48. *
  49. * @param array $data {
  50. * Optional. Data for populating the Message object.
  51. *
  52. * @type array<\Ydb\Topic\StreamReadMessage\ReadResponse\MessageData>|\Google\Protobuf\Internal\RepeatedField $message_data
  53. * List of client messages.
  54. * @type string $producer_id
  55. * Producer identifier provided by client for this batch of client messages.
  56. * @type array|\Google\Protobuf\Internal\MapField $write_session_meta
  57. * Client metadata attached to write session, the same for all messages in batch.
  58. * @type int $codec
  59. * Codec that is used for data compression.
  60. * See enum Codec above for values.
  61. * @type \Google\Protobuf\Timestamp $written_at
  62. * Persist timestamp on server for batch.
  63. * }
  64. */
  65. public function __construct($data = NULL) {
  66. \GPBMetadata\Protos\YdbTopic::initOnce();
  67. parent::__construct($data);
  68. }
  69. /**
  70. * List of client messages.
  71. *
  72. * Generated from protobuf field <code>repeated .Ydb.Topic.StreamReadMessage.ReadResponse.MessageData message_data = 1;</code>
  73. * @return \Google\Protobuf\Internal\RepeatedField
  74. */
  75. public function getMessageData()
  76. {
  77. return $this->message_data;
  78. }
  79. /**
  80. * List of client messages.
  81. *
  82. * Generated from protobuf field <code>repeated .Ydb.Topic.StreamReadMessage.ReadResponse.MessageData message_data = 1;</code>
  83. * @param array<\Ydb\Topic\StreamReadMessage\ReadResponse\MessageData>|\Google\Protobuf\Internal\RepeatedField $var
  84. * @return $this
  85. */
  86. public function setMessageData($var)
  87. {
  88. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Ydb\Topic\StreamReadMessage\ReadResponse\MessageData::class);
  89. $this->message_data = $arr;
  90. return $this;
  91. }
  92. /**
  93. * Producer identifier provided by client for this batch of client messages.
  94. *
  95. * Generated from protobuf field <code>string producer_id = 2;</code>
  96. * @return string
  97. */
  98. public function getProducerId()
  99. {
  100. return $this->producer_id;
  101. }
  102. /**
  103. * Producer identifier provided by client for this batch of client messages.
  104. *
  105. * Generated from protobuf field <code>string producer_id = 2;</code>
  106. * @param string $var
  107. * @return $this
  108. */
  109. public function setProducerId($var)
  110. {
  111. GPBUtil::checkString($var, True);
  112. $this->producer_id = $var;
  113. return $this;
  114. }
  115. /**
  116. * Client metadata attached to write session, the same for all messages in batch.
  117. *
  118. * Generated from protobuf field <code>map<string, string> write_session_meta = 3;</code>
  119. * @return \Google\Protobuf\Internal\MapField
  120. */
  121. public function getWriteSessionMeta()
  122. {
  123. return $this->write_session_meta;
  124. }
  125. /**
  126. * Client metadata attached to write session, the same for all messages in batch.
  127. *
  128. * Generated from protobuf field <code>map<string, string> write_session_meta = 3;</code>
  129. * @param array|\Google\Protobuf\Internal\MapField $var
  130. * @return $this
  131. */
  132. public function setWriteSessionMeta($var)
  133. {
  134. $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
  135. $this->write_session_meta = $arr;
  136. return $this;
  137. }
  138. /**
  139. * Codec that is used for data compression.
  140. * See enum Codec above for values.
  141. *
  142. * Generated from protobuf field <code>int32 codec = 4;</code>
  143. * @return int
  144. */
  145. public function getCodec()
  146. {
  147. return $this->codec;
  148. }
  149. /**
  150. * Codec that is used for data compression.
  151. * See enum Codec above for values.
  152. *
  153. * Generated from protobuf field <code>int32 codec = 4;</code>
  154. * @param int $var
  155. * @return $this
  156. */
  157. public function setCodec($var)
  158. {
  159. GPBUtil::checkInt32($var);
  160. $this->codec = $var;
  161. return $this;
  162. }
  163. /**
  164. * Persist timestamp on server for batch.
  165. *
  166. * Generated from protobuf field <code>.google.protobuf.Timestamp written_at = 5;</code>
  167. * @return \Google\Protobuf\Timestamp|null
  168. */
  169. public function getWrittenAt()
  170. {
  171. return $this->written_at;
  172. }
  173. public function hasWrittenAt()
  174. {
  175. return isset($this->written_at);
  176. }
  177. public function clearWrittenAt()
  178. {
  179. unset($this->written_at);
  180. }
  181. /**
  182. * Persist timestamp on server for batch.
  183. *
  184. * Generated from protobuf field <code>.google.protobuf.Timestamp written_at = 5;</code>
  185. * @param \Google\Protobuf\Timestamp $var
  186. * @return $this
  187. */
  188. public function setWrittenAt($var)
  189. {
  190. GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
  191. $this->written_at = $var;
  192. return $this;
  193. }
  194. }
  195. // Adding a class alias for backwards compatibility with the previous class name.
  196. class_alias(Batch::class, \Ydb\Topic\StreamReadMessage_ReadResponse_Batch::class);