FromServer.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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. * Server-client message for write session. Contains either non-success status, or one of:
  10. * InitResponse - correct handshake response.
  11. * WriteResponse - acknowledgment of storing client messages.
  12. * UpdateTokenResponse - acknowledgment of reauthentication and reauthorization.
  13. *
  14. * Generated from protobuf message <code>Ydb.Topic.StreamWriteMessage.FromServer</code>
  15. */
  16. class FromServer extends \Google\Protobuf\Internal\Message
  17. {
  18. /**
  19. * Server status of response.
  20. *
  21. * Generated from protobuf field <code>.Ydb.StatusIds.StatusCode status = 1;</code>
  22. */
  23. protected $status = 0;
  24. /**
  25. * Issues if any.
  26. *
  27. * Generated from protobuf field <code>repeated .Ydb.Issue.IssueMessage issues = 2;</code>
  28. */
  29. private $issues;
  30. protected $server_message;
  31. /**
  32. * Constructor.
  33. *
  34. * @param array $data {
  35. * Optional. Data for populating the Message object.
  36. *
  37. * @type int $status
  38. * Server status of response.
  39. * @type array<\Ydb\Issue\IssueMessage>|\Google\Protobuf\Internal\RepeatedField $issues
  40. * Issues if any.
  41. * @type \Ydb\Topic\StreamWriteMessage\InitResponse $init_response
  42. * @type \Ydb\Topic\StreamWriteMessage\WriteResponse $write_response
  43. * @type \Ydb\Topic\UpdateTokenResponse $update_token_response
  44. * }
  45. */
  46. public function __construct($data = NULL) {
  47. \GPBMetadata\Protos\YdbTopic::initOnce();
  48. parent::__construct($data);
  49. }
  50. /**
  51. * Server status of response.
  52. *
  53. * Generated from protobuf field <code>.Ydb.StatusIds.StatusCode status = 1;</code>
  54. * @return int
  55. */
  56. public function getStatus()
  57. {
  58. return $this->status;
  59. }
  60. /**
  61. * Server status of response.
  62. *
  63. * Generated from protobuf field <code>.Ydb.StatusIds.StatusCode status = 1;</code>
  64. * @param int $var
  65. * @return $this
  66. */
  67. public function setStatus($var)
  68. {
  69. GPBUtil::checkEnum($var, \Ydb\StatusIds\StatusCode::class);
  70. $this->status = $var;
  71. return $this;
  72. }
  73. /**
  74. * Issues if any.
  75. *
  76. * Generated from protobuf field <code>repeated .Ydb.Issue.IssueMessage issues = 2;</code>
  77. * @return \Google\Protobuf\Internal\RepeatedField
  78. */
  79. public function getIssues()
  80. {
  81. return $this->issues;
  82. }
  83. /**
  84. * Issues if any.
  85. *
  86. * Generated from protobuf field <code>repeated .Ydb.Issue.IssueMessage issues = 2;</code>
  87. * @param array<\Ydb\Issue\IssueMessage>|\Google\Protobuf\Internal\RepeatedField $var
  88. * @return $this
  89. */
  90. public function setIssues($var)
  91. {
  92. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Ydb\Issue\IssueMessage::class);
  93. $this->issues = $arr;
  94. return $this;
  95. }
  96. /**
  97. * Generated from protobuf field <code>.Ydb.Topic.StreamWriteMessage.InitResponse init_response = 3;</code>
  98. * @return \Ydb\Topic\StreamWriteMessage\InitResponse|null
  99. */
  100. public function getInitResponse()
  101. {
  102. return $this->readOneof(3);
  103. }
  104. public function hasInitResponse()
  105. {
  106. return $this->hasOneof(3);
  107. }
  108. /**
  109. * Generated from protobuf field <code>.Ydb.Topic.StreamWriteMessage.InitResponse init_response = 3;</code>
  110. * @param \Ydb\Topic\StreamWriteMessage\InitResponse $var
  111. * @return $this
  112. */
  113. public function setInitResponse($var)
  114. {
  115. GPBUtil::checkMessage($var, \Ydb\Topic\StreamWriteMessage\InitResponse::class);
  116. $this->writeOneof(3, $var);
  117. return $this;
  118. }
  119. /**
  120. * Generated from protobuf field <code>.Ydb.Topic.StreamWriteMessage.WriteResponse write_response = 4;</code>
  121. * @return \Ydb\Topic\StreamWriteMessage\WriteResponse|null
  122. */
  123. public function getWriteResponse()
  124. {
  125. return $this->readOneof(4);
  126. }
  127. public function hasWriteResponse()
  128. {
  129. return $this->hasOneof(4);
  130. }
  131. /**
  132. * Generated from protobuf field <code>.Ydb.Topic.StreamWriteMessage.WriteResponse write_response = 4;</code>
  133. * @param \Ydb\Topic\StreamWriteMessage\WriteResponse $var
  134. * @return $this
  135. */
  136. public function setWriteResponse($var)
  137. {
  138. GPBUtil::checkMessage($var, \Ydb\Topic\StreamWriteMessage\WriteResponse::class);
  139. $this->writeOneof(4, $var);
  140. return $this;
  141. }
  142. /**
  143. * Generated from protobuf field <code>.Ydb.Topic.UpdateTokenResponse update_token_response = 5;</code>
  144. * @return \Ydb\Topic\UpdateTokenResponse|null
  145. */
  146. public function getUpdateTokenResponse()
  147. {
  148. return $this->readOneof(5);
  149. }
  150. public function hasUpdateTokenResponse()
  151. {
  152. return $this->hasOneof(5);
  153. }
  154. /**
  155. * Generated from protobuf field <code>.Ydb.Topic.UpdateTokenResponse update_token_response = 5;</code>
  156. * @param \Ydb\Topic\UpdateTokenResponse $var
  157. * @return $this
  158. */
  159. public function setUpdateTokenResponse($var)
  160. {
  161. GPBUtil::checkMessage($var, \Ydb\Topic\UpdateTokenResponse::class);
  162. $this->writeOneof(5, $var);
  163. return $this;
  164. }
  165. /**
  166. * @return string
  167. */
  168. public function getServerMessage()
  169. {
  170. return $this->whichOneof("server_message");
  171. }
  172. }
  173. // Adding a class alias for backwards compatibility with the previous class name.
  174. class_alias(FromServer::class, \Ydb\Topic\StreamWriteMessage_FromServer::class);