123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326 |
- <?php
- # Generated by the protocol buffer compiler. DO NOT EDIT!
- # source: protos/ydb_topic.proto
- namespace Ydb\Topic\StreamReadMessage;
- use Google\Protobuf\Internal\GPBType;
- use Google\Protobuf\Internal\RepeatedField;
- use Google\Protobuf\Internal\GPBUtil;
- /**
- * Server-client message for read session. Contains one of:
- * InitResponse - handshake response from server.
- * ReadResponse - portion of data.
- * CommitOffsetResponse - acknowledgment for commit.
- * PartitionSessionStatusResponse - server response with partition session status.
- * UpdateTokenResponse - acknowledgment of token update.
- * StartPartitionSessionRequest - command from server to create a partition session.
- * StopPartitionSessionRequest - command from server to destroy a partition session.
- *
- * Generated from protobuf message <code>Ydb.Topic.StreamReadMessage.FromServer</code>
- */
- class FromServer extends \Google\Protobuf\Internal\Message
- {
- /**
- * Server status of response.
- *
- * Generated from protobuf field <code>.Ydb.StatusIds.StatusCode status = 1;</code>
- */
- protected $status = 0;
- /**
- * Issues if any.
- *
- * Generated from protobuf field <code>repeated .Ydb.Issue.IssueMessage issues = 2;</code>
- */
- private $issues;
- protected $server_message;
- /**
- * Constructor.
- *
- * @param array $data {
- * Optional. Data for populating the Message object.
- *
- * @type int $status
- * Server status of response.
- * @type array<\Ydb\Issue\IssueMessage>|\Google\Protobuf\Internal\RepeatedField $issues
- * Issues if any.
- * @type \Ydb\Topic\StreamReadMessage\InitResponse $init_response
- * Responses to respective client requests.
- * @type \Ydb\Topic\StreamReadMessage\ReadResponse $read_response
- * @type \Ydb\Topic\StreamReadMessage\CommitOffsetResponse $commit_offset_response
- * @type \Ydb\Topic\StreamReadMessage\PartitionSessionStatusResponse $partition_session_status_response
- * @type \Ydb\Topic\UpdateTokenResponse $update_token_response
- * @type \Ydb\Topic\StreamReadMessage\StartPartitionSessionRequest $start_partition_session_request
- * Server commands.
- * @type \Ydb\Topic\StreamReadMessage\StopPartitionSessionRequest $stop_partition_session_request
- * }
- */
- public function __construct($data = NULL) {
- \GPBMetadata\Protos\YdbTopic::initOnce();
- parent::__construct($data);
- }
- /**
- * Server status of response.
- *
- * Generated from protobuf field <code>.Ydb.StatusIds.StatusCode status = 1;</code>
- * @return int
- */
- public function getStatus()
- {
- return $this->status;
- }
- /**
- * Server status of response.
- *
- * Generated from protobuf field <code>.Ydb.StatusIds.StatusCode status = 1;</code>
- * @param int $var
- * @return $this
- */
- public function setStatus($var)
- {
- GPBUtil::checkEnum($var, \Ydb\StatusIds\StatusCode::class);
- $this->status = $var;
- return $this;
- }
- /**
- * Issues if any.
- *
- * Generated from protobuf field <code>repeated .Ydb.Issue.IssueMessage issues = 2;</code>
- * @return \Google\Protobuf\Internal\RepeatedField
- */
- public function getIssues()
- {
- return $this->issues;
- }
- /**
- * Issues if any.
- *
- * Generated from protobuf field <code>repeated .Ydb.Issue.IssueMessage issues = 2;</code>
- * @param array<\Ydb\Issue\IssueMessage>|\Google\Protobuf\Internal\RepeatedField $var
- * @return $this
- */
- public function setIssues($var)
- {
- $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Ydb\Issue\IssueMessage::class);
- $this->issues = $arr;
- return $this;
- }
- /**
- * Responses to respective client requests.
- *
- * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.InitResponse init_response = 3;</code>
- * @return \Ydb\Topic\StreamReadMessage\InitResponse|null
- */
- public function getInitResponse()
- {
- return $this->readOneof(3);
- }
- public function hasInitResponse()
- {
- return $this->hasOneof(3);
- }
- /**
- * Responses to respective client requests.
- *
- * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.InitResponse init_response = 3;</code>
- * @param \Ydb\Topic\StreamReadMessage\InitResponse $var
- * @return $this
- */
- public function setInitResponse($var)
- {
- GPBUtil::checkMessage($var, \Ydb\Topic\StreamReadMessage\InitResponse::class);
- $this->writeOneof(3, $var);
- return $this;
- }
- /**
- * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.ReadResponse read_response = 4;</code>
- * @return \Ydb\Topic\StreamReadMessage\ReadResponse|null
- */
- public function getReadResponse()
- {
- return $this->readOneof(4);
- }
- public function hasReadResponse()
- {
- return $this->hasOneof(4);
- }
- /**
- * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.ReadResponse read_response = 4;</code>
- * @param \Ydb\Topic\StreamReadMessage\ReadResponse $var
- * @return $this
- */
- public function setReadResponse($var)
- {
- GPBUtil::checkMessage($var, \Ydb\Topic\StreamReadMessage\ReadResponse::class);
- $this->writeOneof(4, $var);
- return $this;
- }
- /**
- * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.CommitOffsetResponse commit_offset_response = 5;</code>
- * @return \Ydb\Topic\StreamReadMessage\CommitOffsetResponse|null
- */
- public function getCommitOffsetResponse()
- {
- return $this->readOneof(5);
- }
- public function hasCommitOffsetResponse()
- {
- return $this->hasOneof(5);
- }
- /**
- * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.CommitOffsetResponse commit_offset_response = 5;</code>
- * @param \Ydb\Topic\StreamReadMessage\CommitOffsetResponse $var
- * @return $this
- */
- public function setCommitOffsetResponse($var)
- {
- GPBUtil::checkMessage($var, \Ydb\Topic\StreamReadMessage\CommitOffsetResponse::class);
- $this->writeOneof(5, $var);
- return $this;
- }
- /**
- * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.PartitionSessionStatusResponse partition_session_status_response = 6;</code>
- * @return \Ydb\Topic\StreamReadMessage\PartitionSessionStatusResponse|null
- */
- public function getPartitionSessionStatusResponse()
- {
- return $this->readOneof(6);
- }
- public function hasPartitionSessionStatusResponse()
- {
- return $this->hasOneof(6);
- }
- /**
- * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.PartitionSessionStatusResponse partition_session_status_response = 6;</code>
- * @param \Ydb\Topic\StreamReadMessage\PartitionSessionStatusResponse $var
- * @return $this
- */
- public function setPartitionSessionStatusResponse($var)
- {
- GPBUtil::checkMessage($var, \Ydb\Topic\StreamReadMessage\PartitionSessionStatusResponse::class);
- $this->writeOneof(6, $var);
- return $this;
- }
- /**
- * Generated from protobuf field <code>.Ydb.Topic.UpdateTokenResponse update_token_response = 7;</code>
- * @return \Ydb\Topic\UpdateTokenResponse|null
- */
- public function getUpdateTokenResponse()
- {
- return $this->readOneof(7);
- }
- public function hasUpdateTokenResponse()
- {
- return $this->hasOneof(7);
- }
- /**
- * Generated from protobuf field <code>.Ydb.Topic.UpdateTokenResponse update_token_response = 7;</code>
- * @param \Ydb\Topic\UpdateTokenResponse $var
- * @return $this
- */
- public function setUpdateTokenResponse($var)
- {
- GPBUtil::checkMessage($var, \Ydb\Topic\UpdateTokenResponse::class);
- $this->writeOneof(7, $var);
- return $this;
- }
- /**
- * Server commands.
- *
- * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.StartPartitionSessionRequest start_partition_session_request = 8;</code>
- * @return \Ydb\Topic\StreamReadMessage\StartPartitionSessionRequest|null
- */
- public function getStartPartitionSessionRequest()
- {
- return $this->readOneof(8);
- }
- public function hasStartPartitionSessionRequest()
- {
- return $this->hasOneof(8);
- }
- /**
- * Server commands.
- *
- * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.StartPartitionSessionRequest start_partition_session_request = 8;</code>
- * @param \Ydb\Topic\StreamReadMessage\StartPartitionSessionRequest $var
- * @return $this
- */
- public function setStartPartitionSessionRequest($var)
- {
- GPBUtil::checkMessage($var, \Ydb\Topic\StreamReadMessage\StartPartitionSessionRequest::class);
- $this->writeOneof(8, $var);
- return $this;
- }
- /**
- * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.StopPartitionSessionRequest stop_partition_session_request = 9;</code>
- * @return \Ydb\Topic\StreamReadMessage\StopPartitionSessionRequest|null
- */
- public function getStopPartitionSessionRequest()
- {
- return $this->readOneof(9);
- }
- public function hasStopPartitionSessionRequest()
- {
- return $this->hasOneof(9);
- }
- /**
- * Generated from protobuf field <code>.Ydb.Topic.StreamReadMessage.StopPartitionSessionRequest stop_partition_session_request = 9;</code>
- * @param \Ydb\Topic\StreamReadMessage\StopPartitionSessionRequest $var
- * @return $this
- */
- public function setStopPartitionSessionRequest($var)
- {
- GPBUtil::checkMessage($var, \Ydb\Topic\StreamReadMessage\StopPartitionSessionRequest::class);
- $this->writeOneof(9, $var);
- return $this;
- }
- /**
- * @return string
- */
- public function getServerMessage()
- {
- return $this->whichOneof("server_message");
- }
- }
- // Adding a class alias for backwards compatibility with the previous class name.
- class_alias(FromServer::class, \Ydb\Topic\StreamReadMessage_FromServer::class);
|