CreateSemaphore.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_coordination.proto
  4. namespace Ydb\Coordination\SessionRequest;
  5. use Google\Protobuf\Internal\GPBType;
  6. use Google\Protobuf\Internal\RepeatedField;
  7. use Google\Protobuf\Internal\GPBUtil;
  8. /**
  9. **
  10. * Used to create a new semaphore
  11. *
  12. * Generated from protobuf message <code>Ydb.Coordination.SessionRequest.CreateSemaphore</code>
  13. */
  14. class CreateSemaphore extends \Google\Protobuf\Internal\Message
  15. {
  16. /**
  17. * Client-defined request id, echoed in the response
  18. *
  19. * Generated from protobuf field <code>uint64 req_id = 1;</code>
  20. */
  21. protected $req_id = 0;
  22. /**
  23. * Name of the semaphore to create
  24. *
  25. * Generated from protobuf field <code>string name = 2;</code>
  26. */
  27. protected $name = '';
  28. /**
  29. * Number of tokens that may be acquired by sessions
  30. *
  31. * Generated from protobuf field <code>uint64 limit = 3;</code>
  32. */
  33. protected $limit = 0;
  34. /**
  35. * User-defined data that is attached to the semaphore
  36. *
  37. * Generated from protobuf field <code>bytes data = 4;</code>
  38. */
  39. protected $data = '';
  40. /**
  41. * Constructor.
  42. *
  43. * @param array $data {
  44. * Optional. Data for populating the Message object.
  45. *
  46. * @type int|string $req_id
  47. * Client-defined request id, echoed in the response
  48. * @type string $name
  49. * Name of the semaphore to create
  50. * @type int|string $limit
  51. * Number of tokens that may be acquired by sessions
  52. * @type string $data
  53. * User-defined data that is attached to the semaphore
  54. * }
  55. */
  56. public function __construct($data = NULL) {
  57. \GPBMetadata\Protos\YdbCoordination::initOnce();
  58. parent::__construct($data);
  59. }
  60. /**
  61. * Client-defined request id, echoed in the response
  62. *
  63. * Generated from protobuf field <code>uint64 req_id = 1;</code>
  64. * @return int|string
  65. */
  66. public function getReqId()
  67. {
  68. return $this->req_id;
  69. }
  70. /**
  71. * Client-defined request id, echoed in the response
  72. *
  73. * Generated from protobuf field <code>uint64 req_id = 1;</code>
  74. * @param int|string $var
  75. * @return $this
  76. */
  77. public function setReqId($var)
  78. {
  79. GPBUtil::checkUint64($var);
  80. $this->req_id = $var;
  81. return $this;
  82. }
  83. /**
  84. * Name of the semaphore to create
  85. *
  86. * Generated from protobuf field <code>string name = 2;</code>
  87. * @return string
  88. */
  89. public function getName()
  90. {
  91. return $this->name;
  92. }
  93. /**
  94. * Name of the semaphore to create
  95. *
  96. * Generated from protobuf field <code>string name = 2;</code>
  97. * @param string $var
  98. * @return $this
  99. */
  100. public function setName($var)
  101. {
  102. GPBUtil::checkString($var, True);
  103. $this->name = $var;
  104. return $this;
  105. }
  106. /**
  107. * Number of tokens that may be acquired by sessions
  108. *
  109. * Generated from protobuf field <code>uint64 limit = 3;</code>
  110. * @return int|string
  111. */
  112. public function getLimit()
  113. {
  114. return $this->limit;
  115. }
  116. /**
  117. * Number of tokens that may be acquired by sessions
  118. *
  119. * Generated from protobuf field <code>uint64 limit = 3;</code>
  120. * @param int|string $var
  121. * @return $this
  122. */
  123. public function setLimit($var)
  124. {
  125. GPBUtil::checkUint64($var);
  126. $this->limit = $var;
  127. return $this;
  128. }
  129. /**
  130. * User-defined data that is attached to the semaphore
  131. *
  132. * Generated from protobuf field <code>bytes data = 4;</code>
  133. * @return string
  134. */
  135. public function getData()
  136. {
  137. return $this->data;
  138. }
  139. /**
  140. * User-defined data that is attached to the semaphore
  141. *
  142. * Generated from protobuf field <code>bytes data = 4;</code>
  143. * @param string $var
  144. * @return $this
  145. */
  146. public function setData($var)
  147. {
  148. GPBUtil::checkString($var, False);
  149. $this->data = $var;
  150. return $this;
  151. }
  152. }
  153. // Adding a class alias for backwards compatibility with the previous class name.
  154. class_alias(CreateSemaphore::class, \Ydb\Coordination\SessionRequest_CreateSemaphore::class);