InitResponse.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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. * Response for handshake.
  10. *
  11. * Generated from protobuf message <code>Ydb.Topic.StreamWriteMessage.InitResponse</code>
  12. */
  13. class InitResponse extends \Google\Protobuf\Internal\Message
  14. {
  15. /**
  16. * Last persisted message's sequence number for this producer.
  17. * Zero for new producer.
  18. *
  19. * Generated from protobuf field <code>int64 last_seq_no = 1;</code>
  20. */
  21. protected $last_seq_no = 0;
  22. /**
  23. * Unique identifier of write session. Used for debug purposes.
  24. *
  25. * Generated from protobuf field <code>string session_id = 2;</code>
  26. */
  27. protected $session_id = '';
  28. /**
  29. * Identifier of partition that is matched for this write session.
  30. *
  31. * Generated from protobuf field <code>int64 partition_id = 3;</code>
  32. */
  33. protected $partition_id = 0;
  34. /**
  35. * Client can only use compression codecs from this set to write messages to topic.
  36. * Otherwise session will be closed with BAD_REQUEST.
  37. *
  38. * Generated from protobuf field <code>.Ydb.Topic.SupportedCodecs supported_codecs = 4;</code>
  39. */
  40. protected $supported_codecs = null;
  41. /**
  42. * Constructor.
  43. *
  44. * @param array $data {
  45. * Optional. Data for populating the Message object.
  46. *
  47. * @type int|string $last_seq_no
  48. * Last persisted message's sequence number for this producer.
  49. * Zero for new producer.
  50. * @type string $session_id
  51. * Unique identifier of write session. Used for debug purposes.
  52. * @type int|string $partition_id
  53. * Identifier of partition that is matched for this write session.
  54. * @type \Ydb\Topic\SupportedCodecs $supported_codecs
  55. * Client can only use compression codecs from this set to write messages to topic.
  56. * Otherwise session will be closed with BAD_REQUEST.
  57. * }
  58. */
  59. public function __construct($data = NULL) {
  60. \GPBMetadata\Protos\YdbTopic::initOnce();
  61. parent::__construct($data);
  62. }
  63. /**
  64. * Last persisted message's sequence number for this producer.
  65. * Zero for new producer.
  66. *
  67. * Generated from protobuf field <code>int64 last_seq_no = 1;</code>
  68. * @return int|string
  69. */
  70. public function getLastSeqNo()
  71. {
  72. return $this->last_seq_no;
  73. }
  74. /**
  75. * Last persisted message's sequence number for this producer.
  76. * Zero for new producer.
  77. *
  78. * Generated from protobuf field <code>int64 last_seq_no = 1;</code>
  79. * @param int|string $var
  80. * @return $this
  81. */
  82. public function setLastSeqNo($var)
  83. {
  84. GPBUtil::checkInt64($var);
  85. $this->last_seq_no = $var;
  86. return $this;
  87. }
  88. /**
  89. * Unique identifier of write session. Used for debug purposes.
  90. *
  91. * Generated from protobuf field <code>string session_id = 2;</code>
  92. * @return string
  93. */
  94. public function getSessionId()
  95. {
  96. return $this->session_id;
  97. }
  98. /**
  99. * Unique identifier of write session. Used for debug purposes.
  100. *
  101. * Generated from protobuf field <code>string session_id = 2;</code>
  102. * @param string $var
  103. * @return $this
  104. */
  105. public function setSessionId($var)
  106. {
  107. GPBUtil::checkString($var, True);
  108. $this->session_id = $var;
  109. return $this;
  110. }
  111. /**
  112. * Identifier of partition that is matched for this write session.
  113. *
  114. * Generated from protobuf field <code>int64 partition_id = 3;</code>
  115. * @return int|string
  116. */
  117. public function getPartitionId()
  118. {
  119. return $this->partition_id;
  120. }
  121. /**
  122. * Identifier of partition that is matched for this write session.
  123. *
  124. * Generated from protobuf field <code>int64 partition_id = 3;</code>
  125. * @param int|string $var
  126. * @return $this
  127. */
  128. public function setPartitionId($var)
  129. {
  130. GPBUtil::checkInt64($var);
  131. $this->partition_id = $var;
  132. return $this;
  133. }
  134. /**
  135. * Client can only use compression codecs from this set to write messages to topic.
  136. * Otherwise session will be closed with BAD_REQUEST.
  137. *
  138. * Generated from protobuf field <code>.Ydb.Topic.SupportedCodecs supported_codecs = 4;</code>
  139. * @return \Ydb\Topic\SupportedCodecs|null
  140. */
  141. public function getSupportedCodecs()
  142. {
  143. return $this->supported_codecs;
  144. }
  145. public function hasSupportedCodecs()
  146. {
  147. return isset($this->supported_codecs);
  148. }
  149. public function clearSupportedCodecs()
  150. {
  151. unset($this->supported_codecs);
  152. }
  153. /**
  154. * Client can only use compression codecs from this set to write messages to topic.
  155. * Otherwise session will be closed with BAD_REQUEST.
  156. *
  157. * Generated from protobuf field <code>.Ydb.Topic.SupportedCodecs supported_codecs = 4;</code>
  158. * @param \Ydb\Topic\SupportedCodecs $var
  159. * @return $this
  160. */
  161. public function setSupportedCodecs($var)
  162. {
  163. GPBUtil::checkMessage($var, \Ydb\Topic\SupportedCodecs::class);
  164. $this->supported_codecs = $var;
  165. return $this;
  166. }
  167. }
  168. // Adding a class alias for backwards compatibility with the previous class name.
  169. class_alias(InitResponse::class, \Ydb\Topic\StreamWriteMessage_InitResponse::class);