CloudRun.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559
  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 CloudRun (v2).
  21. *
  22. * <p>
  23. * Deploy and manage user provided container images that scale automatically
  24. * based on incoming requests. The Cloud Run Admin API v1 follows the Knative
  25. * Serving API specification, while v2 is aligned with Google Cloud AIP-based
  26. * API standards, as described in https://google.aip.dev/.</p>
  27. *
  28. * <p>
  29. * For more information about this service, see the API
  30. * <a href="https://cloud.google.com/run/" target="_blank">Documentation</a>
  31. * </p>
  32. *
  33. * @author Google, Inc.
  34. */
  35. class CloudRun extends \Google\Service
  36. {
  37. /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */
  38. const CLOUD_PLATFORM =
  39. "https://www.googleapis.com/auth/cloud-platform";
  40. public $projects_locations_jobs;
  41. public $projects_locations_jobs_executions;
  42. public $projects_locations_jobs_executions_tasks;
  43. public $projects_locations_operations;
  44. public $projects_locations_services;
  45. public $projects_locations_services_revisions;
  46. /**
  47. * Constructs the internal representation of the CloudRun service.
  48. *
  49. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  50. * config array to pass to a new Client instance.
  51. * @param string $rootUrl The root URL used for requests to the service.
  52. */
  53. public function __construct($clientOrConfig = [], $rootUrl = null)
  54. {
  55. parent::__construct($clientOrConfig);
  56. $this->rootUrl = $rootUrl ?: 'https://run.googleapis.com/';
  57. $this->servicePath = '';
  58. $this->batchPath = 'batch';
  59. $this->version = 'v2';
  60. $this->serviceName = 'run';
  61. $this->projects_locations_jobs = new CloudRun\Resource\ProjectsLocationsJobs(
  62. $this,
  63. $this->serviceName,
  64. 'jobs',
  65. [
  66. 'methods' => [
  67. 'create' => [
  68. 'path' => 'v2/{+parent}/jobs',
  69. 'httpMethod' => 'POST',
  70. 'parameters' => [
  71. 'parent' => [
  72. 'location' => 'path',
  73. 'type' => 'string',
  74. 'required' => true,
  75. ],
  76. 'jobId' => [
  77. 'location' => 'query',
  78. 'type' => 'string',
  79. ],
  80. 'validateOnly' => [
  81. 'location' => 'query',
  82. 'type' => 'boolean',
  83. ],
  84. ],
  85. ],'delete' => [
  86. 'path' => 'v2/{+name}',
  87. 'httpMethod' => 'DELETE',
  88. 'parameters' => [
  89. 'name' => [
  90. 'location' => 'path',
  91. 'type' => 'string',
  92. 'required' => true,
  93. ],
  94. 'etag' => [
  95. 'location' => 'query',
  96. 'type' => 'string',
  97. ],
  98. 'force' => [
  99. 'location' => 'query',
  100. 'type' => 'boolean',
  101. ],
  102. 'validateOnly' => [
  103. 'location' => 'query',
  104. 'type' => 'boolean',
  105. ],
  106. ],
  107. ],'get' => [
  108. 'path' => 'v2/{+name}',
  109. 'httpMethod' => 'GET',
  110. 'parameters' => [
  111. 'name' => [
  112. 'location' => 'path',
  113. 'type' => 'string',
  114. 'required' => true,
  115. ],
  116. ],
  117. ],'getIamPolicy' => [
  118. 'path' => 'v2/{+resource}:getIamPolicy',
  119. 'httpMethod' => 'GET',
  120. 'parameters' => [
  121. 'resource' => [
  122. 'location' => 'path',
  123. 'type' => 'string',
  124. 'required' => true,
  125. ],
  126. 'options.requestedPolicyVersion' => [
  127. 'location' => 'query',
  128. 'type' => 'integer',
  129. ],
  130. ],
  131. ],'list' => [
  132. 'path' => 'v2/{+parent}/jobs',
  133. 'httpMethod' => 'GET',
  134. 'parameters' => [
  135. 'parent' => [
  136. 'location' => 'path',
  137. 'type' => 'string',
  138. 'required' => true,
  139. ],
  140. 'pageSize' => [
  141. 'location' => 'query',
  142. 'type' => 'integer',
  143. ],
  144. 'pageToken' => [
  145. 'location' => 'query',
  146. 'type' => 'string',
  147. ],
  148. 'showDeleted' => [
  149. 'location' => 'query',
  150. 'type' => 'boolean',
  151. ],
  152. ],
  153. ],'patch' => [
  154. 'path' => 'v2/{+name}',
  155. 'httpMethod' => 'PATCH',
  156. 'parameters' => [
  157. 'name' => [
  158. 'location' => 'path',
  159. 'type' => 'string',
  160. 'required' => true,
  161. ],
  162. 'allowMissing' => [
  163. 'location' => 'query',
  164. 'type' => 'boolean',
  165. ],
  166. 'validateOnly' => [
  167. 'location' => 'query',
  168. 'type' => 'boolean',
  169. ],
  170. ],
  171. ],'run' => [
  172. 'path' => 'v2/{+name}:run',
  173. 'httpMethod' => 'POST',
  174. 'parameters' => [
  175. 'name' => [
  176. 'location' => 'path',
  177. 'type' => 'string',
  178. 'required' => true,
  179. ],
  180. ],
  181. ],'setIamPolicy' => [
  182. 'path' => 'v2/{+resource}:setIamPolicy',
  183. 'httpMethod' => 'POST',
  184. 'parameters' => [
  185. 'resource' => [
  186. 'location' => 'path',
  187. 'type' => 'string',
  188. 'required' => true,
  189. ],
  190. ],
  191. ],'testIamPermissions' => [
  192. 'path' => 'v2/{+resource}:testIamPermissions',
  193. 'httpMethod' => 'POST',
  194. 'parameters' => [
  195. 'resource' => [
  196. 'location' => 'path',
  197. 'type' => 'string',
  198. 'required' => true,
  199. ],
  200. ],
  201. ],
  202. ]
  203. ]
  204. );
  205. $this->projects_locations_jobs_executions = new CloudRun\Resource\ProjectsLocationsJobsExecutions(
  206. $this,
  207. $this->serviceName,
  208. 'executions',
  209. [
  210. 'methods' => [
  211. 'delete' => [
  212. 'path' => 'v2/{+name}',
  213. 'httpMethod' => 'DELETE',
  214. 'parameters' => [
  215. 'name' => [
  216. 'location' => 'path',
  217. 'type' => 'string',
  218. 'required' => true,
  219. ],
  220. 'etag' => [
  221. 'location' => 'query',
  222. 'type' => 'string',
  223. ],
  224. 'validateOnly' => [
  225. 'location' => 'query',
  226. 'type' => 'boolean',
  227. ],
  228. ],
  229. ],'get' => [
  230. 'path' => 'v2/{+name}',
  231. 'httpMethod' => 'GET',
  232. 'parameters' => [
  233. 'name' => [
  234. 'location' => 'path',
  235. 'type' => 'string',
  236. 'required' => true,
  237. ],
  238. ],
  239. ],'list' => [
  240. 'path' => 'v2/{+parent}/executions',
  241. 'httpMethod' => 'GET',
  242. 'parameters' => [
  243. 'parent' => [
  244. 'location' => 'path',
  245. 'type' => 'string',
  246. 'required' => true,
  247. ],
  248. 'pageSize' => [
  249. 'location' => 'query',
  250. 'type' => 'integer',
  251. ],
  252. 'pageToken' => [
  253. 'location' => 'query',
  254. 'type' => 'string',
  255. ],
  256. 'showDeleted' => [
  257. 'location' => 'query',
  258. 'type' => 'boolean',
  259. ],
  260. ],
  261. ],
  262. ]
  263. ]
  264. );
  265. $this->projects_locations_jobs_executions_tasks = new CloudRun\Resource\ProjectsLocationsJobsExecutionsTasks(
  266. $this,
  267. $this->serviceName,
  268. 'tasks',
  269. [
  270. 'methods' => [
  271. 'get' => [
  272. 'path' => 'v2/{+name}',
  273. 'httpMethod' => 'GET',
  274. 'parameters' => [
  275. 'name' => [
  276. 'location' => 'path',
  277. 'type' => 'string',
  278. 'required' => true,
  279. ],
  280. ],
  281. ],'list' => [
  282. 'path' => 'v2/{+parent}/tasks',
  283. 'httpMethod' => 'GET',
  284. 'parameters' => [
  285. 'parent' => [
  286. 'location' => 'path',
  287. 'type' => 'string',
  288. 'required' => true,
  289. ],
  290. 'pageSize' => [
  291. 'location' => 'query',
  292. 'type' => 'integer',
  293. ],
  294. 'pageToken' => [
  295. 'location' => 'query',
  296. 'type' => 'string',
  297. ],
  298. 'showDeleted' => [
  299. 'location' => 'query',
  300. 'type' => 'boolean',
  301. ],
  302. ],
  303. ],
  304. ]
  305. ]
  306. );
  307. $this->projects_locations_operations = new CloudRun\Resource\ProjectsLocationsOperations(
  308. $this,
  309. $this->serviceName,
  310. 'operations',
  311. [
  312. 'methods' => [
  313. 'delete' => [
  314. 'path' => 'v2/{+name}',
  315. 'httpMethod' => 'DELETE',
  316. 'parameters' => [
  317. 'name' => [
  318. 'location' => 'path',
  319. 'type' => 'string',
  320. 'required' => true,
  321. ],
  322. ],
  323. ],'get' => [
  324. 'path' => 'v2/{+name}',
  325. 'httpMethod' => 'GET',
  326. 'parameters' => [
  327. 'name' => [
  328. 'location' => 'path',
  329. 'type' => 'string',
  330. 'required' => true,
  331. ],
  332. ],
  333. ],'list' => [
  334. 'path' => 'v2/{+name}/operations',
  335. 'httpMethod' => 'GET',
  336. 'parameters' => [
  337. 'name' => [
  338. 'location' => 'path',
  339. 'type' => 'string',
  340. 'required' => true,
  341. ],
  342. 'filter' => [
  343. 'location' => 'query',
  344. 'type' => 'string',
  345. ],
  346. 'pageSize' => [
  347. 'location' => 'query',
  348. 'type' => 'integer',
  349. ],
  350. 'pageToken' => [
  351. 'location' => 'query',
  352. 'type' => 'string',
  353. ],
  354. ],
  355. ],
  356. ]
  357. ]
  358. );
  359. $this->projects_locations_services = new CloudRun\Resource\ProjectsLocationsServices(
  360. $this,
  361. $this->serviceName,
  362. 'services',
  363. [
  364. 'methods' => [
  365. 'create' => [
  366. 'path' => 'v2/{+parent}/services',
  367. 'httpMethod' => 'POST',
  368. 'parameters' => [
  369. 'parent' => [
  370. 'location' => 'path',
  371. 'type' => 'string',
  372. 'required' => true,
  373. ],
  374. 'serviceId' => [
  375. 'location' => 'query',
  376. 'type' => 'string',
  377. ],
  378. 'validateOnly' => [
  379. 'location' => 'query',
  380. 'type' => 'boolean',
  381. ],
  382. ],
  383. ],'delete' => [
  384. 'path' => 'v2/{+name}',
  385. 'httpMethod' => 'DELETE',
  386. 'parameters' => [
  387. 'name' => [
  388. 'location' => 'path',
  389. 'type' => 'string',
  390. 'required' => true,
  391. ],
  392. 'etag' => [
  393. 'location' => 'query',
  394. 'type' => 'string',
  395. ],
  396. 'validateOnly' => [
  397. 'location' => 'query',
  398. 'type' => 'boolean',
  399. ],
  400. ],
  401. ],'get' => [
  402. 'path' => 'v2/{+name}',
  403. 'httpMethod' => 'GET',
  404. 'parameters' => [
  405. 'name' => [
  406. 'location' => 'path',
  407. 'type' => 'string',
  408. 'required' => true,
  409. ],
  410. ],
  411. ],'getIamPolicy' => [
  412. 'path' => 'v2/{+resource}:getIamPolicy',
  413. 'httpMethod' => 'GET',
  414. 'parameters' => [
  415. 'resource' => [
  416. 'location' => 'path',
  417. 'type' => 'string',
  418. 'required' => true,
  419. ],
  420. 'options.requestedPolicyVersion' => [
  421. 'location' => 'query',
  422. 'type' => 'integer',
  423. ],
  424. ],
  425. ],'list' => [
  426. 'path' => 'v2/{+parent}/services',
  427. 'httpMethod' => 'GET',
  428. 'parameters' => [
  429. 'parent' => [
  430. 'location' => 'path',
  431. 'type' => 'string',
  432. 'required' => true,
  433. ],
  434. 'pageSize' => [
  435. 'location' => 'query',
  436. 'type' => 'integer',
  437. ],
  438. 'pageToken' => [
  439. 'location' => 'query',
  440. 'type' => 'string',
  441. ],
  442. 'showDeleted' => [
  443. 'location' => 'query',
  444. 'type' => 'boolean',
  445. ],
  446. ],
  447. ],'patch' => [
  448. 'path' => 'v2/{+name}',
  449. 'httpMethod' => 'PATCH',
  450. 'parameters' => [
  451. 'name' => [
  452. 'location' => 'path',
  453. 'type' => 'string',
  454. 'required' => true,
  455. ],
  456. 'allowMissing' => [
  457. 'location' => 'query',
  458. 'type' => 'boolean',
  459. ],
  460. 'validateOnly' => [
  461. 'location' => 'query',
  462. 'type' => 'boolean',
  463. ],
  464. ],
  465. ],'setIamPolicy' => [
  466. 'path' => 'v2/{+resource}:setIamPolicy',
  467. 'httpMethod' => 'POST',
  468. 'parameters' => [
  469. 'resource' => [
  470. 'location' => 'path',
  471. 'type' => 'string',
  472. 'required' => true,
  473. ],
  474. ],
  475. ],'testIamPermissions' => [
  476. 'path' => 'v2/{+resource}:testIamPermissions',
  477. 'httpMethod' => 'POST',
  478. 'parameters' => [
  479. 'resource' => [
  480. 'location' => 'path',
  481. 'type' => 'string',
  482. 'required' => true,
  483. ],
  484. ],
  485. ],
  486. ]
  487. ]
  488. );
  489. $this->projects_locations_services_revisions = new CloudRun\Resource\ProjectsLocationsServicesRevisions(
  490. $this,
  491. $this->serviceName,
  492. 'revisions',
  493. [
  494. 'methods' => [
  495. 'delete' => [
  496. 'path' => 'v2/{+name}',
  497. 'httpMethod' => 'DELETE',
  498. 'parameters' => [
  499. 'name' => [
  500. 'location' => 'path',
  501. 'type' => 'string',
  502. 'required' => true,
  503. ],
  504. 'etag' => [
  505. 'location' => 'query',
  506. 'type' => 'string',
  507. ],
  508. 'validateOnly' => [
  509. 'location' => 'query',
  510. 'type' => 'boolean',
  511. ],
  512. ],
  513. ],'get' => [
  514. 'path' => 'v2/{+name}',
  515. 'httpMethod' => 'GET',
  516. 'parameters' => [
  517. 'name' => [
  518. 'location' => 'path',
  519. 'type' => 'string',
  520. 'required' => true,
  521. ],
  522. ],
  523. ],'list' => [
  524. 'path' => 'v2/{+parent}/revisions',
  525. 'httpMethod' => 'GET',
  526. 'parameters' => [
  527. 'parent' => [
  528. 'location' => 'path',
  529. 'type' => 'string',
  530. 'required' => true,
  531. ],
  532. 'pageSize' => [
  533. 'location' => 'query',
  534. 'type' => 'integer',
  535. ],
  536. 'pageToken' => [
  537. 'location' => 'query',
  538. 'type' => 'string',
  539. ],
  540. 'showDeleted' => [
  541. 'location' => 'query',
  542. 'type' => 'boolean',
  543. ],
  544. ],
  545. ],
  546. ]
  547. ]
  548. );
  549. }
  550. }
  551. // Adding a class alias for backwards compatibility with the previous class name.
  552. class_alias(CloudRun::class, 'Google_Service_CloudRun');