Operation.php 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <?php
  2. /*
  3. * Copyright 2014 Google Inc.
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  6. * use this file except in compliance with the License. You may obtain a copy of
  7. * the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  13. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  14. * License for the specific language governing permissions and limitations under
  15. * the License.
  16. */
  17. namespace Google\Service\CertificateManager;
  18. class Operation extends \Google\Model
  19. {
  20. /**
  21. * If the value is `false`, it means the operation is still in progress. If
  22. * `true`, the operation is completed, and either `error` or `response` is
  23. * available.
  24. *
  25. * @var bool
  26. */
  27. public $done;
  28. protected $errorType = Status::class;
  29. protected $errorDataType = '';
  30. /**
  31. * Service-specific metadata associated with the operation. It typically
  32. * contains progress information and common metadata such as create time. Some
  33. * services might not provide such metadata. Any method that returns a long-
  34. * running operation should document the metadata type, if any.
  35. *
  36. * @var array[]
  37. */
  38. public $metadata;
  39. /**
  40. * The server-assigned name, which is only unique within the same service that
  41. * originally returns it. If you use the default HTTP mapping, the `name`
  42. * should be a resource name ending with `operations/{unique_id}`.
  43. *
  44. * @var string
  45. */
  46. public $name;
  47. /**
  48. * The normal, successful response of the operation. If the original method
  49. * returns no data on success, such as `Delete`, the response is
  50. * `google.protobuf.Empty`. If the original method is standard
  51. * `Get`/`Create`/`Update`, the response should be the resource. For other
  52. * methods, the response should have the type `XxxResponse`, where `Xxx` is
  53. * the original method name. For example, if the original method name is
  54. * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
  55. *
  56. * @var array[]
  57. */
  58. public $response;
  59. /**
  60. * If the value is `false`, it means the operation is still in progress. If
  61. * `true`, the operation is completed, and either `error` or `response` is
  62. * available.
  63. *
  64. * @param bool $done
  65. */
  66. public function setDone($done)
  67. {
  68. $this->done = $done;
  69. }
  70. /**
  71. * @return bool
  72. */
  73. public function getDone()
  74. {
  75. return $this->done;
  76. }
  77. /**
  78. * The error result of the operation in case of failure or cancellation.
  79. *
  80. * @param Status $error
  81. */
  82. public function setError(Status $error)
  83. {
  84. $this->error = $error;
  85. }
  86. /**
  87. * @return Status
  88. */
  89. public function getError()
  90. {
  91. return $this->error;
  92. }
  93. /**
  94. * Service-specific metadata associated with the operation. It typically
  95. * contains progress information and common metadata such as create time. Some
  96. * services might not provide such metadata. Any method that returns a long-
  97. * running operation should document the metadata type, if any.
  98. *
  99. * @param array[] $metadata
  100. */
  101. public function setMetadata($metadata)
  102. {
  103. $this->metadata = $metadata;
  104. }
  105. /**
  106. * @return array[]
  107. */
  108. public function getMetadata()
  109. {
  110. return $this->metadata;
  111. }
  112. /**
  113. * The server-assigned name, which is only unique within the same service that
  114. * originally returns it. If you use the default HTTP mapping, the `name`
  115. * should be a resource name ending with `operations/{unique_id}`.
  116. *
  117. * @param string $name
  118. */
  119. public function setName($name)
  120. {
  121. $this->name = $name;
  122. }
  123. /**
  124. * @return string
  125. */
  126. public function getName()
  127. {
  128. return $this->name;
  129. }
  130. /**
  131. * The normal, successful response of the operation. If the original method
  132. * returns no data on success, such as `Delete`, the response is
  133. * `google.protobuf.Empty`. If the original method is standard
  134. * `Get`/`Create`/`Update`, the response should be the resource. For other
  135. * methods, the response should have the type `XxxResponse`, where `Xxx` is
  136. * the original method name. For example, if the original method name is
  137. * `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
  138. *
  139. * @param array[] $response
  140. */
  141. public function setResponse($response)
  142. {
  143. $this->response = $response;
  144. }
  145. /**
  146. * @return array[]
  147. */
  148. public function getResponse()
  149. {
  150. return $this->response;
  151. }
  152. }
  153. // Adding a class alias for backwards compatibility with the previous class name.
  154. class_alias(Operation::class, 'Google_Service_CertificateManager_Operation');