CloudBuild.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  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 CloudBuild (v2).
  21. *
  22. * <p>
  23. * Creates and manages builds on Google Cloud Platform.</p>
  24. *
  25. * <p>
  26. * For more information about this service, see the API
  27. * <a href="https://cloud.google.com/cloud-build/docs/" target="_blank">Documentation</a>
  28. * </p>
  29. *
  30. * @author Google, Inc.
  31. */
  32. class CloudBuild 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_connections;
  39. public $projects_locations_connections_repositories;
  40. public $projects_locations_operations;
  41. public $rootUrlTemplate;
  42. /**
  43. * Constructs the internal representation of the CloudBuild service.
  44. *
  45. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  46. * config array to pass to a new Client instance.
  47. * @param string $rootUrl The root URL used for requests to the service.
  48. */
  49. public function __construct($clientOrConfig = [], $rootUrl = null)
  50. {
  51. parent::__construct($clientOrConfig);
  52. $this->rootUrl = $rootUrl ?: 'https://cloudbuild.googleapis.com/';
  53. $this->rootUrlTemplate = $rootUrl ?: 'https://cloudbuild.UNIVERSE_DOMAIN/';
  54. $this->servicePath = '';
  55. $this->batchPath = 'batch';
  56. $this->version = 'v2';
  57. $this->serviceName = 'cloudbuild';
  58. $this->projects_locations = new CloudBuild\Resource\ProjectsLocations(
  59. $this,
  60. $this->serviceName,
  61. 'locations',
  62. [
  63. 'methods' => [
  64. 'get' => [
  65. 'path' => 'v2/{+name}',
  66. 'httpMethod' => 'GET',
  67. 'parameters' => [
  68. 'name' => [
  69. 'location' => 'path',
  70. 'type' => 'string',
  71. 'required' => true,
  72. ],
  73. ],
  74. ],'list' => [
  75. 'path' => 'v2/{+name}/locations',
  76. 'httpMethod' => 'GET',
  77. 'parameters' => [
  78. 'name' => [
  79. 'location' => 'path',
  80. 'type' => 'string',
  81. 'required' => true,
  82. ],
  83. 'extraLocationTypes' => [
  84. 'location' => 'query',
  85. 'type' => 'string',
  86. 'repeated' => true,
  87. ],
  88. 'filter' => [
  89. 'location' => 'query',
  90. 'type' => 'string',
  91. ],
  92. 'pageSize' => [
  93. 'location' => 'query',
  94. 'type' => 'integer',
  95. ],
  96. 'pageToken' => [
  97. 'location' => 'query',
  98. 'type' => 'string',
  99. ],
  100. ],
  101. ],
  102. ]
  103. ]
  104. );
  105. $this->projects_locations_connections = new CloudBuild\Resource\ProjectsLocationsConnections(
  106. $this,
  107. $this->serviceName,
  108. 'connections',
  109. [
  110. 'methods' => [
  111. 'create' => [
  112. 'path' => 'v2/{+parent}/connections',
  113. 'httpMethod' => 'POST',
  114. 'parameters' => [
  115. 'parent' => [
  116. 'location' => 'path',
  117. 'type' => 'string',
  118. 'required' => true,
  119. ],
  120. 'connectionId' => [
  121. 'location' => 'query',
  122. 'type' => 'string',
  123. ],
  124. ],
  125. ],'delete' => [
  126. 'path' => 'v2/{+name}',
  127. 'httpMethod' => 'DELETE',
  128. 'parameters' => [
  129. 'name' => [
  130. 'location' => 'path',
  131. 'type' => 'string',
  132. 'required' => true,
  133. ],
  134. 'etag' => [
  135. 'location' => 'query',
  136. 'type' => 'string',
  137. ],
  138. 'validateOnly' => [
  139. 'location' => 'query',
  140. 'type' => 'boolean',
  141. ],
  142. ],
  143. ],'fetchLinkableRepositories' => [
  144. 'path' => 'v2/{+connection}:fetchLinkableRepositories',
  145. 'httpMethod' => 'GET',
  146. 'parameters' => [
  147. 'connection' => [
  148. 'location' => 'path',
  149. 'type' => 'string',
  150. 'required' => true,
  151. ],
  152. 'pageSize' => [
  153. 'location' => 'query',
  154. 'type' => 'integer',
  155. ],
  156. 'pageToken' => [
  157. 'location' => 'query',
  158. 'type' => 'string',
  159. ],
  160. ],
  161. ],'get' => [
  162. 'path' => 'v2/{+name}',
  163. 'httpMethod' => 'GET',
  164. 'parameters' => [
  165. 'name' => [
  166. 'location' => 'path',
  167. 'type' => 'string',
  168. 'required' => true,
  169. ],
  170. ],
  171. ],'getIamPolicy' => [
  172. 'path' => 'v2/{+resource}:getIamPolicy',
  173. 'httpMethod' => 'GET',
  174. 'parameters' => [
  175. 'resource' => [
  176. 'location' => 'path',
  177. 'type' => 'string',
  178. 'required' => true,
  179. ],
  180. 'options.requestedPolicyVersion' => [
  181. 'location' => 'query',
  182. 'type' => 'integer',
  183. ],
  184. ],
  185. ],'list' => [
  186. 'path' => 'v2/{+parent}/connections',
  187. 'httpMethod' => 'GET',
  188. 'parameters' => [
  189. 'parent' => [
  190. 'location' => 'path',
  191. 'type' => 'string',
  192. 'required' => true,
  193. ],
  194. 'pageSize' => [
  195. 'location' => 'query',
  196. 'type' => 'integer',
  197. ],
  198. 'pageToken' => [
  199. 'location' => 'query',
  200. 'type' => 'string',
  201. ],
  202. 'returnPartialSuccess' => [
  203. 'location' => 'query',
  204. 'type' => 'boolean',
  205. ],
  206. ],
  207. ],'patch' => [
  208. 'path' => 'v2/{+name}',
  209. 'httpMethod' => 'PATCH',
  210. 'parameters' => [
  211. 'name' => [
  212. 'location' => 'path',
  213. 'type' => 'string',
  214. 'required' => true,
  215. ],
  216. 'allowMissing' => [
  217. 'location' => 'query',
  218. 'type' => 'boolean',
  219. ],
  220. 'etag' => [
  221. 'location' => 'query',
  222. 'type' => 'string',
  223. ],
  224. 'updateMask' => [
  225. 'location' => 'query',
  226. 'type' => 'string',
  227. ],
  228. ],
  229. ],'processWebhook' => [
  230. 'path' => 'v2/{+parent}/connections:processWebhook',
  231. 'httpMethod' => 'POST',
  232. 'parameters' => [
  233. 'parent' => [
  234. 'location' => 'path',
  235. 'type' => 'string',
  236. 'required' => true,
  237. ],
  238. 'webhookKey' => [
  239. 'location' => 'query',
  240. 'type' => 'string',
  241. ],
  242. ],
  243. ],'setIamPolicy' => [
  244. 'path' => 'v2/{+resource}:setIamPolicy',
  245. 'httpMethod' => 'POST',
  246. 'parameters' => [
  247. 'resource' => [
  248. 'location' => 'path',
  249. 'type' => 'string',
  250. 'required' => true,
  251. ],
  252. ],
  253. ],'testIamPermissions' => [
  254. 'path' => 'v2/{+resource}:testIamPermissions',
  255. 'httpMethod' => 'POST',
  256. 'parameters' => [
  257. 'resource' => [
  258. 'location' => 'path',
  259. 'type' => 'string',
  260. 'required' => true,
  261. ],
  262. ],
  263. ],
  264. ]
  265. ]
  266. );
  267. $this->projects_locations_connections_repositories = new CloudBuild\Resource\ProjectsLocationsConnectionsRepositories(
  268. $this,
  269. $this->serviceName,
  270. 'repositories',
  271. [
  272. 'methods' => [
  273. 'accessReadToken' => [
  274. 'path' => 'v2/{+repository}:accessReadToken',
  275. 'httpMethod' => 'POST',
  276. 'parameters' => [
  277. 'repository' => [
  278. 'location' => 'path',
  279. 'type' => 'string',
  280. 'required' => true,
  281. ],
  282. ],
  283. ],'accessReadWriteToken' => [
  284. 'path' => 'v2/{+repository}:accessReadWriteToken',
  285. 'httpMethod' => 'POST',
  286. 'parameters' => [
  287. 'repository' => [
  288. 'location' => 'path',
  289. 'type' => 'string',
  290. 'required' => true,
  291. ],
  292. ],
  293. ],'batchCreate' => [
  294. 'path' => 'v2/{+parent}/repositories:batchCreate',
  295. 'httpMethod' => 'POST',
  296. 'parameters' => [
  297. 'parent' => [
  298. 'location' => 'path',
  299. 'type' => 'string',
  300. 'required' => true,
  301. ],
  302. ],
  303. ],'create' => [
  304. 'path' => 'v2/{+parent}/repositories',
  305. 'httpMethod' => 'POST',
  306. 'parameters' => [
  307. 'parent' => [
  308. 'location' => 'path',
  309. 'type' => 'string',
  310. 'required' => true,
  311. ],
  312. 'repositoryId' => [
  313. 'location' => 'query',
  314. 'type' => 'string',
  315. ],
  316. ],
  317. ],'delete' => [
  318. 'path' => 'v2/{+name}',
  319. 'httpMethod' => 'DELETE',
  320. 'parameters' => [
  321. 'name' => [
  322. 'location' => 'path',
  323. 'type' => 'string',
  324. 'required' => true,
  325. ],
  326. 'etag' => [
  327. 'location' => 'query',
  328. 'type' => 'string',
  329. ],
  330. 'validateOnly' => [
  331. 'location' => 'query',
  332. 'type' => 'boolean',
  333. ],
  334. ],
  335. ],'fetchGitRefs' => [
  336. 'path' => 'v2/{+repository}:fetchGitRefs',
  337. 'httpMethod' => 'GET',
  338. 'parameters' => [
  339. 'repository' => [
  340. 'location' => 'path',
  341. 'type' => 'string',
  342. 'required' => true,
  343. ],
  344. 'pageSize' => [
  345. 'location' => 'query',
  346. 'type' => 'integer',
  347. ],
  348. 'pageToken' => [
  349. 'location' => 'query',
  350. 'type' => 'string',
  351. ],
  352. 'refType' => [
  353. 'location' => 'query',
  354. 'type' => 'string',
  355. ],
  356. ],
  357. ],'get' => [
  358. 'path' => 'v2/{+name}',
  359. 'httpMethod' => 'GET',
  360. 'parameters' => [
  361. 'name' => [
  362. 'location' => 'path',
  363. 'type' => 'string',
  364. 'required' => true,
  365. ],
  366. ],
  367. ],'list' => [
  368. 'path' => 'v2/{+parent}/repositories',
  369. 'httpMethod' => 'GET',
  370. 'parameters' => [
  371. 'parent' => [
  372. 'location' => 'path',
  373. 'type' => 'string',
  374. 'required' => true,
  375. ],
  376. 'filter' => [
  377. 'location' => 'query',
  378. 'type' => 'string',
  379. ],
  380. 'pageSize' => [
  381. 'location' => 'query',
  382. 'type' => 'integer',
  383. ],
  384. 'pageToken' => [
  385. 'location' => 'query',
  386. 'type' => 'string',
  387. ],
  388. 'returnPartialSuccess' => [
  389. 'location' => 'query',
  390. 'type' => 'boolean',
  391. ],
  392. ],
  393. ],
  394. ]
  395. ]
  396. );
  397. $this->projects_locations_operations = new CloudBuild\Resource\ProjectsLocationsOperations(
  398. $this,
  399. $this->serviceName,
  400. 'operations',
  401. [
  402. 'methods' => [
  403. 'cancel' => [
  404. 'path' => 'v2/{+name}:cancel',
  405. 'httpMethod' => 'POST',
  406. 'parameters' => [
  407. 'name' => [
  408. 'location' => 'path',
  409. 'type' => 'string',
  410. 'required' => true,
  411. ],
  412. ],
  413. ],'get' => [
  414. 'path' => 'v2/{+name}',
  415. 'httpMethod' => 'GET',
  416. 'parameters' => [
  417. 'name' => [
  418. 'location' => 'path',
  419. 'type' => 'string',
  420. 'required' => true,
  421. ],
  422. ],
  423. ],
  424. ]
  425. ]
  426. );
  427. }
  428. }
  429. // Adding a class alias for backwards compatibility with the previous class name.
  430. class_alias(CloudBuild::class, 'Google_Service_CloudBuild');