FromClient.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. * Client-server message for write session. Contains one of:
  10. * InitRequest - handshake request.
  11. * WriteRequest - portion of data to be written.
  12. * UpdateTokenRequest - user credentials if update is needed.
  13. *
  14. * Generated from protobuf message <code>Ydb.Topic.StreamWriteMessage.FromClient</code>
  15. */
  16. class FromClient extends \Google\Protobuf\Internal\Message
  17. {
  18. protected $client_message;
  19. /**
  20. * Constructor.
  21. *
  22. * @param array $data {
  23. * Optional. Data for populating the Message object.
  24. *
  25. * @type \Ydb\Topic\StreamWriteMessage\InitRequest $init_request
  26. * @type \Ydb\Topic\StreamWriteMessage\WriteRequest $write_request
  27. * @type \Ydb\Topic\UpdateTokenRequest $update_token_request
  28. * }
  29. */
  30. public function __construct($data = NULL) {
  31. \GPBMetadata\Protos\YdbTopic::initOnce();
  32. parent::__construct($data);
  33. }
  34. /**
  35. * Generated from protobuf field <code>.Ydb.Topic.StreamWriteMessage.InitRequest init_request = 1;</code>
  36. * @return \Ydb\Topic\StreamWriteMessage\InitRequest|null
  37. */
  38. public function getInitRequest()
  39. {
  40. return $this->readOneof(1);
  41. }
  42. public function hasInitRequest()
  43. {
  44. return $this->hasOneof(1);
  45. }
  46. /**
  47. * Generated from protobuf field <code>.Ydb.Topic.StreamWriteMessage.InitRequest init_request = 1;</code>
  48. * @param \Ydb\Topic\StreamWriteMessage\InitRequest $var
  49. * @return $this
  50. */
  51. public function setInitRequest($var)
  52. {
  53. GPBUtil::checkMessage($var, \Ydb\Topic\StreamWriteMessage\InitRequest::class);
  54. $this->writeOneof(1, $var);
  55. return $this;
  56. }
  57. /**
  58. * Generated from protobuf field <code>.Ydb.Topic.StreamWriteMessage.WriteRequest write_request = 2;</code>
  59. * @return \Ydb\Topic\StreamWriteMessage\WriteRequest|null
  60. */
  61. public function getWriteRequest()
  62. {
  63. return $this->readOneof(2);
  64. }
  65. public function hasWriteRequest()
  66. {
  67. return $this->hasOneof(2);
  68. }
  69. /**
  70. * Generated from protobuf field <code>.Ydb.Topic.StreamWriteMessage.WriteRequest write_request = 2;</code>
  71. * @param \Ydb\Topic\StreamWriteMessage\WriteRequest $var
  72. * @return $this
  73. */
  74. public function setWriteRequest($var)
  75. {
  76. GPBUtil::checkMessage($var, \Ydb\Topic\StreamWriteMessage\WriteRequest::class);
  77. $this->writeOneof(2, $var);
  78. return $this;
  79. }
  80. /**
  81. * Generated from protobuf field <code>.Ydb.Topic.UpdateTokenRequest update_token_request = 3;</code>
  82. * @return \Ydb\Topic\UpdateTokenRequest|null
  83. */
  84. public function getUpdateTokenRequest()
  85. {
  86. return $this->readOneof(3);
  87. }
  88. public function hasUpdateTokenRequest()
  89. {
  90. return $this->hasOneof(3);
  91. }
  92. /**
  93. * Generated from protobuf field <code>.Ydb.Topic.UpdateTokenRequest update_token_request = 3;</code>
  94. * @param \Ydb\Topic\UpdateTokenRequest $var
  95. * @return $this
  96. */
  97. public function setUpdateTokenRequest($var)
  98. {
  99. GPBUtil::checkMessage($var, \Ydb\Topic\UpdateTokenRequest::class);
  100. $this->writeOneof(3, $var);
  101. return $this;
  102. }
  103. /**
  104. * @return string
  105. */
  106. public function getClientMessage()
  107. {
  108. return $this->whichOneof("client_message");
  109. }
  110. }
  111. // Adding a class alias for backwards compatibility with the previous class name.
  112. class_alias(FromClient::class, \Ydb\Topic\StreamWriteMessage_FromClient::class);