WriteResponse.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_topic.proto
  4. namespace Ydb\Topic\StreamWriteMessage;
  5. use Google\Protobuf\Internal\GPBType;
  6. use Google\Protobuf\Internal\RepeatedField;
  7. use Google\Protobuf\Internal\GPBUtil;
  8. /**
  9. * Message that represents acknowledgment for sequence of client messages.
  10. * This sequence is persisted together so write statistics is for messages batch.
  11. *
  12. * Generated from protobuf message <code>Ydb.Topic.StreamWriteMessage.WriteResponse</code>
  13. */
  14. class WriteResponse extends \Google\Protobuf\Internal\Message
  15. {
  16. /**
  17. * Number of acks is equal to number of messages in the corresponding WriteRequests.
  18. *
  19. * Generated from protobuf field <code>repeated .Ydb.Topic.StreamWriteMessage.WriteResponse.WriteAck acks = 1;</code>
  20. */
  21. private $acks;
  22. /**
  23. * Assigned partition for all client messages inside this batch.
  24. * This actual partition may differ from that returned in InitResponse
  25. * or other WriteResponses in this write session.
  26. *
  27. * Generated from protobuf field <code>int64 partition_id = 2;</code>
  28. */
  29. protected $partition_id = 0;
  30. /**
  31. * Write statistics for this sequence of client messages.
  32. *
  33. * Generated from protobuf field <code>.Ydb.Topic.StreamWriteMessage.WriteResponse.WriteStatistics write_statistics = 3;</code>
  34. */
  35. protected $write_statistics = null;
  36. /**
  37. * Constructor.
  38. *
  39. * @param array $data {
  40. * Optional. Data for populating the Message object.
  41. *
  42. * @type array<\Ydb\Topic\StreamWriteMessage\WriteResponse\WriteAck>|\Google\Protobuf\Internal\RepeatedField $acks
  43. * Number of acks is equal to number of messages in the corresponding WriteRequests.
  44. * @type int|string $partition_id
  45. * Assigned partition for all client messages inside this batch.
  46. * This actual partition may differ from that returned in InitResponse
  47. * or other WriteResponses in this write session.
  48. * @type \Ydb\Topic\StreamWriteMessage\WriteResponse\WriteStatistics $write_statistics
  49. * Write statistics for this sequence of client messages.
  50. * }
  51. */
  52. public function __construct($data = NULL) {
  53. \GPBMetadata\Protos\YdbTopic::initOnce();
  54. parent::__construct($data);
  55. }
  56. /**
  57. * Number of acks is equal to number of messages in the corresponding WriteRequests.
  58. *
  59. * Generated from protobuf field <code>repeated .Ydb.Topic.StreamWriteMessage.WriteResponse.WriteAck acks = 1;</code>
  60. * @return \Google\Protobuf\Internal\RepeatedField
  61. */
  62. public function getAcks()
  63. {
  64. return $this->acks;
  65. }
  66. /**
  67. * Number of acks is equal to number of messages in the corresponding WriteRequests.
  68. *
  69. * Generated from protobuf field <code>repeated .Ydb.Topic.StreamWriteMessage.WriteResponse.WriteAck acks = 1;</code>
  70. * @param array<\Ydb\Topic\StreamWriteMessage\WriteResponse\WriteAck>|\Google\Protobuf\Internal\RepeatedField $var
  71. * @return $this
  72. */
  73. public function setAcks($var)
  74. {
  75. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Ydb\Topic\StreamWriteMessage\WriteResponse\WriteAck::class);
  76. $this->acks = $arr;
  77. return $this;
  78. }
  79. /**
  80. * Assigned partition for all client messages inside this batch.
  81. * This actual partition may differ from that returned in InitResponse
  82. * or other WriteResponses in this write session.
  83. *
  84. * Generated from protobuf field <code>int64 partition_id = 2;</code>
  85. * @return int|string
  86. */
  87. public function getPartitionId()
  88. {
  89. return $this->partition_id;
  90. }
  91. /**
  92. * Assigned partition for all client messages inside this batch.
  93. * This actual partition may differ from that returned in InitResponse
  94. * or other WriteResponses in this write session.
  95. *
  96. * Generated from protobuf field <code>int64 partition_id = 2;</code>
  97. * @param int|string $var
  98. * @return $this
  99. */
  100. public function setPartitionId($var)
  101. {
  102. GPBUtil::checkInt64($var);
  103. $this->partition_id = $var;
  104. return $this;
  105. }
  106. /**
  107. * Write statistics for this sequence of client messages.
  108. *
  109. * Generated from protobuf field <code>.Ydb.Topic.StreamWriteMessage.WriteResponse.WriteStatistics write_statistics = 3;</code>
  110. * @return \Ydb\Topic\StreamWriteMessage\WriteResponse\WriteStatistics|null
  111. */
  112. public function getWriteStatistics()
  113. {
  114. return $this->write_statistics;
  115. }
  116. public function hasWriteStatistics()
  117. {
  118. return isset($this->write_statistics);
  119. }
  120. public function clearWriteStatistics()
  121. {
  122. unset($this->write_statistics);
  123. }
  124. /**
  125. * Write statistics for this sequence of client messages.
  126. *
  127. * Generated from protobuf field <code>.Ydb.Topic.StreamWriteMessage.WriteResponse.WriteStatistics write_statistics = 3;</code>
  128. * @param \Ydb\Topic\StreamWriteMessage\WriteResponse\WriteStatistics $var
  129. * @return $this
  130. */
  131. public function setWriteStatistics($var)
  132. {
  133. GPBUtil::checkMessage($var, \Ydb\Topic\StreamWriteMessage\WriteResponse\WriteStatistics::class);
  134. $this->write_statistics = $var;
  135. return $this;
  136. }
  137. }
  138. // Adding a class alias for backwards compatibility with the previous class name.
  139. class_alias(WriteResponse::class, \Ydb\Topic\StreamWriteMessage_WriteResponse::class);