CloudTasks.php 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  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;
  18. use Google\Client;
  19. /**
  20. * Service definition for CloudTasks (v2).
  21. *
  22. * <p>
  23. * Manages the execution of large numbers of distributed requests.</p>
  24. *
  25. * <p>
  26. * For more information about this service, see the API
  27. * <a href="https://cloud.google.com/tasks/" target="_blank">Documentation</a>
  28. * </p>
  29. *
  30. * @author Google, Inc.
  31. */
  32. class CloudTasks extends \Google\Service
  33. {
  34. /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */
  35. const CLOUD_PLATFORM =
  36. "https://www.googleapis.com/auth/cloud-platform";
  37. public $projects_locations;
  38. public $projects_locations_queues;
  39. public $projects_locations_queues_tasks;
  40. /**
  41. * Constructs the internal representation of the CloudTasks service.
  42. *
  43. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  44. * config array to pass to a new Client instance.
  45. * @param string $rootUrl The root URL used for requests to the service.
  46. */
  47. public function __construct($clientOrConfig = [], $rootUrl = null)
  48. {
  49. parent::__construct($clientOrConfig);
  50. $this->rootUrl = $rootUrl ?: 'https://cloudtasks.googleapis.com/';
  51. $this->servicePath = '';
  52. $this->batchPath = 'batch';
  53. $this->version = 'v2';
  54. $this->serviceName = 'cloudtasks';
  55. $this->projects_locations = new CloudTasks\Resource\ProjectsLocations(
  56. $this,
  57. $this->serviceName,
  58. 'locations',
  59. [
  60. 'methods' => [
  61. 'get' => [
  62. 'path' => 'v2/{+name}',
  63. 'httpMethod' => 'GET',
  64. 'parameters' => [
  65. 'name' => [
  66. 'location' => 'path',
  67. 'type' => 'string',
  68. 'required' => true,
  69. ],
  70. ],
  71. ],'list' => [
  72. 'path' => 'v2/{+name}/locations',
  73. 'httpMethod' => 'GET',
  74. 'parameters' => [
  75. 'name' => [
  76. 'location' => 'path',
  77. 'type' => 'string',
  78. 'required' => true,
  79. ],
  80. 'filter' => [
  81. 'location' => 'query',
  82. 'type' => 'string',
  83. ],
  84. 'pageSize' => [
  85. 'location' => 'query',
  86. 'type' => 'integer',
  87. ],
  88. 'pageToken' => [
  89. 'location' => 'query',
  90. 'type' => 'string',
  91. ],
  92. ],
  93. ],
  94. ]
  95. ]
  96. );
  97. $this->projects_locations_queues = new CloudTasks\Resource\ProjectsLocationsQueues(
  98. $this,
  99. $this->serviceName,
  100. 'queues',
  101. [
  102. 'methods' => [
  103. 'create' => [
  104. 'path' => 'v2/{+parent}/queues',
  105. 'httpMethod' => 'POST',
  106. 'parameters' => [
  107. 'parent' => [
  108. 'location' => 'path',
  109. 'type' => 'string',
  110. 'required' => true,
  111. ],
  112. ],
  113. ],'delete' => [
  114. 'path' => 'v2/{+name}',
  115. 'httpMethod' => 'DELETE',
  116. 'parameters' => [
  117. 'name' => [
  118. 'location' => 'path',
  119. 'type' => 'string',
  120. 'required' => true,
  121. ],
  122. ],
  123. ],'get' => [
  124. 'path' => 'v2/{+name}',
  125. 'httpMethod' => 'GET',
  126. 'parameters' => [
  127. 'name' => [
  128. 'location' => 'path',
  129. 'type' => 'string',
  130. 'required' => true,
  131. ],
  132. ],
  133. ],'getIamPolicy' => [
  134. 'path' => 'v2/{+resource}:getIamPolicy',
  135. 'httpMethod' => 'POST',
  136. 'parameters' => [
  137. 'resource' => [
  138. 'location' => 'path',
  139. 'type' => 'string',
  140. 'required' => true,
  141. ],
  142. ],
  143. ],'list' => [
  144. 'path' => 'v2/{+parent}/queues',
  145. 'httpMethod' => 'GET',
  146. 'parameters' => [
  147. 'parent' => [
  148. 'location' => 'path',
  149. 'type' => 'string',
  150. 'required' => true,
  151. ],
  152. 'filter' => [
  153. 'location' => 'query',
  154. 'type' => 'string',
  155. ],
  156. 'pageSize' => [
  157. 'location' => 'query',
  158. 'type' => 'integer',
  159. ],
  160. 'pageToken' => [
  161. 'location' => 'query',
  162. 'type' => 'string',
  163. ],
  164. ],
  165. ],'patch' => [
  166. 'path' => 'v2/{+name}',
  167. 'httpMethod' => 'PATCH',
  168. 'parameters' => [
  169. 'name' => [
  170. 'location' => 'path',
  171. 'type' => 'string',
  172. 'required' => true,
  173. ],
  174. 'updateMask' => [
  175. 'location' => 'query',
  176. 'type' => 'string',
  177. ],
  178. ],
  179. ],'pause' => [
  180. 'path' => 'v2/{+name}:pause',
  181. 'httpMethod' => 'POST',
  182. 'parameters' => [
  183. 'name' => [
  184. 'location' => 'path',
  185. 'type' => 'string',
  186. 'required' => true,
  187. ],
  188. ],
  189. ],'purge' => [
  190. 'path' => 'v2/{+name}:purge',
  191. 'httpMethod' => 'POST',
  192. 'parameters' => [
  193. 'name' => [
  194. 'location' => 'path',
  195. 'type' => 'string',
  196. 'required' => true,
  197. ],
  198. ],
  199. ],'resume' => [
  200. 'path' => 'v2/{+name}:resume',
  201. 'httpMethod' => 'POST',
  202. 'parameters' => [
  203. 'name' => [
  204. 'location' => 'path',
  205. 'type' => 'string',
  206. 'required' => true,
  207. ],
  208. ],
  209. ],'setIamPolicy' => [
  210. 'path' => 'v2/{+resource}:setIamPolicy',
  211. 'httpMethod' => 'POST',
  212. 'parameters' => [
  213. 'resource' => [
  214. 'location' => 'path',
  215. 'type' => 'string',
  216. 'required' => true,
  217. ],
  218. ],
  219. ],'testIamPermissions' => [
  220. 'path' => 'v2/{+resource}:testIamPermissions',
  221. 'httpMethod' => 'POST',
  222. 'parameters' => [
  223. 'resource' => [
  224. 'location' => 'path',
  225. 'type' => 'string',
  226. 'required' => true,
  227. ],
  228. ],
  229. ],
  230. ]
  231. ]
  232. );
  233. $this->projects_locations_queues_tasks = new CloudTasks\Resource\ProjectsLocationsQueuesTasks(
  234. $this,
  235. $this->serviceName,
  236. 'tasks',
  237. [
  238. 'methods' => [
  239. 'create' => [
  240. 'path' => 'v2/{+parent}/tasks',
  241. 'httpMethod' => 'POST',
  242. 'parameters' => [
  243. 'parent' => [
  244. 'location' => 'path',
  245. 'type' => 'string',
  246. 'required' => true,
  247. ],
  248. ],
  249. ],'delete' => [
  250. 'path' => 'v2/{+name}',
  251. 'httpMethod' => 'DELETE',
  252. 'parameters' => [
  253. 'name' => [
  254. 'location' => 'path',
  255. 'type' => 'string',
  256. 'required' => true,
  257. ],
  258. ],
  259. ],'get' => [
  260. 'path' => 'v2/{+name}',
  261. 'httpMethod' => 'GET',
  262. 'parameters' => [
  263. 'name' => [
  264. 'location' => 'path',
  265. 'type' => 'string',
  266. 'required' => true,
  267. ],
  268. 'responseView' => [
  269. 'location' => 'query',
  270. 'type' => 'string',
  271. ],
  272. ],
  273. ],'list' => [
  274. 'path' => 'v2/{+parent}/tasks',
  275. 'httpMethod' => 'GET',
  276. 'parameters' => [
  277. 'parent' => [
  278. 'location' => 'path',
  279. 'type' => 'string',
  280. 'required' => true,
  281. ],
  282. 'pageSize' => [
  283. 'location' => 'query',
  284. 'type' => 'integer',
  285. ],
  286. 'pageToken' => [
  287. 'location' => 'query',
  288. 'type' => 'string',
  289. ],
  290. 'responseView' => [
  291. 'location' => 'query',
  292. 'type' => 'string',
  293. ],
  294. ],
  295. ],'run' => [
  296. 'path' => 'v2/{+name}:run',
  297. 'httpMethod' => 'POST',
  298. 'parameters' => [
  299. 'name' => [
  300. 'location' => 'path',
  301. 'type' => 'string',
  302. 'required' => true,
  303. ],
  304. ],
  305. ],
  306. ]
  307. ]
  308. );
  309. }
  310. }
  311. // Adding a class alias for backwards compatibility with the previous class name.
  312. class_alias(CloudTasks::class, 'Google_Service_CloudTasks');