SecretManager.php 17 KB

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