PolicySimulator.php 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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 PolicySimulator (v1).
  21. *
  22. * <p>
  23. * Policy Simulator is a collection of endpoints for creating, running, and
  24. * viewing a Replay. A `Replay` is a type of simulation that lets you see how
  25. * your members' access to resources might change if you changed your IAM
  26. * policy. During a `Replay`, Policy Simulator re-evaluates, or replays, past
  27. * access attempts under both the current policy and your proposed policy, and
  28. * compares those results to determine how your members' access might change
  29. * under the proposed policy.</p>
  30. *
  31. * <p>
  32. * For more information about this service, see the API
  33. * <a href="https://cloud.google.com/iam/docs/simulating-access" target="_blank">Documentation</a>
  34. * </p>
  35. *
  36. * @author Google, Inc.
  37. */
  38. class PolicySimulator extends \Google\Service
  39. {
  40. /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */
  41. const CLOUD_PLATFORM =
  42. "https://www.googleapis.com/auth/cloud-platform";
  43. public $folders_locations_replays;
  44. public $folders_locations_replays_results;
  45. public $operations;
  46. public $organizations_locations_replays;
  47. public $organizations_locations_replays_results;
  48. public $projects_locations_replays;
  49. public $projects_locations_replays_results;
  50. /**
  51. * Constructs the internal representation of the PolicySimulator service.
  52. *
  53. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  54. * config array to pass to a new Client instance.
  55. * @param string $rootUrl The root URL used for requests to the service.
  56. */
  57. public function __construct($clientOrConfig = [], $rootUrl = null)
  58. {
  59. parent::__construct($clientOrConfig);
  60. $this->rootUrl = $rootUrl ?: 'https://policysimulator.googleapis.com/';
  61. $this->servicePath = '';
  62. $this->batchPath = 'batch';
  63. $this->version = 'v1';
  64. $this->serviceName = 'policysimulator';
  65. $this->folders_locations_replays = new PolicySimulator\Resource\FoldersLocationsReplays(
  66. $this,
  67. $this->serviceName,
  68. 'replays',
  69. [
  70. 'methods' => [
  71. 'create' => [
  72. 'path' => 'v1/{+parent}/replays',
  73. 'httpMethod' => 'POST',
  74. 'parameters' => [
  75. 'parent' => [
  76. 'location' => 'path',
  77. 'type' => 'string',
  78. 'required' => true,
  79. ],
  80. ],
  81. ],'get' => [
  82. 'path' => 'v1/{+name}',
  83. 'httpMethod' => 'GET',
  84. 'parameters' => [
  85. 'name' => [
  86. 'location' => 'path',
  87. 'type' => 'string',
  88. 'required' => true,
  89. ],
  90. ],
  91. ],
  92. ]
  93. ]
  94. );
  95. $this->folders_locations_replays_results = new PolicySimulator\Resource\FoldersLocationsReplaysResults(
  96. $this,
  97. $this->serviceName,
  98. 'results',
  99. [
  100. 'methods' => [
  101. 'list' => [
  102. 'path' => 'v1/{+parent}/results',
  103. 'httpMethod' => 'GET',
  104. 'parameters' => [
  105. 'parent' => [
  106. 'location' => 'path',
  107. 'type' => 'string',
  108. 'required' => true,
  109. ],
  110. 'pageSize' => [
  111. 'location' => 'query',
  112. 'type' => 'integer',
  113. ],
  114. 'pageToken' => [
  115. 'location' => 'query',
  116. 'type' => 'string',
  117. ],
  118. ],
  119. ],
  120. ]
  121. ]
  122. );
  123. $this->operations = new PolicySimulator\Resource\Operations(
  124. $this,
  125. $this->serviceName,
  126. 'operations',
  127. [
  128. 'methods' => [
  129. 'get' => [
  130. 'path' => 'v1/{+name}',
  131. 'httpMethod' => 'GET',
  132. 'parameters' => [
  133. 'name' => [
  134. 'location' => 'path',
  135. 'type' => 'string',
  136. 'required' => true,
  137. ],
  138. ],
  139. ],'list' => [
  140. 'path' => 'v1/operations',
  141. 'httpMethod' => 'GET',
  142. 'parameters' => [
  143. 'filter' => [
  144. 'location' => 'query',
  145. 'type' => 'string',
  146. ],
  147. 'name' => [
  148. 'location' => 'query',
  149. 'type' => 'string',
  150. ],
  151. 'pageSize' => [
  152. 'location' => 'query',
  153. 'type' => 'integer',
  154. ],
  155. 'pageToken' => [
  156. 'location' => 'query',
  157. 'type' => 'string',
  158. ],
  159. ],
  160. ],
  161. ]
  162. ]
  163. );
  164. $this->organizations_locations_replays = new PolicySimulator\Resource\OrganizationsLocationsReplays(
  165. $this,
  166. $this->serviceName,
  167. 'replays',
  168. [
  169. 'methods' => [
  170. 'create' => [
  171. 'path' => 'v1/{+parent}/replays',
  172. 'httpMethod' => 'POST',
  173. 'parameters' => [
  174. 'parent' => [
  175. 'location' => 'path',
  176. 'type' => 'string',
  177. 'required' => true,
  178. ],
  179. ],
  180. ],'get' => [
  181. 'path' => 'v1/{+name}',
  182. 'httpMethod' => 'GET',
  183. 'parameters' => [
  184. 'name' => [
  185. 'location' => 'path',
  186. 'type' => 'string',
  187. 'required' => true,
  188. ],
  189. ],
  190. ],
  191. ]
  192. ]
  193. );
  194. $this->organizations_locations_replays_results = new PolicySimulator\Resource\OrganizationsLocationsReplaysResults(
  195. $this,
  196. $this->serviceName,
  197. 'results',
  198. [
  199. 'methods' => [
  200. 'list' => [
  201. 'path' => 'v1/{+parent}/results',
  202. 'httpMethod' => 'GET',
  203. 'parameters' => [
  204. 'parent' => [
  205. 'location' => 'path',
  206. 'type' => 'string',
  207. 'required' => true,
  208. ],
  209. 'pageSize' => [
  210. 'location' => 'query',
  211. 'type' => 'integer',
  212. ],
  213. 'pageToken' => [
  214. 'location' => 'query',
  215. 'type' => 'string',
  216. ],
  217. ],
  218. ],
  219. ]
  220. ]
  221. );
  222. $this->projects_locations_replays = new PolicySimulator\Resource\ProjectsLocationsReplays(
  223. $this,
  224. $this->serviceName,
  225. 'replays',
  226. [
  227. 'methods' => [
  228. 'create' => [
  229. 'path' => 'v1/{+parent}/replays',
  230. 'httpMethod' => 'POST',
  231. 'parameters' => [
  232. 'parent' => [
  233. 'location' => 'path',
  234. 'type' => 'string',
  235. 'required' => true,
  236. ],
  237. ],
  238. ],'get' => [
  239. 'path' => 'v1/{+name}',
  240. 'httpMethod' => 'GET',
  241. 'parameters' => [
  242. 'name' => [
  243. 'location' => 'path',
  244. 'type' => 'string',
  245. 'required' => true,
  246. ],
  247. ],
  248. ],
  249. ]
  250. ]
  251. );
  252. $this->projects_locations_replays_results = new PolicySimulator\Resource\ProjectsLocationsReplaysResults(
  253. $this,
  254. $this->serviceName,
  255. 'results',
  256. [
  257. 'methods' => [
  258. 'list' => [
  259. 'path' => 'v1/{+parent}/results',
  260. 'httpMethod' => 'GET',
  261. 'parameters' => [
  262. 'parent' => [
  263. 'location' => 'path',
  264. 'type' => 'string',
  265. 'required' => true,
  266. ],
  267. 'pageSize' => [
  268. 'location' => 'query',
  269. 'type' => 'integer',
  270. ],
  271. 'pageToken' => [
  272. 'location' => 'query',
  273. 'type' => 'string',
  274. ],
  275. ],
  276. ],
  277. ]
  278. ]
  279. );
  280. }
  281. }
  282. // Adding a class alias for backwards compatibility with the previous class name.
  283. class_alias(PolicySimulator::class, 'Google_Service_PolicySimulator');