CreateTopicRequest.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  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. * Create topic request sent from client to server.
  10. *
  11. * Generated from protobuf message <code>Ydb.Topic.CreateTopicRequest</code>
  12. */
  13. class CreateTopicRequest extends \Google\Protobuf\Internal\Message
  14. {
  15. /**
  16. * Generated from protobuf field <code>.Ydb.Operations.OperationParams operation_params = 1;</code>
  17. */
  18. protected $operation_params = null;
  19. /**
  20. * Topic path.
  21. *
  22. * Generated from protobuf field <code>string path = 2;</code>
  23. */
  24. protected $path = '';
  25. /**
  26. * Settings for partitioning
  27. *
  28. * Generated from protobuf field <code>.Ydb.Topic.PartitioningSettings partitioning_settings = 3;</code>
  29. */
  30. protected $partitioning_settings = null;
  31. /**
  32. * Retention settings.
  33. * Currently, only one limit may be set, so other should not be set.
  34. * How long data in partition should be stored. Must be greater than 0 and less than limit for this database.
  35. * Default limit - 36 hours.
  36. *
  37. * Generated from protobuf field <code>.google.protobuf.Duration retention_period = 4;</code>
  38. */
  39. protected $retention_period = null;
  40. /**
  41. * How much data in partition should be stored. Must be greater than 0 and less than limit for this database.
  42. * Zero value means infinite limit.
  43. *
  44. * Generated from protobuf field <code>int64 retention_storage_mb = 5 [(.Ydb.value) = ">= 0"];</code>
  45. */
  46. protected $retention_storage_mb = 0;
  47. /**
  48. * List of allowed codecs for writers.
  49. * Writes with codec not from this list are forbidden.
  50. *
  51. * Generated from protobuf field <code>.Ydb.Topic.SupportedCodecs supported_codecs = 7;</code>
  52. */
  53. protected $supported_codecs = null;
  54. /**
  55. * Partition write speed in bytes per second. Must be less than database limit.
  56. * Zero value means default limit: 1 MB per second.
  57. *
  58. * Generated from protobuf field <code>int64 partition_write_speed_bytes_per_second = 8 [(.Ydb.value) = ">= 0"];</code>
  59. */
  60. protected $partition_write_speed_bytes_per_second = 0;
  61. /**
  62. * Burst size for write in partition, in bytes. Must be less than database limit.
  63. * Zero value means default limit: 1 MB.
  64. *
  65. * Generated from protobuf field <code>int64 partition_write_burst_bytes = 9 [(.Ydb.value) = ">= 0"];</code>
  66. */
  67. protected $partition_write_burst_bytes = 0;
  68. /**
  69. * User and server attributes of topic. Server attributes starts from "_" and will be validated by server.
  70. *
  71. * Generated from protobuf field <code>map<string, string> attributes = 10;</code>
  72. */
  73. private $attributes;
  74. /**
  75. * List of consumers for this topic.
  76. *
  77. * Generated from protobuf field <code>repeated .Ydb.Topic.Consumer consumers = 11 [(.Ydb.size) = {</code>
  78. */
  79. private $consumers;
  80. /**
  81. * Metering mode for the topic in a serverless database.
  82. *
  83. * Generated from protobuf field <code>.Ydb.Topic.MeteringMode metering_mode = 12;</code>
  84. */
  85. protected $metering_mode = 0;
  86. /**
  87. * Constructor.
  88. *
  89. * @param array $data {
  90. * Optional. Data for populating the Message object.
  91. *
  92. * @type \Ydb\Operations\OperationParams $operation_params
  93. * @type string $path
  94. * Topic path.
  95. * @type \Ydb\Topic\PartitioningSettings $partitioning_settings
  96. * Settings for partitioning
  97. * @type \Google\Protobuf\Duration $retention_period
  98. * Retention settings.
  99. * Currently, only one limit may be set, so other should not be set.
  100. * How long data in partition should be stored. Must be greater than 0 and less than limit for this database.
  101. * Default limit - 36 hours.
  102. * @type int|string $retention_storage_mb
  103. * How much data in partition should be stored. Must be greater than 0 and less than limit for this database.
  104. * Zero value means infinite limit.
  105. * @type \Ydb\Topic\SupportedCodecs $supported_codecs
  106. * List of allowed codecs for writers.
  107. * Writes with codec not from this list are forbidden.
  108. * @type int|string $partition_write_speed_bytes_per_second
  109. * Partition write speed in bytes per second. Must be less than database limit.
  110. * Zero value means default limit: 1 MB per second.
  111. * @type int|string $partition_write_burst_bytes
  112. * Burst size for write in partition, in bytes. Must be less than database limit.
  113. * Zero value means default limit: 1 MB.
  114. * @type array|\Google\Protobuf\Internal\MapField $attributes
  115. * User and server attributes of topic. Server attributes starts from "_" and will be validated by server.
  116. * @type array<\Ydb\Topic\Consumer>|\Google\Protobuf\Internal\RepeatedField $consumers
  117. * List of consumers for this topic.
  118. * @type int $metering_mode
  119. * Metering mode for the topic in a serverless database.
  120. * }
  121. */
  122. public function __construct($data = NULL) {
  123. \GPBMetadata\Protos\YdbTopic::initOnce();
  124. parent::__construct($data);
  125. }
  126. /**
  127. * Generated from protobuf field <code>.Ydb.Operations.OperationParams operation_params = 1;</code>
  128. * @return \Ydb\Operations\OperationParams|null
  129. */
  130. public function getOperationParams()
  131. {
  132. return $this->operation_params;
  133. }
  134. public function hasOperationParams()
  135. {
  136. return isset($this->operation_params);
  137. }
  138. public function clearOperationParams()
  139. {
  140. unset($this->operation_params);
  141. }
  142. /**
  143. * Generated from protobuf field <code>.Ydb.Operations.OperationParams operation_params = 1;</code>
  144. * @param \Ydb\Operations\OperationParams $var
  145. * @return $this
  146. */
  147. public function setOperationParams($var)
  148. {
  149. GPBUtil::checkMessage($var, \Ydb\Operations\OperationParams::class);
  150. $this->operation_params = $var;
  151. return $this;
  152. }
  153. /**
  154. * Topic path.
  155. *
  156. * Generated from protobuf field <code>string path = 2;</code>
  157. * @return string
  158. */
  159. public function getPath()
  160. {
  161. return $this->path;
  162. }
  163. /**
  164. * Topic path.
  165. *
  166. * Generated from protobuf field <code>string path = 2;</code>
  167. * @param string $var
  168. * @return $this
  169. */
  170. public function setPath($var)
  171. {
  172. GPBUtil::checkString($var, True);
  173. $this->path = $var;
  174. return $this;
  175. }
  176. /**
  177. * Settings for partitioning
  178. *
  179. * Generated from protobuf field <code>.Ydb.Topic.PartitioningSettings partitioning_settings = 3;</code>
  180. * @return \Ydb\Topic\PartitioningSettings|null
  181. */
  182. public function getPartitioningSettings()
  183. {
  184. return $this->partitioning_settings;
  185. }
  186. public function hasPartitioningSettings()
  187. {
  188. return isset($this->partitioning_settings);
  189. }
  190. public function clearPartitioningSettings()
  191. {
  192. unset($this->partitioning_settings);
  193. }
  194. /**
  195. * Settings for partitioning
  196. *
  197. * Generated from protobuf field <code>.Ydb.Topic.PartitioningSettings partitioning_settings = 3;</code>
  198. * @param \Ydb\Topic\PartitioningSettings $var
  199. * @return $this
  200. */
  201. public function setPartitioningSettings($var)
  202. {
  203. GPBUtil::checkMessage($var, \Ydb\Topic\PartitioningSettings::class);
  204. $this->partitioning_settings = $var;
  205. return $this;
  206. }
  207. /**
  208. * Retention settings.
  209. * Currently, only one limit may be set, so other should not be set.
  210. * How long data in partition should be stored. Must be greater than 0 and less than limit for this database.
  211. * Default limit - 36 hours.
  212. *
  213. * Generated from protobuf field <code>.google.protobuf.Duration retention_period = 4;</code>
  214. * @return \Google\Protobuf\Duration|null
  215. */
  216. public function getRetentionPeriod()
  217. {
  218. return $this->retention_period;
  219. }
  220. public function hasRetentionPeriod()
  221. {
  222. return isset($this->retention_period);
  223. }
  224. public function clearRetentionPeriod()
  225. {
  226. unset($this->retention_period);
  227. }
  228. /**
  229. * Retention settings.
  230. * Currently, only one limit may be set, so other should not be set.
  231. * How long data in partition should be stored. Must be greater than 0 and less than limit for this database.
  232. * Default limit - 36 hours.
  233. *
  234. * Generated from protobuf field <code>.google.protobuf.Duration retention_period = 4;</code>
  235. * @param \Google\Protobuf\Duration $var
  236. * @return $this
  237. */
  238. public function setRetentionPeriod($var)
  239. {
  240. GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
  241. $this->retention_period = $var;
  242. return $this;
  243. }
  244. /**
  245. * How much data in partition should be stored. Must be greater than 0 and less than limit for this database.
  246. * Zero value means infinite limit.
  247. *
  248. * Generated from protobuf field <code>int64 retention_storage_mb = 5 [(.Ydb.value) = ">= 0"];</code>
  249. * @return int|string
  250. */
  251. public function getRetentionStorageMb()
  252. {
  253. return $this->retention_storage_mb;
  254. }
  255. /**
  256. * How much data in partition should be stored. Must be greater than 0 and less than limit for this database.
  257. * Zero value means infinite limit.
  258. *
  259. * Generated from protobuf field <code>int64 retention_storage_mb = 5 [(.Ydb.value) = ">= 0"];</code>
  260. * @param int|string $var
  261. * @return $this
  262. */
  263. public function setRetentionStorageMb($var)
  264. {
  265. GPBUtil::checkInt64($var);
  266. $this->retention_storage_mb = $var;
  267. return $this;
  268. }
  269. /**
  270. * List of allowed codecs for writers.
  271. * Writes with codec not from this list are forbidden.
  272. *
  273. * Generated from protobuf field <code>.Ydb.Topic.SupportedCodecs supported_codecs = 7;</code>
  274. * @return \Ydb\Topic\SupportedCodecs|null
  275. */
  276. public function getSupportedCodecs()
  277. {
  278. return $this->supported_codecs;
  279. }
  280. public function hasSupportedCodecs()
  281. {
  282. return isset($this->supported_codecs);
  283. }
  284. public function clearSupportedCodecs()
  285. {
  286. unset($this->supported_codecs);
  287. }
  288. /**
  289. * List of allowed codecs for writers.
  290. * Writes with codec not from this list are forbidden.
  291. *
  292. * Generated from protobuf field <code>.Ydb.Topic.SupportedCodecs supported_codecs = 7;</code>
  293. * @param \Ydb\Topic\SupportedCodecs $var
  294. * @return $this
  295. */
  296. public function setSupportedCodecs($var)
  297. {
  298. GPBUtil::checkMessage($var, \Ydb\Topic\SupportedCodecs::class);
  299. $this->supported_codecs = $var;
  300. return $this;
  301. }
  302. /**
  303. * Partition write speed in bytes per second. Must be less than database limit.
  304. * Zero value means default limit: 1 MB per second.
  305. *
  306. * Generated from protobuf field <code>int64 partition_write_speed_bytes_per_second = 8 [(.Ydb.value) = ">= 0"];</code>
  307. * @return int|string
  308. */
  309. public function getPartitionWriteSpeedBytesPerSecond()
  310. {
  311. return $this->partition_write_speed_bytes_per_second;
  312. }
  313. /**
  314. * Partition write speed in bytes per second. Must be less than database limit.
  315. * Zero value means default limit: 1 MB per second.
  316. *
  317. * Generated from protobuf field <code>int64 partition_write_speed_bytes_per_second = 8 [(.Ydb.value) = ">= 0"];</code>
  318. * @param int|string $var
  319. * @return $this
  320. */
  321. public function setPartitionWriteSpeedBytesPerSecond($var)
  322. {
  323. GPBUtil::checkInt64($var);
  324. $this->partition_write_speed_bytes_per_second = $var;
  325. return $this;
  326. }
  327. /**
  328. * Burst size for write in partition, in bytes. Must be less than database limit.
  329. * Zero value means default limit: 1 MB.
  330. *
  331. * Generated from protobuf field <code>int64 partition_write_burst_bytes = 9 [(.Ydb.value) = ">= 0"];</code>
  332. * @return int|string
  333. */
  334. public function getPartitionWriteBurstBytes()
  335. {
  336. return $this->partition_write_burst_bytes;
  337. }
  338. /**
  339. * Burst size for write in partition, in bytes. Must be less than database limit.
  340. * Zero value means default limit: 1 MB.
  341. *
  342. * Generated from protobuf field <code>int64 partition_write_burst_bytes = 9 [(.Ydb.value) = ">= 0"];</code>
  343. * @param int|string $var
  344. * @return $this
  345. */
  346. public function setPartitionWriteBurstBytes($var)
  347. {
  348. GPBUtil::checkInt64($var);
  349. $this->partition_write_burst_bytes = $var;
  350. return $this;
  351. }
  352. /**
  353. * User and server attributes of topic. Server attributes starts from "_" and will be validated by server.
  354. *
  355. * Generated from protobuf field <code>map<string, string> attributes = 10;</code>
  356. * @return \Google\Protobuf\Internal\MapField
  357. */
  358. public function getAttributes()
  359. {
  360. return $this->attributes;
  361. }
  362. /**
  363. * User and server attributes of topic. Server attributes starts from "_" and will be validated by server.
  364. *
  365. * Generated from protobuf field <code>map<string, string> attributes = 10;</code>
  366. * @param array|\Google\Protobuf\Internal\MapField $var
  367. * @return $this
  368. */
  369. public function setAttributes($var)
  370. {
  371. $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
  372. $this->attributes = $arr;
  373. return $this;
  374. }
  375. /**
  376. * List of consumers for this topic.
  377. *
  378. * Generated from protobuf field <code>repeated .Ydb.Topic.Consumer consumers = 11 [(.Ydb.size) = {</code>
  379. * @return \Google\Protobuf\Internal\RepeatedField
  380. */
  381. public function getConsumers()
  382. {
  383. return $this->consumers;
  384. }
  385. /**
  386. * List of consumers for this topic.
  387. *
  388. * Generated from protobuf field <code>repeated .Ydb.Topic.Consumer consumers = 11 [(.Ydb.size) = {</code>
  389. * @param array<\Ydb\Topic\Consumer>|\Google\Protobuf\Internal\RepeatedField $var
  390. * @return $this
  391. */
  392. public function setConsumers($var)
  393. {
  394. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Ydb\Topic\Consumer::class);
  395. $this->consumers = $arr;
  396. return $this;
  397. }
  398. /**
  399. * Metering mode for the topic in a serverless database.
  400. *
  401. * Generated from protobuf field <code>.Ydb.Topic.MeteringMode metering_mode = 12;</code>
  402. * @return int
  403. */
  404. public function getMeteringMode()
  405. {
  406. return $this->metering_mode;
  407. }
  408. /**
  409. * Metering mode for the topic in a serverless database.
  410. *
  411. * Generated from protobuf field <code>.Ydb.Topic.MeteringMode metering_mode = 12;</code>
  412. * @param int $var
  413. * @return $this
  414. */
  415. public function setMeteringMode($var)
  416. {
  417. GPBUtil::checkEnum($var, \Ydb\Topic\MeteringMode::class);
  418. $this->metering_mode = $var;
  419. return $this;
  420. }
  421. }