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 OnDemandScanning (v1).
24 *
25 * <p>
26 * A service to scan container images for vulnerabilities.</p>
27 *
28 * <p>
29 * For more information about this service, see the API
30 * <a href="https://cloud.google.com/container-analysis/docs/on-demand-scanning/" target="_blank">Documentation</a>
31 * </p>
32 *
33 * @author Google, Inc.
34 */
35class OnDemandScanning 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 $projects_locations_operations;
42  public $projects_locations_scans;
43  public $projects_locations_scans_vulnerabilities;
44
45  /**
46   * Constructs the internal representation of the OnDemandScanning service.
47   *
48   * @param Client|array $clientOrConfig The client used to deliver requests, or a
49   *                                     config array to pass to a new Client instance.
50   * @param string $rootUrl The root URL used for requests to the service.
51   */
52  public function __construct($clientOrConfig = [], $rootUrl = null)
53  {
54    parent::__construct($clientOrConfig);
55    $this->rootUrl = $rootUrl ?: 'https://ondemandscanning.googleapis.com/';
56    $this->servicePath = '';
57    $this->batchPath = 'batch';
58    $this->version = 'v1';
59    $this->serviceName = 'ondemandscanning';
60
61    $this->projects_locations_operations = new OnDemandScanning\Resource\ProjectsLocationsOperations(
62        $this,
63        $this->serviceName,
64        'operations',
65        [
66          'methods' => [
67            'cancel' => [
68              'path' => 'v1/{+name}:cancel',
69              'httpMethod' => 'POST',
70              'parameters' => [
71                'name' => [
72                  'location' => 'path',
73                  'type' => 'string',
74                  'required' => true,
75                ],
76              ],
77            ],'delete' => [
78              'path' => 'v1/{+name}',
79              'httpMethod' => 'DELETE',
80              'parameters' => [
81                'name' => [
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            ],'list' => [
98              'path' => 'v1/{+name}/operations',
99              'httpMethod' => 'GET',
100              'parameters' => [
101                'name' => [
102                  'location' => 'path',
103                  'type' => 'string',
104                  'required' => true,
105                ],
106                'filter' => [
107                  'location' => 'query',
108                  'type' => 'string',
109                ],
110                'pageSize' => [
111                  'location' => 'query',
112                  'type' => 'integer',
113                ],
114                'pageToken' => [
115                  'location' => 'query',
116                  'type' => 'string',
117                ],
118              ],
119            ],'wait' => [
120              'path' => 'v1/{+name}:wait',
121              'httpMethod' => 'POST',
122              'parameters' => [
123                'name' => [
124                  'location' => 'path',
125                  'type' => 'string',
126                  'required' => true,
127                ],
128                'timeout' => [
129                  'location' => 'query',
130                  'type' => 'string',
131                ],
132              ],
133            ],
134          ]
135        ]
136    );
137    $this->projects_locations_scans = new OnDemandScanning\Resource\ProjectsLocationsScans(
138        $this,
139        $this->serviceName,
140        'scans',
141        [
142          'methods' => [
143            'analyzePackages' => [
144              'path' => 'v1/{+parent}/scans:analyzePackages',
145              'httpMethod' => 'POST',
146              'parameters' => [
147                'parent' => [
148                  'location' => 'path',
149                  'type' => 'string',
150                  'required' => true,
151                ],
152              ],
153            ],
154          ]
155        ]
156    );
157    $this->projects_locations_scans_vulnerabilities = new OnDemandScanning\Resource\ProjectsLocationsScansVulnerabilities(
158        $this,
159        $this->serviceName,
160        'vulnerabilities',
161        [
162          'methods' => [
163            'list' => [
164              'path' => 'v1/{+parent}/vulnerabilities',
165              'httpMethod' => 'GET',
166              'parameters' => [
167                'parent' => [
168                  'location' => 'path',
169                  'type' => 'string',
170                  'required' => true,
171                ],
172                'pageSize' => [
173                  'location' => 'query',
174                  'type' => 'integer',
175                ],
176                'pageToken' => [
177                  'location' => 'query',
178                  'type' => 'string',
179                ],
180              ],
181            ],
182          ]
183        ]
184    );
185  }
186}
187
188// Adding a class alias for backwards compatibility with the previous class name.
189class_alias(OnDemandScanning::class, 'Google_Service_OnDemandScanning');
190