Operation.php 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_operation.proto
  4. namespace Ydb\Operations;
  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.Operations.Operation</code>
  10. */
  11. class Operation extends \Google\Protobuf\Internal\Message
  12. {
  13. /**
  14. * Identifier of the operation, empty value means no active operation object is present (it was forgotten or
  15. * not created in the first place, as in SYNC operation mode).
  16. *
  17. * Generated from protobuf field <code>string id = 1;</code>
  18. */
  19. protected $id = '';
  20. /**
  21. * true - this operation has beed finished (doesn't matter successful or not),
  22. * so Status field has status code, and Result field can contains result data.
  23. * false - this operation still running. You can repeat request using operation Id.
  24. *
  25. * Generated from protobuf field <code>bool ready = 2;</code>
  26. */
  27. protected $ready = false;
  28. /**
  29. * Generated from protobuf field <code>.Ydb.StatusIds.StatusCode status = 3;</code>
  30. */
  31. protected $status = 0;
  32. /**
  33. * Generated from protobuf field <code>repeated .Ydb.Issue.IssueMessage issues = 4;</code>
  34. */
  35. private $issues;
  36. /**
  37. * Result data
  38. *
  39. * Generated from protobuf field <code>.google.protobuf.Any result = 5;</code>
  40. */
  41. protected $result = null;
  42. /**
  43. * Generated from protobuf field <code>.google.protobuf.Any metadata = 6;</code>
  44. */
  45. protected $metadata = null;
  46. /**
  47. * Contains information about the cost of the operation.
  48. * For completed operations, it shows the final cost of the operation.
  49. * For operations in progress, it might indicate the current cost of the operation (if supported).
  50. *
  51. * Generated from protobuf field <code>.Ydb.CostInfo cost_info = 7;</code>
  52. */
  53. protected $cost_info = null;
  54. /**
  55. * Constructor.
  56. *
  57. * @param array $data {
  58. * Optional. Data for populating the Message object.
  59. *
  60. * @type string $id
  61. * Identifier of the operation, empty value means no active operation object is present (it was forgotten or
  62. * not created in the first place, as in SYNC operation mode).
  63. * @type bool $ready
  64. * true - this operation has beed finished (doesn't matter successful or not),
  65. * so Status field has status code, and Result field can contains result data.
  66. * false - this operation still running. You can repeat request using operation Id.
  67. * @type int $status
  68. * @type array<\Ydb\Issue\IssueMessage>|\Google\Protobuf\Internal\RepeatedField $issues
  69. * @type \Google\Protobuf\Any $result
  70. * Result data
  71. * @type \Google\Protobuf\Any $metadata
  72. * @type \Ydb\CostInfo $cost_info
  73. * Contains information about the cost of the operation.
  74. * For completed operations, it shows the final cost of the operation.
  75. * For operations in progress, it might indicate the current cost of the operation (if supported).
  76. * }
  77. */
  78. public function __construct($data = NULL) {
  79. \GPBMetadata\Protos\YdbOperation::initOnce();
  80. parent::__construct($data);
  81. }
  82. /**
  83. * Identifier of the operation, empty value means no active operation object is present (it was forgotten or
  84. * not created in the first place, as in SYNC operation mode).
  85. *
  86. * Generated from protobuf field <code>string id = 1;</code>
  87. * @return string
  88. */
  89. public function getId()
  90. {
  91. return $this->id;
  92. }
  93. /**
  94. * Identifier of the operation, empty value means no active operation object is present (it was forgotten or
  95. * not created in the first place, as in SYNC operation mode).
  96. *
  97. * Generated from protobuf field <code>string id = 1;</code>
  98. * @param string $var
  99. * @return $this
  100. */
  101. public function setId($var)
  102. {
  103. GPBUtil::checkString($var, True);
  104. $this->id = $var;
  105. return $this;
  106. }
  107. /**
  108. * true - this operation has beed finished (doesn't matter successful or not),
  109. * so Status field has status code, and Result field can contains result data.
  110. * false - this operation still running. You can repeat request using operation Id.
  111. *
  112. * Generated from protobuf field <code>bool ready = 2;</code>
  113. * @return bool
  114. */
  115. public function getReady()
  116. {
  117. return $this->ready;
  118. }
  119. /**
  120. * true - this operation has beed finished (doesn't matter successful or not),
  121. * so Status field has status code, and Result field can contains result data.
  122. * false - this operation still running. You can repeat request using operation Id.
  123. *
  124. * Generated from protobuf field <code>bool ready = 2;</code>
  125. * @param bool $var
  126. * @return $this
  127. */
  128. public function setReady($var)
  129. {
  130. GPBUtil::checkBool($var);
  131. $this->ready = $var;
  132. return $this;
  133. }
  134. /**
  135. * Generated from protobuf field <code>.Ydb.StatusIds.StatusCode status = 3;</code>
  136. * @return int
  137. */
  138. public function getStatus()
  139. {
  140. return $this->status;
  141. }
  142. /**
  143. * Generated from protobuf field <code>.Ydb.StatusIds.StatusCode status = 3;</code>
  144. * @param int $var
  145. * @return $this
  146. */
  147. public function setStatus($var)
  148. {
  149. GPBUtil::checkEnum($var, \Ydb\StatusIds\StatusCode::class);
  150. $this->status = $var;
  151. return $this;
  152. }
  153. /**
  154. * Generated from protobuf field <code>repeated .Ydb.Issue.IssueMessage issues = 4;</code>
  155. * @return \Google\Protobuf\Internal\RepeatedField
  156. */
  157. public function getIssues()
  158. {
  159. return $this->issues;
  160. }
  161. /**
  162. * Generated from protobuf field <code>repeated .Ydb.Issue.IssueMessage issues = 4;</code>
  163. * @param array<\Ydb\Issue\IssueMessage>|\Google\Protobuf\Internal\RepeatedField $var
  164. * @return $this
  165. */
  166. public function setIssues($var)
  167. {
  168. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Ydb\Issue\IssueMessage::class);
  169. $this->issues = $arr;
  170. return $this;
  171. }
  172. /**
  173. * Result data
  174. *
  175. * Generated from protobuf field <code>.google.protobuf.Any result = 5;</code>
  176. * @return \Google\Protobuf\Any|null
  177. */
  178. public function getResult()
  179. {
  180. return $this->result;
  181. }
  182. public function hasResult()
  183. {
  184. return isset($this->result);
  185. }
  186. public function clearResult()
  187. {
  188. unset($this->result);
  189. }
  190. /**
  191. * Result data
  192. *
  193. * Generated from protobuf field <code>.google.protobuf.Any result = 5;</code>
  194. * @param \Google\Protobuf\Any $var
  195. * @return $this
  196. */
  197. public function setResult($var)
  198. {
  199. GPBUtil::checkMessage($var, \Google\Protobuf\Any::class);
  200. $this->result = $var;
  201. return $this;
  202. }
  203. /**
  204. * Generated from protobuf field <code>.google.protobuf.Any metadata = 6;</code>
  205. * @return \Google\Protobuf\Any|null
  206. */
  207. public function getMetadata()
  208. {
  209. return $this->metadata;
  210. }
  211. public function hasMetadata()
  212. {
  213. return isset($this->metadata);
  214. }
  215. public function clearMetadata()
  216. {
  217. unset($this->metadata);
  218. }
  219. /**
  220. * Generated from protobuf field <code>.google.protobuf.Any metadata = 6;</code>
  221. * @param \Google\Protobuf\Any $var
  222. * @return $this
  223. */
  224. public function setMetadata($var)
  225. {
  226. GPBUtil::checkMessage($var, \Google\Protobuf\Any::class);
  227. $this->metadata = $var;
  228. return $this;
  229. }
  230. /**
  231. * Contains information about the cost of the operation.
  232. * For completed operations, it shows the final cost of the operation.
  233. * For operations in progress, it might indicate the current cost of the operation (if supported).
  234. *
  235. * Generated from protobuf field <code>.Ydb.CostInfo cost_info = 7;</code>
  236. * @return \Ydb\CostInfo|null
  237. */
  238. public function getCostInfo()
  239. {
  240. return $this->cost_info;
  241. }
  242. public function hasCostInfo()
  243. {
  244. return isset($this->cost_info);
  245. }
  246. public function clearCostInfo()
  247. {
  248. unset($this->cost_info);
  249. }
  250. /**
  251. * Contains information about the cost of the operation.
  252. * For completed operations, it shows the final cost of the operation.
  253. * For operations in progress, it might indicate the current cost of the operation (if supported).
  254. *
  255. * Generated from protobuf field <code>.Ydb.CostInfo cost_info = 7;</code>
  256. * @param \Ydb\CostInfo $var
  257. * @return $this
  258. */
  259. public function setCostInfo($var)
  260. {
  261. GPBUtil::checkMessage($var, \Ydb\CostInfo::class);
  262. $this->cost_info = $var;
  263. return $this;
  264. }
  265. }