AcquireResourceRequest.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_rate_limiter.proto
  4. namespace Ydb\RateLimiter;
  5. use Google\Protobuf\Internal\GPBType;
  6. use Google\Protobuf\Internal\RepeatedField;
  7. use Google\Protobuf\Internal\GPBUtil;
  8. /**
  9. * Generated from protobuf message <code>Ydb.RateLimiter.AcquireResourceRequest</code>
  10. */
  11. class AcquireResourceRequest extends \Google\Protobuf\Internal\Message
  12. {
  13. /**
  14. * Generated from protobuf field <code>.Ydb.Operations.OperationParams operation_params = 1;</code>
  15. */
  16. protected $operation_params = null;
  17. /**
  18. * Path of a coordination node.
  19. *
  20. * Generated from protobuf field <code>string coordination_node_path = 2;</code>
  21. */
  22. protected $coordination_node_path = '';
  23. /**
  24. * Path of resource inside a coordination node.
  25. *
  26. * Generated from protobuf field <code>string resource_path = 3;</code>
  27. */
  28. protected $resource_path = '';
  29. protected $units;
  30. /**
  31. * Constructor.
  32. *
  33. * @param array $data {
  34. * Optional. Data for populating the Message object.
  35. *
  36. * @type \Ydb\Operations\OperationParams $operation_params
  37. * @type string $coordination_node_path
  38. * Path of a coordination node.
  39. * @type string $resource_path
  40. * Path of resource inside a coordination node.
  41. * @type int|string $required
  42. * Request resource's units for usage.
  43. * @type int|string $used
  44. * Actually used resource's units by client.
  45. * }
  46. */
  47. public function __construct($data = NULL) {
  48. \GPBMetadata\Protos\YdbRateLimiter::initOnce();
  49. parent::__construct($data);
  50. }
  51. /**
  52. * Generated from protobuf field <code>.Ydb.Operations.OperationParams operation_params = 1;</code>
  53. * @return \Ydb\Operations\OperationParams|null
  54. */
  55. public function getOperationParams()
  56. {
  57. return $this->operation_params;
  58. }
  59. public function hasOperationParams()
  60. {
  61. return isset($this->operation_params);
  62. }
  63. public function clearOperationParams()
  64. {
  65. unset($this->operation_params);
  66. }
  67. /**
  68. * Generated from protobuf field <code>.Ydb.Operations.OperationParams operation_params = 1;</code>
  69. * @param \Ydb\Operations\OperationParams $var
  70. * @return $this
  71. */
  72. public function setOperationParams($var)
  73. {
  74. GPBUtil::checkMessage($var, \Ydb\Operations\OperationParams::class);
  75. $this->operation_params = $var;
  76. return $this;
  77. }
  78. /**
  79. * Path of a coordination node.
  80. *
  81. * Generated from protobuf field <code>string coordination_node_path = 2;</code>
  82. * @return string
  83. */
  84. public function getCoordinationNodePath()
  85. {
  86. return $this->coordination_node_path;
  87. }
  88. /**
  89. * Path of a coordination node.
  90. *
  91. * Generated from protobuf field <code>string coordination_node_path = 2;</code>
  92. * @param string $var
  93. * @return $this
  94. */
  95. public function setCoordinationNodePath($var)
  96. {
  97. GPBUtil::checkString($var, True);
  98. $this->coordination_node_path = $var;
  99. return $this;
  100. }
  101. /**
  102. * Path of resource inside a coordination node.
  103. *
  104. * Generated from protobuf field <code>string resource_path = 3;</code>
  105. * @return string
  106. */
  107. public function getResourcePath()
  108. {
  109. return $this->resource_path;
  110. }
  111. /**
  112. * Path of resource inside a coordination node.
  113. *
  114. * Generated from protobuf field <code>string resource_path = 3;</code>
  115. * @param string $var
  116. * @return $this
  117. */
  118. public function setResourcePath($var)
  119. {
  120. GPBUtil::checkString($var, True);
  121. $this->resource_path = $var;
  122. return $this;
  123. }
  124. /**
  125. * Request resource's units for usage.
  126. *
  127. * Generated from protobuf field <code>uint64 required = 4;</code>
  128. * @return int|string
  129. */
  130. public function getRequired()
  131. {
  132. return $this->readOneof(4);
  133. }
  134. public function hasRequired()
  135. {
  136. return $this->hasOneof(4);
  137. }
  138. /**
  139. * Request resource's units for usage.
  140. *
  141. * Generated from protobuf field <code>uint64 required = 4;</code>
  142. * @param int|string $var
  143. * @return $this
  144. */
  145. public function setRequired($var)
  146. {
  147. GPBUtil::checkUint64($var);
  148. $this->writeOneof(4, $var);
  149. return $this;
  150. }
  151. /**
  152. * Actually used resource's units by client.
  153. *
  154. * Generated from protobuf field <code>uint64 used = 5;</code>
  155. * @return int|string
  156. */
  157. public function getUsed()
  158. {
  159. return $this->readOneof(5);
  160. }
  161. public function hasUsed()
  162. {
  163. return $this->hasOneof(5);
  164. }
  165. /**
  166. * Actually used resource's units by client.
  167. *
  168. * Generated from protobuf field <code>uint64 used = 5;</code>
  169. * @param int|string $var
  170. * @return $this
  171. */
  172. public function setUsed($var)
  173. {
  174. GPBUtil::checkUint64($var);
  175. $this->writeOneof(5, $var);
  176. return $this;
  177. }
  178. /**
  179. * @return string
  180. */
  181. public function getUnits()
  182. {
  183. return $this->whichOneof("units");
  184. }
  185. }