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 CloudAsset (v1).
24 *
25 * <p>
26 * The cloud asset API manages the history and inventory of cloud resources.</p>
27 *
28 * <p>
29 * For more information about this service, see the API
30 * <a href="https://cloud.google.com/asset-inventory/docs/quickstart" target="_blank">Documentation</a>
31 * </p>
32 *
33 * @author Google, Inc.
34 */
35class CloudAsset 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
41  public $assets;
42  public $effectiveIamPolicies;
43  public $feeds;
44  public $operations;
45  public $savedQueries;
46  public $v1;
47
48  /**
49   * Constructs the internal representation of the CloudAsset service.
50   *
51   * @param Client|array $clientOrConfig The client used to deliver requests, or a
52   *                                     config array to pass to a new Client instance.
53   * @param string $rootUrl The root URL used for requests to the service.
54   */
55  public function __construct($clientOrConfig = [], $rootUrl = null)
56  {
57    parent::__construct($clientOrConfig);
58    $this->rootUrl = $rootUrl ?: 'https://cloudasset.googleapis.com/';
59    $this->servicePath = '';
60    $this->batchPath = 'batch';
61    $this->version = 'v1';
62    $this->serviceName = 'cloudasset';
63
64    $this->assets = new CloudAsset\Resource\Assets(
65        $this,
66        $this->serviceName,
67        'assets',
68        [
69          'methods' => [
70            'list' => [
71              'path' => 'v1/{+parent}/assets',
72              'httpMethod' => 'GET',
73              'parameters' => [
74                'parent' => [
75                  'location' => 'path',
76                  'type' => 'string',
77                  'required' => true,
78                ],
79                'assetTypes' => [
80                  'location' => 'query',
81                  'type' => 'string',
82                  'repeated' => true,
83                ],
84                'contentType' => [
85                  'location' => 'query',
86                  'type' => 'string',
87                ],
88                'pageSize' => [
89                  'location' => 'query',
90                  'type' => 'integer',
91                ],
92                'pageToken' => [
93                  'location' => 'query',
94                  'type' => 'string',
95                ],
96                'readTime' => [
97                  'location' => 'query',
98                  'type' => 'string',
99                ],
100                'relationshipTypes' => [
101                  'location' => 'query',
102                  'type' => 'string',
103                  'repeated' => true,
104                ],
105              ],
106            ],
107          ]
108        ]
109    );
110    $this->effectiveIamPolicies = new CloudAsset\Resource\EffectiveIamPolicies(
111        $this,
112        $this->serviceName,
113        'effectiveIamPolicies',
114        [
115          'methods' => [
116            'batchGet' => [
117              'path' => 'v1/{+scope}/effectiveIamPolicies:batchGet',
118              'httpMethod' => 'GET',
119              'parameters' => [
120                'scope' => [
121                  'location' => 'path',
122                  'type' => 'string',
123                  'required' => true,
124                ],
125                'names' => [
126                  'location' => 'query',
127                  'type' => 'string',
128                  'repeated' => true,
129                ],
130              ],
131            ],
132          ]
133        ]
134    );
135    $this->feeds = new CloudAsset\Resource\Feeds(
136        $this,
137        $this->serviceName,
138        'feeds',
139        [
140          'methods' => [
141            'create' => [
142              'path' => 'v1/{+parent}/feeds',
143              'httpMethod' => 'POST',
144              'parameters' => [
145                'parent' => [
146                  'location' => 'path',
147                  'type' => 'string',
148                  'required' => true,
149                ],
150              ],
151            ],'delete' => [
152              'path' => 'v1/{+name}',
153              'httpMethod' => 'DELETE',
154              'parameters' => [
155                'name' => [
156                  'location' => 'path',
157                  'type' => 'string',
158                  'required' => true,
159                ],
160              ],
161            ],'get' => [
162              'path' => 'v1/{+name}',
163              'httpMethod' => 'GET',
164              'parameters' => [
165                'name' => [
166                  'location' => 'path',
167                  'type' => 'string',
168                  'required' => true,
169                ],
170              ],
171            ],'list' => [
172              'path' => 'v1/{+parent}/feeds',
173              'httpMethod' => 'GET',
174              'parameters' => [
175                'parent' => [
176                  'location' => 'path',
177                  'type' => 'string',
178                  'required' => true,
179                ],
180              ],
181            ],'patch' => [
182              'path' => 'v1/{+name}',
183              'httpMethod' => 'PATCH',
184              'parameters' => [
185                'name' => [
186                  'location' => 'path',
187                  'type' => 'string',
188                  'required' => true,
189                ],
190              ],
191            ],
192          ]
193        ]
194    );
195    $this->operations = new CloudAsset\Resource\Operations(
196        $this,
197        $this->serviceName,
198        'operations',
199        [
200          'methods' => [
201            'get' => [
202              'path' => 'v1/{+name}',
203              'httpMethod' => 'GET',
204              'parameters' => [
205                'name' => [
206                  'location' => 'path',
207                  'type' => 'string',
208                  'required' => true,
209                ],
210              ],
211            ],
212          ]
213        ]
214    );
215    $this->savedQueries = new CloudAsset\Resource\SavedQueries(
216        $this,
217        $this->serviceName,
218        'savedQueries',
219        [
220          'methods' => [
221            'create' => [
222              'path' => 'v1/{+parent}/savedQueries',
223              'httpMethod' => 'POST',
224              'parameters' => [
225                'parent' => [
226                  'location' => 'path',
227                  'type' => 'string',
228                  'required' => true,
229                ],
230                'savedQueryId' => [
231                  'location' => 'query',
232                  'type' => 'string',
233                ],
234              ],
235            ],'delete' => [
236              'path' => 'v1/{+name}',
237              'httpMethod' => 'DELETE',
238              'parameters' => [
239                'name' => [
240                  'location' => 'path',
241                  'type' => 'string',
242                  'required' => true,
243                ],
244              ],
245            ],'get' => [
246              'path' => 'v1/{+name}',
247              'httpMethod' => 'GET',
248              'parameters' => [
249                'name' => [
250                  'location' => 'path',
251                  'type' => 'string',
252                  'required' => true,
253                ],
254              ],
255            ],'list' => [
256              'path' => 'v1/{+parent}/savedQueries',
257              'httpMethod' => 'GET',
258              'parameters' => [
259                'parent' => [
260                  'location' => 'path',
261                  'type' => 'string',
262                  'required' => true,
263                ],
264                'filter' => [
265                  'location' => 'query',
266                  'type' => 'string',
267                ],
268                'pageSize' => [
269                  'location' => 'query',
270                  'type' => 'integer',
271                ],
272                'pageToken' => [
273                  'location' => 'query',
274                  'type' => 'string',
275                ],
276              ],
277            ],'patch' => [
278              'path' => 'v1/{+name}',
279              'httpMethod' => 'PATCH',
280              'parameters' => [
281                'name' => [
282                  'location' => 'path',
283                  'type' => 'string',
284                  'required' => true,
285                ],
286                'updateMask' => [
287                  'location' => 'query',
288                  'type' => 'string',
289                ],
290              ],
291            ],
292          ]
293        ]
294    );
295    $this->v1 = new CloudAsset\Resource\V1(
296        $this,
297        $this->serviceName,
298        'v1',
299        [
300          'methods' => [
301            'analyzeIamPolicy' => [
302              'path' => 'v1/{+scope}:analyzeIamPolicy',
303              'httpMethod' => 'GET',
304              'parameters' => [
305                'scope' => [
306                  'location' => 'path',
307                  'type' => 'string',
308                  'required' => true,
309                ],
310                'analysisQuery.accessSelector.permissions' => [
311                  'location' => 'query',
312                  'type' => 'string',
313                  'repeated' => true,
314                ],
315                'analysisQuery.accessSelector.roles' => [
316                  'location' => 'query',
317                  'type' => 'string',
318                  'repeated' => true,
319                ],
320                'analysisQuery.conditionContext.accessTime' => [
321                  'location' => 'query',
322                  'type' => 'string',
323                ],
324                'analysisQuery.identitySelector.identity' => [
325                  'location' => 'query',
326                  'type' => 'string',
327                ],
328                'analysisQuery.options.analyzeServiceAccountImpersonation' => [
329                  'location' => 'query',
330                  'type' => 'boolean',
331                ],
332                'analysisQuery.options.expandGroups' => [
333                  'location' => 'query',
334                  'type' => 'boolean',
335                ],
336                'analysisQuery.options.expandResources' => [
337                  'location' => 'query',
338                  'type' => 'boolean',
339                ],
340                'analysisQuery.options.expandRoles' => [
341                  'location' => 'query',
342                  'type' => 'boolean',
343                ],
344                'analysisQuery.options.outputGroupEdges' => [
345                  'location' => 'query',
346                  'type' => 'boolean',
347                ],
348                'analysisQuery.options.outputResourceEdges' => [
349                  'location' => 'query',
350                  'type' => 'boolean',
351                ],
352                'analysisQuery.resourceSelector.fullResourceName' => [
353                  'location' => 'query',
354                  'type' => 'string',
355                ],
356                'executionTimeout' => [
357                  'location' => 'query',
358                  'type' => 'string',
359                ],
360                'savedAnalysisQuery' => [
361                  'location' => 'query',
362                  'type' => 'string',
363                ],
364              ],
365            ],'analyzeIamPolicyLongrunning' => [
366              'path' => 'v1/{+scope}:analyzeIamPolicyLongrunning',
367              'httpMethod' => 'POST',
368              'parameters' => [
369                'scope' => [
370                  'location' => 'path',
371                  'type' => 'string',
372                  'required' => true,
373                ],
374              ],
375            ],'analyzeMove' => [
376              'path' => 'v1/{+resource}:analyzeMove',
377              'httpMethod' => 'GET',
378              'parameters' => [
379                'resource' => [
380                  'location' => 'path',
381                  'type' => 'string',
382                  'required' => true,
383                ],
384                'destinationParent' => [
385                  'location' => 'query',
386                  'type' => 'string',
387                ],
388                'view' => [
389                  'location' => 'query',
390                  'type' => 'string',
391                ],
392              ],
393            ],'batchGetAssetsHistory' => [
394              'path' => 'v1/{+parent}:batchGetAssetsHistory',
395              'httpMethod' => 'GET',
396              'parameters' => [
397                'parent' => [
398                  'location' => 'path',
399                  'type' => 'string',
400                  'required' => true,
401                ],
402                'assetNames' => [
403                  'location' => 'query',
404                  'type' => 'string',
405                  'repeated' => true,
406                ],
407                'contentType' => [
408                  'location' => 'query',
409                  'type' => 'string',
410                ],
411                'readTimeWindow.endTime' => [
412                  'location' => 'query',
413                  'type' => 'string',
414                ],
415                'readTimeWindow.startTime' => [
416                  'location' => 'query',
417                  'type' => 'string',
418                ],
419                'relationshipTypes' => [
420                  'location' => 'query',
421                  'type' => 'string',
422                  'repeated' => true,
423                ],
424              ],
425            ],'exportAssets' => [
426              'path' => 'v1/{+parent}:exportAssets',
427              'httpMethod' => 'POST',
428              'parameters' => [
429                'parent' => [
430                  'location' => 'path',
431                  'type' => 'string',
432                  'required' => true,
433                ],
434              ],
435            ],'searchAllIamPolicies' => [
436              'path' => 'v1/{+scope}:searchAllIamPolicies',
437              'httpMethod' => 'GET',
438              'parameters' => [
439                'scope' => [
440                  'location' => 'path',
441                  'type' => 'string',
442                  'required' => true,
443                ],
444                'assetTypes' => [
445                  'location' => 'query',
446                  'type' => 'string',
447                  'repeated' => true,
448                ],
449                'orderBy' => [
450                  'location' => 'query',
451                  'type' => 'string',
452                ],
453                'pageSize' => [
454                  'location' => 'query',
455                  'type' => 'integer',
456                ],
457                'pageToken' => [
458                  'location' => 'query',
459                  'type' => 'string',
460                ],
461                'query' => [
462                  'location' => 'query',
463                  'type' => 'string',
464                ],
465              ],
466            ],'searchAllResources' => [
467              'path' => 'v1/{+scope}:searchAllResources',
468              'httpMethod' => 'GET',
469              'parameters' => [
470                'scope' => [
471                  'location' => 'path',
472                  'type' => 'string',
473                  'required' => true,
474                ],
475                'assetTypes' => [
476                  'location' => 'query',
477                  'type' => 'string',
478                  'repeated' => true,
479                ],
480                'orderBy' => [
481                  'location' => 'query',
482                  'type' => 'string',
483                ],
484                'pageSize' => [
485                  'location' => 'query',
486                  'type' => 'integer',
487                ],
488                'pageToken' => [
489                  'location' => 'query',
490                  'type' => 'string',
491                ],
492                'query' => [
493                  'location' => 'query',
494                  'type' => 'string',
495                ],
496                'readMask' => [
497                  'location' => 'query',
498                  'type' => 'string',
499                ],
500              ],
501            ],
502          ]
503        ]
504    );
505  }
506}
507
508// Adding a class alias for backwards compatibility with the previous class name.
509class_alias(CloudAsset::class, 'Google_Service_CloudAsset');
510