FromClient.php 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_topic.proto
  4. namespace Ydb\Topic\StreamReadMessage;
  5. use Google\Protobuf\Internal\GPBType;
  6. use Google\Protobuf\Internal\RepeatedField;
  7. use Google\Protobuf\Internal\GPBUtil;
  8. /**
  9. * Client-server message for read session. Contains one of:
  10. * InitRequest - handshake request.
  11. * ReadRequest - request for data.
  12. * CommitOffsetRequest - request for commit of some read data.
  13. * PartitionSessionStatusRequest - request for session status
  14. * UpdateTokenRequest - request to update auth token
  15. * StartPartitionSessionResponse - Response to StreamReadServerMessage.StartPartitionSessionRequest.
  16. * Client signals it is ready to get data from partition.
  17. * StopPartitionSessionResponse - Response to StreamReadServerMessage.StopPartitionSessionRequest.
  18. * Client signals it has finished working with partition. Mandatory for graceful stop, optional otherwise.
  19. *
  20. * Generated from protobuf message <code>Ydb.Topic.StreamReadMessage.FromClient</code>
  21. */
  22. class FromClient extends \Google\Protobuf\Internal\Message
  23. {
  24. protected $client_message;
  25. /**
  26. * Constructor.
  27. *
  28. * @param array $data {
  29. * Optional. Data for populating the Message object.
  30. *
  31. * @type \Ydb\Topic\StreamReadMessage\InitRequest $init_request
  32. * Client requests.
  33. * @type \Ydb\Topic\StreamReadMessage\ReadRequest $read_request
  34. * @type \Ydb\Topic\StreamReadMessage\CommitOffsetRequest $commit_offset_request
  35. * @type \Ydb\Topic\StreamReadMessage\PartitionSessionStatusRequest $partition_session_status_request
  36. * @type \Ydb\Topic\UpdateTokenRequest $update_token_request
  37. * @type \Ydb\Topic\StreamReadMessage\StartPartitionSessionResponse $start_partition_session_response
  38. * Responses to respective server commands.
  39. * @type \Ydb\Topic\StreamReadMessage\StopPartitionSessionResponse $stop_partition_session_response
  40. * }
  41. */
  42. public function __construct($data = NULL) {
  43. \GPBMetadata\Protos\YdbTopic::initOnce();
  44. parent::__construct($data);
  45. }
  46. /**
  47. * Client requests.
  48. *
  49. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.InitRequest init_request = 1;</code>
  50. * @return \Ydb\Topic\StreamReadMessage\InitRequest|null
  51. */
  52. public function getInitRequest()
  53. {
  54. return $this->readOneof(1);
  55. }
  56. public function hasInitRequest()
  57. {
  58. return $this->hasOneof(1);
  59. }
  60. /**
  61. * Client requests.
  62. *
  63. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.InitRequest init_request = 1;</code>
  64. * @param \Ydb\Topic\StreamReadMessage\InitRequest $var
  65. * @return $this
  66. */
  67. public function setInitRequest($var)
  68. {
  69. GPBUtil::checkMessage($var, \Ydb\Topic\StreamReadMessage\InitRequest::class);
  70. $this->writeOneof(1, $var);
  71. return $this;
  72. }
  73. /**
  74. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.ReadRequest read_request = 2;</code>
  75. * @return \Ydb\Topic\StreamReadMessage\ReadRequest|null
  76. */
  77. public function getReadRequest()
  78. {
  79. return $this->readOneof(2);
  80. }
  81. public function hasReadRequest()
  82. {
  83. return $this->hasOneof(2);
  84. }
  85. /**
  86. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.ReadRequest read_request = 2;</code>
  87. * @param \Ydb\Topic\StreamReadMessage\ReadRequest $var
  88. * @return $this
  89. */
  90. public function setReadRequest($var)
  91. {
  92. GPBUtil::checkMessage($var, \Ydb\Topic\StreamReadMessage\ReadRequest::class);
  93. $this->writeOneof(2, $var);
  94. return $this;
  95. }
  96. /**
  97. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.CommitOffsetRequest commit_offset_request = 3;</code>
  98. * @return \Ydb\Topic\StreamReadMessage\CommitOffsetRequest|null
  99. */
  100. public function getCommitOffsetRequest()
  101. {
  102. return $this->readOneof(3);
  103. }
  104. public function hasCommitOffsetRequest()
  105. {
  106. return $this->hasOneof(3);
  107. }
  108. /**
  109. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.CommitOffsetRequest commit_offset_request = 3;</code>
  110. * @param \Ydb\Topic\StreamReadMessage\CommitOffsetRequest $var
  111. * @return $this
  112. */
  113. public function setCommitOffsetRequest($var)
  114. {
  115. GPBUtil::checkMessage($var, \Ydb\Topic\StreamReadMessage\CommitOffsetRequest::class);
  116. $this->writeOneof(3, $var);
  117. return $this;
  118. }
  119. /**
  120. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.PartitionSessionStatusRequest partition_session_status_request = 4;</code>
  121. * @return \Ydb\Topic\StreamReadMessage\PartitionSessionStatusRequest|null
  122. */
  123. public function getPartitionSessionStatusRequest()
  124. {
  125. return $this->readOneof(4);
  126. }
  127. public function hasPartitionSessionStatusRequest()
  128. {
  129. return $this->hasOneof(4);
  130. }
  131. /**
  132. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.PartitionSessionStatusRequest partition_session_status_request = 4;</code>
  133. * @param \Ydb\Topic\StreamReadMessage\PartitionSessionStatusRequest $var
  134. * @return $this
  135. */
  136. public function setPartitionSessionStatusRequest($var)
  137. {
  138. GPBUtil::checkMessage($var, \Ydb\Topic\StreamReadMessage\PartitionSessionStatusRequest::class);
  139. $this->writeOneof(4, $var);
  140. return $this;
  141. }
  142. /**
  143. * Generated from protobuf field <code>.Ydb.Topic.UpdateTokenRequest update_token_request = 5;</code>
  144. * @return \Ydb\Topic\UpdateTokenRequest|null
  145. */
  146. public function getUpdateTokenRequest()
  147. {
  148. return $this->readOneof(5);
  149. }
  150. public function hasUpdateTokenRequest()
  151. {
  152. return $this->hasOneof(5);
  153. }
  154. /**
  155. * Generated from protobuf field <code>.Ydb.Topic.UpdateTokenRequest update_token_request = 5;</code>
  156. * @param \Ydb\Topic\UpdateTokenRequest $var
  157. * @return $this
  158. */
  159. public function setUpdateTokenRequest($var)
  160. {
  161. GPBUtil::checkMessage($var, \Ydb\Topic\UpdateTokenRequest::class);
  162. $this->writeOneof(5, $var);
  163. return $this;
  164. }
  165. /**
  166. * Responses to respective server commands.
  167. *
  168. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.StartPartitionSessionResponse start_partition_session_response = 6;</code>
  169. * @return \Ydb\Topic\StreamReadMessage\StartPartitionSessionResponse|null
  170. */
  171. public function getStartPartitionSessionResponse()
  172. {
  173. return $this->readOneof(6);
  174. }
  175. public function hasStartPartitionSessionResponse()
  176. {
  177. return $this->hasOneof(6);
  178. }
  179. /**
  180. * Responses to respective server commands.
  181. *
  182. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.StartPartitionSessionResponse start_partition_session_response = 6;</code>
  183. * @param \Ydb\Topic\StreamReadMessage\StartPartitionSessionResponse $var
  184. * @return $this
  185. */
  186. public function setStartPartitionSessionResponse($var)
  187. {
  188. GPBUtil::checkMessage($var, \Ydb\Topic\StreamReadMessage\StartPartitionSessionResponse::class);
  189. $this->writeOneof(6, $var);
  190. return $this;
  191. }
  192. /**
  193. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.StopPartitionSessionResponse stop_partition_session_response = 7;</code>
  194. * @return \Ydb\Topic\StreamReadMessage\StopPartitionSessionResponse|null
  195. */
  196. public function getStopPartitionSessionResponse()
  197. {
  198. return $this->readOneof(7);
  199. }
  200. public function hasStopPartitionSessionResponse()
  201. {
  202. return $this->hasOneof(7);
  203. }
  204. /**
  205. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.StopPartitionSessionResponse stop_partition_session_response = 7;</code>
  206. * @param \Ydb\Topic\StreamReadMessage\StopPartitionSessionResponse $var
  207. * @return $this
  208. */
  209. public function setStopPartitionSessionResponse($var)
  210. {
  211. GPBUtil::checkMessage($var, \Ydb\Topic\StreamReadMessage\StopPartitionSessionResponse::class);
  212. $this->writeOneof(7, $var);
  213. return $this;
  214. }
  215. /**
  216. * @return string
  217. */
  218. public function getClientMessage()
  219. {
  220. return $this->whichOneof("client_message");
  221. }
  222. }
  223. // Adding a class alias for backwards compatibility with the previous class name.
  224. class_alias(FromClient::class, \Ydb\Topic\StreamReadMessage_FromClient::class);