MessageData.php 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_topic.proto
  4. namespace Ydb\Topic\StreamWriteMessage\WriteRequest;
  5. use Google\Protobuf\Internal\GPBType;
  6. use Google\Protobuf\Internal\RepeatedField;
  7. use Google\Protobuf\Internal\GPBUtil;
  8. /**
  9. * Generated from protobuf message <code>Ydb.Topic.StreamWriteMessage.WriteRequest.MessageData</code>
  10. */
  11. class MessageData extends \Google\Protobuf\Internal\Message
  12. {
  13. /**
  14. * Message sequence number, provided by client for deduplication.
  15. * Starts at 1
  16. *
  17. * Generated from protobuf field <code>int64 seq_no = 1;</code>
  18. */
  19. protected $seq_no = 0;
  20. /**
  21. * Creation timestamp
  22. *
  23. * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 2;</code>
  24. */
  25. protected $created_at = null;
  26. /**
  27. * Compressed client message body.
  28. *
  29. * Generated from protobuf field <code>bytes data = 3;</code>
  30. */
  31. protected $data = '';
  32. /**
  33. * Uncompressed size of client message body.
  34. *
  35. * Generated from protobuf field <code>int64 uncompressed_size = 4;</code>
  36. */
  37. protected $uncompressed_size = 0;
  38. protected $partitioning;
  39. /**
  40. * Constructor.
  41. *
  42. * @param array $data {
  43. * Optional. Data for populating the Message object.
  44. *
  45. * @type int|string $seq_no
  46. * Message sequence number, provided by client for deduplication.
  47. * Starts at 1
  48. * @type \Google\Protobuf\Timestamp $created_at
  49. * Creation timestamp
  50. * @type string $data
  51. * Compressed client message body.
  52. * @type int|string $uncompressed_size
  53. * Uncompressed size of client message body.
  54. * @type string $message_group_id
  55. * All messages with given pair (producer_id, message_group_id) go to single partition in order of writes.
  56. * @type int|string $partition_id
  57. * Explicit partition id to write to.
  58. * }
  59. */
  60. public function __construct($data = NULL) {
  61. \GPBMetadata\Protos\YdbTopic::initOnce();
  62. parent::__construct($data);
  63. }
  64. /**
  65. * Message sequence number, provided by client for deduplication.
  66. * Starts at 1
  67. *
  68. * Generated from protobuf field <code>int64 seq_no = 1;</code>
  69. * @return int|string
  70. */
  71. public function getSeqNo()
  72. {
  73. return $this->seq_no;
  74. }
  75. /**
  76. * Message sequence number, provided by client for deduplication.
  77. * Starts at 1
  78. *
  79. * Generated from protobuf field <code>int64 seq_no = 1;</code>
  80. * @param int|string $var
  81. * @return $this
  82. */
  83. public function setSeqNo($var)
  84. {
  85. GPBUtil::checkInt64($var);
  86. $this->seq_no = $var;
  87. return $this;
  88. }
  89. /**
  90. * Creation timestamp
  91. *
  92. * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 2;</code>
  93. * @return \Google\Protobuf\Timestamp|null
  94. */
  95. public function getCreatedAt()
  96. {
  97. return $this->created_at;
  98. }
  99. public function hasCreatedAt()
  100. {
  101. return isset($this->created_at);
  102. }
  103. public function clearCreatedAt()
  104. {
  105. unset($this->created_at);
  106. }
  107. /**
  108. * Creation timestamp
  109. *
  110. * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 2;</code>
  111. * @param \Google\Protobuf\Timestamp $var
  112. * @return $this
  113. */
  114. public function setCreatedAt($var)
  115. {
  116. GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
  117. $this->created_at = $var;
  118. return $this;
  119. }
  120. /**
  121. * Compressed client message body.
  122. *
  123. * Generated from protobuf field <code>bytes data = 3;</code>
  124. * @return string
  125. */
  126. public function getData()
  127. {
  128. return $this->data;
  129. }
  130. /**
  131. * Compressed client message body.
  132. *
  133. * Generated from protobuf field <code>bytes data = 3;</code>
  134. * @param string $var
  135. * @return $this
  136. */
  137. public function setData($var)
  138. {
  139. GPBUtil::checkString($var, False);
  140. $this->data = $var;
  141. return $this;
  142. }
  143. /**
  144. * Uncompressed size of client message body.
  145. *
  146. * Generated from protobuf field <code>int64 uncompressed_size = 4;</code>
  147. * @return int|string
  148. */
  149. public function getUncompressedSize()
  150. {
  151. return $this->uncompressed_size;
  152. }
  153. /**
  154. * Uncompressed size of client message body.
  155. *
  156. * Generated from protobuf field <code>int64 uncompressed_size = 4;</code>
  157. * @param int|string $var
  158. * @return $this
  159. */
  160. public function setUncompressedSize($var)
  161. {
  162. GPBUtil::checkInt64($var);
  163. $this->uncompressed_size = $var;
  164. return $this;
  165. }
  166. /**
  167. * All messages with given pair (producer_id, message_group_id) go to single partition in order of writes.
  168. *
  169. * Generated from protobuf field <code>string message_group_id = 5;</code>
  170. * @return string
  171. */
  172. public function getMessageGroupId()
  173. {
  174. return $this->readOneof(5);
  175. }
  176. public function hasMessageGroupId()
  177. {
  178. return $this->hasOneof(5);
  179. }
  180. /**
  181. * All messages with given pair (producer_id, message_group_id) go to single partition in order of writes.
  182. *
  183. * Generated from protobuf field <code>string message_group_id = 5;</code>
  184. * @param string $var
  185. * @return $this
  186. */
  187. public function setMessageGroupId($var)
  188. {
  189. GPBUtil::checkString($var, True);
  190. $this->writeOneof(5, $var);
  191. return $this;
  192. }
  193. /**
  194. * Explicit partition id to write to.
  195. *
  196. * Generated from protobuf field <code>int64 partition_id = 6;</code>
  197. * @return int|string
  198. */
  199. public function getPartitionId()
  200. {
  201. return $this->readOneof(6);
  202. }
  203. public function hasPartitionId()
  204. {
  205. return $this->hasOneof(6);
  206. }
  207. /**
  208. * Explicit partition id to write to.
  209. *
  210. * Generated from protobuf field <code>int64 partition_id = 6;</code>
  211. * @param int|string $var
  212. * @return $this
  213. */
  214. public function setPartitionId($var)
  215. {
  216. GPBUtil::checkInt64($var);
  217. $this->writeOneof(6, $var);
  218. return $this;
  219. }
  220. /**
  221. * @return string
  222. */
  223. public function getPartitioning()
  224. {
  225. return $this->whichOneof("partitioning");
  226. }
  227. }
  228. // Adding a class alias for backwards compatibility with the previous class name.
  229. class_alias(MessageData::class, \Ydb\Topic\StreamWriteMessage_WriteRequest_MessageData::class);