MessageData.php 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  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. * One client message representation.
  10. *
  11. * Generated from protobuf message <code>Ydb.Topic.StreamReadMessage.ReadResponse.MessageData</code>
  12. */
  13. class MessageData extends \Google\Protobuf\Internal\Message
  14. {
  15. /**
  16. * Partition offset in partition that assigned for message.
  17. *
  18. * Generated from protobuf field <code>int64 offset = 1;</code>
  19. */
  20. protected $offset = 0;
  21. /**
  22. * Sequence number that provided with message on write from client.
  23. *
  24. * Generated from protobuf field <code>int64 seq_no = 2;</code>
  25. */
  26. protected $seq_no = 0;
  27. /**
  28. * Timestamp of creation of message provided on write from client.
  29. *
  30. * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 3;</code>
  31. */
  32. protected $created_at = null;
  33. /**
  34. * Compressed client message body.
  35. *
  36. * Generated from protobuf field <code>bytes data = 5;</code>
  37. */
  38. protected $data = '';
  39. /**
  40. * Uncompressed size of client message body.
  41. * sent as is from WriteRequest, without check on server side. May be empty (for writes from old client) or wrong (if bug in writer).
  42. * Use it for optimization purposes only, don't trust it.
  43. *
  44. * Generated from protobuf field <code>int64 uncompressed_size = 6;</code>
  45. */
  46. protected $uncompressed_size = 0;
  47. /**
  48. * Filled if message_group_id was set on message write.
  49. *
  50. * Generated from protobuf field <code>string message_group_id = 7;</code>
  51. */
  52. protected $message_group_id = '';
  53. /**
  54. * Constructor.
  55. *
  56. * @param array $data {
  57. * Optional. Data for populating the Message object.
  58. *
  59. * @type int|string $offset
  60. * Partition offset in partition that assigned for message.
  61. * @type int|string $seq_no
  62. * Sequence number that provided with message on write from client.
  63. * @type \Google\Protobuf\Timestamp $created_at
  64. * Timestamp of creation of message provided on write from client.
  65. * @type string $data
  66. * Compressed client message body.
  67. * @type int|string $uncompressed_size
  68. * Uncompressed size of client message body.
  69. * sent as is from WriteRequest, without check on server side. May be empty (for writes from old client) or wrong (if bug in writer).
  70. * Use it for optimization purposes only, don't trust it.
  71. * @type string $message_group_id
  72. * Filled if message_group_id was set on message write.
  73. * }
  74. */
  75. public function __construct($data = NULL) {
  76. \GPBMetadata\Protos\YdbTopic::initOnce();
  77. parent::__construct($data);
  78. }
  79. /**
  80. * Partition offset in partition that assigned for message.
  81. *
  82. * Generated from protobuf field <code>int64 offset = 1;</code>
  83. * @return int|string
  84. */
  85. public function getOffset()
  86. {
  87. return $this->offset;
  88. }
  89. /**
  90. * Partition offset in partition that assigned for message.
  91. *
  92. * Generated from protobuf field <code>int64 offset = 1;</code>
  93. * @param int|string $var
  94. * @return $this
  95. */
  96. public function setOffset($var)
  97. {
  98. GPBUtil::checkInt64($var);
  99. $this->offset = $var;
  100. return $this;
  101. }
  102. /**
  103. * Sequence number that provided with message on write from client.
  104. *
  105. * Generated from protobuf field <code>int64 seq_no = 2;</code>
  106. * @return int|string
  107. */
  108. public function getSeqNo()
  109. {
  110. return $this->seq_no;
  111. }
  112. /**
  113. * Sequence number that provided with message on write from client.
  114. *
  115. * Generated from protobuf field <code>int64 seq_no = 2;</code>
  116. * @param int|string $var
  117. * @return $this
  118. */
  119. public function setSeqNo($var)
  120. {
  121. GPBUtil::checkInt64($var);
  122. $this->seq_no = $var;
  123. return $this;
  124. }
  125. /**
  126. * Timestamp of creation of message provided on write from client.
  127. *
  128. * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 3;</code>
  129. * @return \Google\Protobuf\Timestamp|null
  130. */
  131. public function getCreatedAt()
  132. {
  133. return $this->created_at;
  134. }
  135. public function hasCreatedAt()
  136. {
  137. return isset($this->created_at);
  138. }
  139. public function clearCreatedAt()
  140. {
  141. unset($this->created_at);
  142. }
  143. /**
  144. * Timestamp of creation of message provided on write from client.
  145. *
  146. * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 3;</code>
  147. * @param \Google\Protobuf\Timestamp $var
  148. * @return $this
  149. */
  150. public function setCreatedAt($var)
  151. {
  152. GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
  153. $this->created_at = $var;
  154. return $this;
  155. }
  156. /**
  157. * Compressed client message body.
  158. *
  159. * Generated from protobuf field <code>bytes data = 5;</code>
  160. * @return string
  161. */
  162. public function getData()
  163. {
  164. return $this->data;
  165. }
  166. /**
  167. * Compressed client message body.
  168. *
  169. * Generated from protobuf field <code>bytes data = 5;</code>
  170. * @param string $var
  171. * @return $this
  172. */
  173. public function setData($var)
  174. {
  175. GPBUtil::checkString($var, False);
  176. $this->data = $var;
  177. return $this;
  178. }
  179. /**
  180. * Uncompressed size of client message body.
  181. * sent as is from WriteRequest, without check on server side. May be empty (for writes from old client) or wrong (if bug in writer).
  182. * Use it for optimization purposes only, don't trust it.
  183. *
  184. * Generated from protobuf field <code>int64 uncompressed_size = 6;</code>
  185. * @return int|string
  186. */
  187. public function getUncompressedSize()
  188. {
  189. return $this->uncompressed_size;
  190. }
  191. /**
  192. * Uncompressed size of client message body.
  193. * sent as is from WriteRequest, without check on server side. May be empty (for writes from old client) or wrong (if bug in writer).
  194. * Use it for optimization purposes only, don't trust it.
  195. *
  196. * Generated from protobuf field <code>int64 uncompressed_size = 6;</code>
  197. * @param int|string $var
  198. * @return $this
  199. */
  200. public function setUncompressedSize($var)
  201. {
  202. GPBUtil::checkInt64($var);
  203. $this->uncompressed_size = $var;
  204. return $this;
  205. }
  206. /**
  207. * Filled if message_group_id was set on message write.
  208. *
  209. * Generated from protobuf field <code>string message_group_id = 7;</code>
  210. * @return string
  211. */
  212. public function getMessageGroupId()
  213. {
  214. return $this->message_group_id;
  215. }
  216. /**
  217. * Filled if message_group_id was set on message write.
  218. *
  219. * Generated from protobuf field <code>string message_group_id = 7;</code>
  220. * @param string $var
  221. * @return $this
  222. */
  223. public function setMessageGroupId($var)
  224. {
  225. GPBUtil::checkString($var, True);
  226. $this->message_group_id = $var;
  227. return $this;
  228. }
  229. }
  230. // Adding a class alias for backwards compatibility with the previous class name.
  231. class_alias(MessageData::class, \Ydb\Topic\StreamReadMessage_ReadResponse_MessageData::class);