Consumer.php 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_topic.proto
  4. namespace Ydb\Topic;
  5. use Google\Protobuf\Internal\GPBType;
  6. use Google\Protobuf\Internal\RepeatedField;
  7. use Google\Protobuf\Internal\GPBUtil;
  8. /**
  9. * Consumer description.
  10. *
  11. * Generated from protobuf message <code>Ydb.Topic.Consumer</code>
  12. */
  13. class Consumer extends \Google\Protobuf\Internal\Message
  14. {
  15. /**
  16. * Must have valid not empty name as a key.
  17. *
  18. * Generated from protobuf field <code>string name = 1;</code>
  19. */
  20. protected $name = '';
  21. /**
  22. * Consumer may be marked as 'important'. It means messages for this consumer will never expire due to retention.
  23. * User should take care that such consumer never stalls, to prevent running out of disk space.
  24. * Flag that this consumer is important.
  25. *
  26. * Generated from protobuf field <code>bool important = 2;</code>
  27. */
  28. protected $important = false;
  29. /**
  30. * All messages with smaller server written_at timestamp will be skipped.
  31. *
  32. * Generated from protobuf field <code>.google.protobuf.Timestamp read_from = 3;</code>
  33. */
  34. protected $read_from = null;
  35. /**
  36. * List of supported codecs by this consumer.
  37. * supported_codecs on topic must be contained inside this list.
  38. *
  39. * Generated from protobuf field <code>.Ydb.Topic.SupportedCodecs supported_codecs = 5;</code>
  40. */
  41. protected $supported_codecs = null;
  42. /**
  43. * Attributes of consumer
  44. *
  45. * Generated from protobuf field <code>map<string, string> attributes = 6;</code>
  46. */
  47. private $attributes;
  48. /**
  49. * Filled only when requested statistics in Describe*Request.
  50. *
  51. * Generated from protobuf field <code>.Ydb.Topic.Consumer.ConsumerStats consumer_stats = 7;</code>
  52. */
  53. protected $consumer_stats = null;
  54. /**
  55. * Constructor.
  56. *
  57. * @param array $data {
  58. * Optional. Data for populating the Message object.
  59. *
  60. * @type string $name
  61. * Must have valid not empty name as a key.
  62. * @type bool $important
  63. * Consumer may be marked as 'important'. It means messages for this consumer will never expire due to retention.
  64. * User should take care that such consumer never stalls, to prevent running out of disk space.
  65. * Flag that this consumer is important.
  66. * @type \Google\Protobuf\Timestamp $read_from
  67. * All messages with smaller server written_at timestamp will be skipped.
  68. * @type \Ydb\Topic\SupportedCodecs $supported_codecs
  69. * List of supported codecs by this consumer.
  70. * supported_codecs on topic must be contained inside this list.
  71. * @type array|\Google\Protobuf\Internal\MapField $attributes
  72. * Attributes of consumer
  73. * @type \Ydb\Topic\Consumer\ConsumerStats $consumer_stats
  74. * Filled only when requested statistics in Describe*Request.
  75. * }
  76. */
  77. public function __construct($data = NULL) {
  78. \GPBMetadata\Protos\YdbTopic::initOnce();
  79. parent::__construct($data);
  80. }
  81. /**
  82. * Must have valid not empty name as a key.
  83. *
  84. * Generated from protobuf field <code>string name = 1;</code>
  85. * @return string
  86. */
  87. public function getName()
  88. {
  89. return $this->name;
  90. }
  91. /**
  92. * Must have valid not empty name as a key.
  93. *
  94. * Generated from protobuf field <code>string name = 1;</code>
  95. * @param string $var
  96. * @return $this
  97. */
  98. public function setName($var)
  99. {
  100. GPBUtil::checkString($var, True);
  101. $this->name = $var;
  102. return $this;
  103. }
  104. /**
  105. * Consumer may be marked as 'important'. It means messages for this consumer will never expire due to retention.
  106. * User should take care that such consumer never stalls, to prevent running out of disk space.
  107. * Flag that this consumer is important.
  108. *
  109. * Generated from protobuf field <code>bool important = 2;</code>
  110. * @return bool
  111. */
  112. public function getImportant()
  113. {
  114. return $this->important;
  115. }
  116. /**
  117. * Consumer may be marked as 'important'. It means messages for this consumer will never expire due to retention.
  118. * User should take care that such consumer never stalls, to prevent running out of disk space.
  119. * Flag that this consumer is important.
  120. *
  121. * Generated from protobuf field <code>bool important = 2;</code>
  122. * @param bool $var
  123. * @return $this
  124. */
  125. public function setImportant($var)
  126. {
  127. GPBUtil::checkBool($var);
  128. $this->important = $var;
  129. return $this;
  130. }
  131. /**
  132. * All messages with smaller server written_at timestamp will be skipped.
  133. *
  134. * Generated from protobuf field <code>.google.protobuf.Timestamp read_from = 3;</code>
  135. * @return \Google\Protobuf\Timestamp|null
  136. */
  137. public function getReadFrom()
  138. {
  139. return $this->read_from;
  140. }
  141. public function hasReadFrom()
  142. {
  143. return isset($this->read_from);
  144. }
  145. public function clearReadFrom()
  146. {
  147. unset($this->read_from);
  148. }
  149. /**
  150. * All messages with smaller server written_at timestamp will be skipped.
  151. *
  152. * Generated from protobuf field <code>.google.protobuf.Timestamp read_from = 3;</code>
  153. * @param \Google\Protobuf\Timestamp $var
  154. * @return $this
  155. */
  156. public function setReadFrom($var)
  157. {
  158. GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
  159. $this->read_from = $var;
  160. return $this;
  161. }
  162. /**
  163. * List of supported codecs by this consumer.
  164. * supported_codecs on topic must be contained inside this list.
  165. *
  166. * Generated from protobuf field <code>.Ydb.Topic.SupportedCodecs supported_codecs = 5;</code>
  167. * @return \Ydb\Topic\SupportedCodecs|null
  168. */
  169. public function getSupportedCodecs()
  170. {
  171. return $this->supported_codecs;
  172. }
  173. public function hasSupportedCodecs()
  174. {
  175. return isset($this->supported_codecs);
  176. }
  177. public function clearSupportedCodecs()
  178. {
  179. unset($this->supported_codecs);
  180. }
  181. /**
  182. * List of supported codecs by this consumer.
  183. * supported_codecs on topic must be contained inside this list.
  184. *
  185. * Generated from protobuf field <code>.Ydb.Topic.SupportedCodecs supported_codecs = 5;</code>
  186. * @param \Ydb\Topic\SupportedCodecs $var
  187. * @return $this
  188. */
  189. public function setSupportedCodecs($var)
  190. {
  191. GPBUtil::checkMessage($var, \Ydb\Topic\SupportedCodecs::class);
  192. $this->supported_codecs = $var;
  193. return $this;
  194. }
  195. /**
  196. * Attributes of consumer
  197. *
  198. * Generated from protobuf field <code>map<string, string> attributes = 6;</code>
  199. * @return \Google\Protobuf\Internal\MapField
  200. */
  201. public function getAttributes()
  202. {
  203. return $this->attributes;
  204. }
  205. /**
  206. * Attributes of consumer
  207. *
  208. * Generated from protobuf field <code>map<string, string> attributes = 6;</code>
  209. * @param array|\Google\Protobuf\Internal\MapField $var
  210. * @return $this
  211. */
  212. public function setAttributes($var)
  213. {
  214. $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
  215. $this->attributes = $arr;
  216. return $this;
  217. }
  218. /**
  219. * Filled only when requested statistics in Describe*Request.
  220. *
  221. * Generated from protobuf field <code>.Ydb.Topic.Consumer.ConsumerStats consumer_stats = 7;</code>
  222. * @return \Ydb\Topic\Consumer\ConsumerStats|null
  223. */
  224. public function getConsumerStats()
  225. {
  226. return $this->consumer_stats;
  227. }
  228. public function hasConsumerStats()
  229. {
  230. return isset($this->consumer_stats);
  231. }
  232. public function clearConsumerStats()
  233. {
  234. unset($this->consumer_stats);
  235. }
  236. /**
  237. * Filled only when requested statistics in Describe*Request.
  238. *
  239. * Generated from protobuf field <code>.Ydb.Topic.Consumer.ConsumerStats consumer_stats = 7;</code>
  240. * @param \Ydb\Topic\Consumer\ConsumerStats $var
  241. * @return $this
  242. */
  243. public function setConsumerStats($var)
  244. {
  245. GPBUtil::checkMessage($var, \Ydb\Topic\Consumer\ConsumerStats::class);
  246. $this->consumer_stats = $var;
  247. return $this;
  248. }
  249. }