Ydb.Topic.StreamReadMessage.ReadResponse.Batch
*/
class Batch extends \Google\Protobuf\Internal\Message
{
/**
* List of client messages.
*
* Generated from protobuf field repeated .Ydb.Topic.StreamReadMessage.ReadResponse.MessageData message_data = 1;
*/
private $message_data;
/**
* Producer identifier provided by client for this batch of client messages.
*
* Generated from protobuf field string producer_id = 2;
*/
protected $producer_id = '';
/**
* Client metadata attached to write session, the same for all messages in batch.
*
* Generated from protobuf field map write_session_meta = 3;
*/
private $write_session_meta;
/**
* Codec that is used for data compression.
* See enum Codec above for values.
*
* Generated from protobuf field int32 codec = 4;
*/
protected $codec = 0;
/**
* Persist timestamp on server for batch.
*
* Generated from protobuf field .google.protobuf.Timestamp written_at = 5;
*/
protected $written_at = null;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type array<\Ydb\Topic\StreamReadMessage\ReadResponse\MessageData>|\Google\Protobuf\Internal\RepeatedField $message_data
* List of client messages.
* @type string $producer_id
* Producer identifier provided by client for this batch of client messages.
* @type array|\Google\Protobuf\Internal\MapField $write_session_meta
* Client metadata attached to write session, the same for all messages in batch.
* @type int $codec
* Codec that is used for data compression.
* See enum Codec above for values.
* @type \Google\Protobuf\Timestamp $written_at
* Persist timestamp on server for batch.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Protos\YdbTopic::initOnce();
parent::__construct($data);
}
/**
* List of client messages.
*
* Generated from protobuf field repeated .Ydb.Topic.StreamReadMessage.ReadResponse.MessageData message_data = 1;
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getMessageData()
{
return $this->message_data;
}
/**
* List of client messages.
*
* Generated from protobuf field repeated .Ydb.Topic.StreamReadMessage.ReadResponse.MessageData message_data = 1;
* @param array<\Ydb\Topic\StreamReadMessage\ReadResponse\MessageData>|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setMessageData($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Ydb\Topic\StreamReadMessage\ReadResponse\MessageData::class);
$this->message_data = $arr;
return $this;
}
/**
* Producer identifier provided by client for this batch of client messages.
*
* Generated from protobuf field string producer_id = 2;
* @return string
*/
public function getProducerId()
{
return $this->producer_id;
}
/**
* Producer identifier provided by client for this batch of client messages.
*
* Generated from protobuf field string producer_id = 2;
* @param string $var
* @return $this
*/
public function setProducerId($var)
{
GPBUtil::checkString($var, True);
$this->producer_id = $var;
return $this;
}
/**
* Client metadata attached to write session, the same for all messages in batch.
*
* Generated from protobuf field map write_session_meta = 3;
* @return \Google\Protobuf\Internal\MapField
*/
public function getWriteSessionMeta()
{
return $this->write_session_meta;
}
/**
* Client metadata attached to write session, the same for all messages in batch.
*
* Generated from protobuf field map write_session_meta = 3;
* @param array|\Google\Protobuf\Internal\MapField $var
* @return $this
*/
public function setWriteSessionMeta($var)
{
$arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
$this->write_session_meta = $arr;
return $this;
}
/**
* Codec that is used for data compression.
* See enum Codec above for values.
*
* Generated from protobuf field int32 codec = 4;
* @return int
*/
public function getCodec()
{
return $this->codec;
}
/**
* Codec that is used for data compression.
* See enum Codec above for values.
*
* Generated from protobuf field int32 codec = 4;
* @param int $var
* @return $this
*/
public function setCodec($var)
{
GPBUtil::checkInt32($var);
$this->codec = $var;
return $this;
}
/**
* Persist timestamp on server for batch.
*
* Generated from protobuf field .google.protobuf.Timestamp written_at = 5;
* @return \Google\Protobuf\Timestamp|null
*/
public function getWrittenAt()
{
return $this->written_at;
}
public function hasWrittenAt()
{
return isset($this->written_at);
}
public function clearWrittenAt()
{
unset($this->written_at);
}
/**
* Persist timestamp on server for batch.
*
* Generated from protobuf field .google.protobuf.Timestamp written_at = 5;
* @param \Google\Protobuf\Timestamp $var
* @return $this
*/
public function setWrittenAt($var)
{
GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
$this->written_at = $var;
return $this;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Batch::class, \Ydb\Topic\StreamReadMessage_ReadResponse_Batch::class);