FromServer.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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. * Server-client message for read session. Contains one of:
  10. * InitResponse - handshake response from server.
  11. * ReadResponse - portion of data.
  12. * CommitOffsetResponse - acknowledgment for commit.
  13. * PartitionSessionStatusResponse - server response with partition session status.
  14. * UpdateTokenResponse - acknowledgment of token update.
  15. * StartPartitionSessionRequest - command from server to create a partition session.
  16. * StopPartitionSessionRequest - command from server to destroy a partition session.
  17. *
  18. * Generated from protobuf message <code>Ydb.Topic.StreamReadMessage.FromServer</code>
  19. */
  20. class FromServer extends \Google\Protobuf\Internal\Message
  21. {
  22. /**
  23. * Server status of response.
  24. *
  25. * Generated from protobuf field <code>.Ydb.StatusIds.StatusCode status = 1;</code>
  26. */
  27. protected $status = 0;
  28. /**
  29. * Issues if any.
  30. *
  31. * Generated from protobuf field <code>repeated .Ydb.Issue.IssueMessage issues = 2;</code>
  32. */
  33. private $issues;
  34. protected $server_message;
  35. /**
  36. * Constructor.
  37. *
  38. * @param array $data {
  39. * Optional. Data for populating the Message object.
  40. *
  41. * @type int $status
  42. * Server status of response.
  43. * @type array<\Ydb\Issue\IssueMessage>|\Google\Protobuf\Internal\RepeatedField $issues
  44. * Issues if any.
  45. * @type \Ydb\Topic\StreamReadMessage\InitResponse $init_response
  46. * Responses to respective client requests.
  47. * @type \Ydb\Topic\StreamReadMessage\ReadResponse $read_response
  48. * @type \Ydb\Topic\StreamReadMessage\CommitOffsetResponse $commit_offset_response
  49. * @type \Ydb\Topic\StreamReadMessage\PartitionSessionStatusResponse $partition_session_status_response
  50. * @type \Ydb\Topic\UpdateTokenResponse $update_token_response
  51. * @type \Ydb\Topic\StreamReadMessage\StartPartitionSessionRequest $start_partition_session_request
  52. * Server commands.
  53. * @type \Ydb\Topic\StreamReadMessage\StopPartitionSessionRequest $stop_partition_session_request
  54. * }
  55. */
  56. public function __construct($data = NULL) {
  57. \GPBMetadata\Protos\YdbTopic::initOnce();
  58. parent::__construct($data);
  59. }
  60. /**
  61. * Server status of response.
  62. *
  63. * Generated from protobuf field <code>.Ydb.StatusIds.StatusCode status = 1;</code>
  64. * @return int
  65. */
  66. public function getStatus()
  67. {
  68. return $this->status;
  69. }
  70. /**
  71. * Server status of response.
  72. *
  73. * Generated from protobuf field <code>.Ydb.StatusIds.StatusCode status = 1;</code>
  74. * @param int $var
  75. * @return $this
  76. */
  77. public function setStatus($var)
  78. {
  79. GPBUtil::checkEnum($var, \Ydb\StatusIds\StatusCode::class);
  80. $this->status = $var;
  81. return $this;
  82. }
  83. /**
  84. * Issues if any.
  85. *
  86. * Generated from protobuf field <code>repeated .Ydb.Issue.IssueMessage issues = 2;</code>
  87. * @return \Google\Protobuf\Internal\RepeatedField
  88. */
  89. public function getIssues()
  90. {
  91. return $this->issues;
  92. }
  93. /**
  94. * Issues if any.
  95. *
  96. * Generated from protobuf field <code>repeated .Ydb.Issue.IssueMessage issues = 2;</code>
  97. * @param array<\Ydb\Issue\IssueMessage>|\Google\Protobuf\Internal\RepeatedField $var
  98. * @return $this
  99. */
  100. public function setIssues($var)
  101. {
  102. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Ydb\Issue\IssueMessage::class);
  103. $this->issues = $arr;
  104. return $this;
  105. }
  106. /**
  107. * Responses to respective client requests.
  108. *
  109. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.InitResponse init_response = 3;</code>
  110. * @return \Ydb\Topic\StreamReadMessage\InitResponse|null
  111. */
  112. public function getInitResponse()
  113. {
  114. return $this->readOneof(3);
  115. }
  116. public function hasInitResponse()
  117. {
  118. return $this->hasOneof(3);
  119. }
  120. /**
  121. * Responses to respective client requests.
  122. *
  123. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.InitResponse init_response = 3;</code>
  124. * @param \Ydb\Topic\StreamReadMessage\InitResponse $var
  125. * @return $this
  126. */
  127. public function setInitResponse($var)
  128. {
  129. GPBUtil::checkMessage($var, \Ydb\Topic\StreamReadMessage\InitResponse::class);
  130. $this->writeOneof(3, $var);
  131. return $this;
  132. }
  133. /**
  134. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.ReadResponse read_response = 4;</code>
  135. * @return \Ydb\Topic\StreamReadMessage\ReadResponse|null
  136. */
  137. public function getReadResponse()
  138. {
  139. return $this->readOneof(4);
  140. }
  141. public function hasReadResponse()
  142. {
  143. return $this->hasOneof(4);
  144. }
  145. /**
  146. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.ReadResponse read_response = 4;</code>
  147. * @param \Ydb\Topic\StreamReadMessage\ReadResponse $var
  148. * @return $this
  149. */
  150. public function setReadResponse($var)
  151. {
  152. GPBUtil::checkMessage($var, \Ydb\Topic\StreamReadMessage\ReadResponse::class);
  153. $this->writeOneof(4, $var);
  154. return $this;
  155. }
  156. /**
  157. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.CommitOffsetResponse commit_offset_response = 5;</code>
  158. * @return \Ydb\Topic\StreamReadMessage\CommitOffsetResponse|null
  159. */
  160. public function getCommitOffsetResponse()
  161. {
  162. return $this->readOneof(5);
  163. }
  164. public function hasCommitOffsetResponse()
  165. {
  166. return $this->hasOneof(5);
  167. }
  168. /**
  169. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.CommitOffsetResponse commit_offset_response = 5;</code>
  170. * @param \Ydb\Topic\StreamReadMessage\CommitOffsetResponse $var
  171. * @return $this
  172. */
  173. public function setCommitOffsetResponse($var)
  174. {
  175. GPBUtil::checkMessage($var, \Ydb\Topic\StreamReadMessage\CommitOffsetResponse::class);
  176. $this->writeOneof(5, $var);
  177. return $this;
  178. }
  179. /**
  180. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.PartitionSessionStatusResponse partition_session_status_response = 6;</code>
  181. * @return \Ydb\Topic\StreamReadMessage\PartitionSessionStatusResponse|null
  182. */
  183. public function getPartitionSessionStatusResponse()
  184. {
  185. return $this->readOneof(6);
  186. }
  187. public function hasPartitionSessionStatusResponse()
  188. {
  189. return $this->hasOneof(6);
  190. }
  191. /**
  192. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.PartitionSessionStatusResponse partition_session_status_response = 6;</code>
  193. * @param \Ydb\Topic\StreamReadMessage\PartitionSessionStatusResponse $var
  194. * @return $this
  195. */
  196. public function setPartitionSessionStatusResponse($var)
  197. {
  198. GPBUtil::checkMessage($var, \Ydb\Topic\StreamReadMessage\PartitionSessionStatusResponse::class);
  199. $this->writeOneof(6, $var);
  200. return $this;
  201. }
  202. /**
  203. * Generated from protobuf field <code>.Ydb.Topic.UpdateTokenResponse update_token_response = 7;</code>
  204. * @return \Ydb\Topic\UpdateTokenResponse|null
  205. */
  206. public function getUpdateTokenResponse()
  207. {
  208. return $this->readOneof(7);
  209. }
  210. public function hasUpdateTokenResponse()
  211. {
  212. return $this->hasOneof(7);
  213. }
  214. /**
  215. * Generated from protobuf field <code>.Ydb.Topic.UpdateTokenResponse update_token_response = 7;</code>
  216. * @param \Ydb\Topic\UpdateTokenResponse $var
  217. * @return $this
  218. */
  219. public function setUpdateTokenResponse($var)
  220. {
  221. GPBUtil::checkMessage($var, \Ydb\Topic\UpdateTokenResponse::class);
  222. $this->writeOneof(7, $var);
  223. return $this;
  224. }
  225. /**
  226. * Server commands.
  227. *
  228. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.StartPartitionSessionRequest start_partition_session_request = 8;</code>
  229. * @return \Ydb\Topic\StreamReadMessage\StartPartitionSessionRequest|null
  230. */
  231. public function getStartPartitionSessionRequest()
  232. {
  233. return $this->readOneof(8);
  234. }
  235. public function hasStartPartitionSessionRequest()
  236. {
  237. return $this->hasOneof(8);
  238. }
  239. /**
  240. * Server commands.
  241. *
  242. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.StartPartitionSessionRequest start_partition_session_request = 8;</code>
  243. * @param \Ydb\Topic\StreamReadMessage\StartPartitionSessionRequest $var
  244. * @return $this
  245. */
  246. public function setStartPartitionSessionRequest($var)
  247. {
  248. GPBUtil::checkMessage($var, \Ydb\Topic\StreamReadMessage\StartPartitionSessionRequest::class);
  249. $this->writeOneof(8, $var);
  250. return $this;
  251. }
  252. /**
  253. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.StopPartitionSessionRequest stop_partition_session_request = 9;</code>
  254. * @return \Ydb\Topic\StreamReadMessage\StopPartitionSessionRequest|null
  255. */
  256. public function getStopPartitionSessionRequest()
  257. {
  258. return $this->readOneof(9);
  259. }
  260. public function hasStopPartitionSessionRequest()
  261. {
  262. return $this->hasOneof(9);
  263. }
  264. /**
  265. * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.StopPartitionSessionRequest stop_partition_session_request = 9;</code>
  266. * @param \Ydb\Topic\StreamReadMessage\StopPartitionSessionRequest $var
  267. * @return $this
  268. */
  269. public function setStopPartitionSessionRequest($var)
  270. {
  271. GPBUtil::checkMessage($var, \Ydb\Topic\StreamReadMessage\StopPartitionSessionRequest::class);
  272. $this->writeOneof(9, $var);
  273. return $this;
  274. }
  275. /**
  276. * @return string
  277. */
  278. public function getServerMessage()
  279. {
  280. return $this->whichOneof("server_message");
  281. }
  282. }
  283. // Adding a class alias for backwards compatibility with the previous class name.
  284. class_alias(FromServer::class, \Ydb\Topic\StreamReadMessage_FromServer::class);