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