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 ContainerAnalysis (v1).
24 *
25 * <p>
26 * An implementation of the Grafeas API, which stores, and enables querying and
27 * retrieval of critical metadata about all of your software artifacts.</p>
28 *
29 * <p>
30 * For more information about this service, see the API
31 * <a href="https://cloud.google.com/container-analysis/api/reference/rest/" target="_blank">Documentation</a>
32 * </p>
33 *
34 * @author Google, Inc.
35 */
36class ContainerAnalysis extends \Google\Service
37{
38  /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */
39  const CLOUD_PLATFORM =
40      "https://www.googleapis.com/auth/cloud-platform";
41
42  public $projects_notes;
43  public $projects_notes_occurrences;
44  public $projects_occurrences;
45
46  /**
47   * Constructs the internal representation of the ContainerAnalysis 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://containeranalysis.googleapis.com/';
57    $this->servicePath = '';
58    $this->batchPath = 'batch';
59    $this->version = 'v1';
60    $this->serviceName = 'containeranalysis';
61
62    $this->projects_notes = new ContainerAnalysis\Resource\ProjectsNotes(
63        $this,
64        $this->serviceName,
65        'notes',
66        [
67          'methods' => [
68            'batchCreate' => [
69              'path' => 'v1/{+parent}/notes:batchCreate',
70              'httpMethod' => 'POST',
71              'parameters' => [
72                'parent' => [
73                  'location' => 'path',
74                  'type' => 'string',
75                  'required' => true,
76                ],
77              ],
78            ],'create' => [
79              'path' => 'v1/{+parent}/notes',
80              'httpMethod' => 'POST',
81              'parameters' => [
82                'parent' => [
83                  'location' => 'path',
84                  'type' => 'string',
85                  'required' => true,
86                ],
87                'noteId' => [
88                  'location' => 'query',
89                  'type' => 'string',
90                ],
91              ],
92            ],'delete' => [
93              'path' => 'v1/{+name}',
94              'httpMethod' => 'DELETE',
95              'parameters' => [
96                'name' => [
97                  'location' => 'path',
98                  'type' => 'string',
99                  'required' => true,
100                ],
101              ],
102            ],'get' => [
103              'path' => 'v1/{+name}',
104              'httpMethod' => 'GET',
105              'parameters' => [
106                'name' => [
107                  'location' => 'path',
108                  'type' => 'string',
109                  'required' => true,
110                ],
111              ],
112            ],'getIamPolicy' => [
113              'path' => 'v1/{+resource}:getIamPolicy',
114              'httpMethod' => 'POST',
115              'parameters' => [
116                'resource' => [
117                  'location' => 'path',
118                  'type' => 'string',
119                  'required' => true,
120                ],
121              ],
122            ],'list' => [
123              'path' => 'v1/{+parent}/notes',
124              'httpMethod' => 'GET',
125              'parameters' => [
126                'parent' => [
127                  'location' => 'path',
128                  'type' => 'string',
129                  'required' => true,
130                ],
131                'filter' => [
132                  'location' => 'query',
133                  'type' => 'string',
134                ],
135                'pageSize' => [
136                  'location' => 'query',
137                  'type' => 'integer',
138                ],
139                'pageToken' => [
140                  'location' => 'query',
141                  'type' => 'string',
142                ],
143              ],
144            ],'patch' => [
145              'path' => 'v1/{+name}',
146              'httpMethod' => 'PATCH',
147              'parameters' => [
148                'name' => [
149                  'location' => 'path',
150                  'type' => 'string',
151                  'required' => true,
152                ],
153                'updateMask' => [
154                  'location' => 'query',
155                  'type' => 'string',
156                ],
157              ],
158            ],'setIamPolicy' => [
159              'path' => 'v1/{+resource}:setIamPolicy',
160              'httpMethod' => 'POST',
161              'parameters' => [
162                'resource' => [
163                  'location' => 'path',
164                  'type' => 'string',
165                  'required' => true,
166                ],
167              ],
168            ],'testIamPermissions' => [
169              'path' => 'v1/{+resource}:testIamPermissions',
170              'httpMethod' => 'POST',
171              'parameters' => [
172                'resource' => [
173                  'location' => 'path',
174                  'type' => 'string',
175                  'required' => true,
176                ],
177              ],
178            ],
179          ]
180        ]
181    );
182    $this->projects_notes_occurrences = new ContainerAnalysis\Resource\ProjectsNotesOccurrences(
183        $this,
184        $this->serviceName,
185        'occurrences',
186        [
187          'methods' => [
188            'list' => [
189              'path' => 'v1/{+name}/occurrences',
190              'httpMethod' => 'GET',
191              'parameters' => [
192                'name' => [
193                  'location' => 'path',
194                  'type' => 'string',
195                  'required' => true,
196                ],
197                'filter' => [
198                  'location' => 'query',
199                  'type' => 'string',
200                ],
201                'pageSize' => [
202                  'location' => 'query',
203                  'type' => 'integer',
204                ],
205                'pageToken' => [
206                  'location' => 'query',
207                  'type' => 'string',
208                ],
209              ],
210            ],
211          ]
212        ]
213    );
214    $this->projects_occurrences = new ContainerAnalysis\Resource\ProjectsOccurrences(
215        $this,
216        $this->serviceName,
217        'occurrences',
218        [
219          'methods' => [
220            'batchCreate' => [
221              'path' => 'v1/{+parent}/occurrences:batchCreate',
222              'httpMethod' => 'POST',
223              'parameters' => [
224                'parent' => [
225                  'location' => 'path',
226                  'type' => 'string',
227                  'required' => true,
228                ],
229              ],
230            ],'create' => [
231              'path' => 'v1/{+parent}/occurrences',
232              'httpMethod' => 'POST',
233              'parameters' => [
234                'parent' => [
235                  'location' => 'path',
236                  'type' => 'string',
237                  'required' => true,
238                ],
239              ],
240            ],'delete' => [
241              'path' => 'v1/{+name}',
242              'httpMethod' => 'DELETE',
243              'parameters' => [
244                'name' => [
245                  'location' => 'path',
246                  'type' => 'string',
247                  'required' => true,
248                ],
249              ],
250            ],'get' => [
251              'path' => 'v1/{+name}',
252              'httpMethod' => 'GET',
253              'parameters' => [
254                'name' => [
255                  'location' => 'path',
256                  'type' => 'string',
257                  'required' => true,
258                ],
259              ],
260            ],'getIamPolicy' => [
261              'path' => 'v1/{+resource}:getIamPolicy',
262              'httpMethod' => 'POST',
263              'parameters' => [
264                'resource' => [
265                  'location' => 'path',
266                  'type' => 'string',
267                  'required' => true,
268                ],
269              ],
270            ],'getNotes' => [
271              'path' => 'v1/{+name}/notes',
272              'httpMethod' => 'GET',
273              'parameters' => [
274                'name' => [
275                  'location' => 'path',
276                  'type' => 'string',
277                  'required' => true,
278                ],
279              ],
280            ],'getVulnerabilitySummary' => [
281              'path' => 'v1/{+parent}/occurrences:vulnerabilitySummary',
282              'httpMethod' => 'GET',
283              'parameters' => [
284                'parent' => [
285                  'location' => 'path',
286                  'type' => 'string',
287                  'required' => true,
288                ],
289                'filter' => [
290                  'location' => 'query',
291                  'type' => 'string',
292                ],
293              ],
294            ],'list' => [
295              'path' => 'v1/{+parent}/occurrences',
296              'httpMethod' => 'GET',
297              'parameters' => [
298                'parent' => [
299                  'location' => 'path',
300                  'type' => 'string',
301                  'required' => true,
302                ],
303                'filter' => [
304                  'location' => 'query',
305                  'type' => 'string',
306                ],
307                'pageSize' => [
308                  'location' => 'query',
309                  'type' => 'integer',
310                ],
311                'pageToken' => [
312                  'location' => 'query',
313                  'type' => 'string',
314                ],
315              ],
316            ],'patch' => [
317              'path' => 'v1/{+name}',
318              'httpMethod' => 'PATCH',
319              'parameters' => [
320                'name' => [
321                  'location' => 'path',
322                  'type' => 'string',
323                  'required' => true,
324                ],
325                'updateMask' => [
326                  'location' => 'query',
327                  'type' => 'string',
328                ],
329              ],
330            ],'setIamPolicy' => [
331              'path' => 'v1/{+resource}:setIamPolicy',
332              'httpMethod' => 'POST',
333              'parameters' => [
334                'resource' => [
335                  'location' => 'path',
336                  'type' => 'string',
337                  'required' => true,
338                ],
339              ],
340            ],'testIamPermissions' => [
341              'path' => 'v1/{+resource}:testIamPermissions',
342              'httpMethod' => 'POST',
343              'parameters' => [
344                'resource' => [
345                  'location' => 'path',
346                  'type' => 'string',
347                  'required' => true,
348                ],
349              ],
350            ],
351          ]
352        ]
353    );
354  }
355}
356
357// Adding a class alias for backwards compatibility with the previous class name.
358class_alias(ContainerAnalysis::class, 'Google_Service_ContainerAnalysis');
359