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 WebRisk (v1).
24 *
25 * <p>
26</p>
27 *
28 * <p>
29 * For more information about this service, see the API
30 * <a href="https://cloud.google.com/web-risk/" target="_blank">Documentation</a>
31 * </p>
32 *
33 * @author Google, Inc.
34 */
35class WebRisk 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 $hashes;
42  public $projects_operations;
43  public $projects_submissions;
44  public $projects_uris;
45  public $threatLists;
46  public $uris;
47
48  /**
49   * Constructs the internal representation of the WebRisk 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://webrisk.googleapis.com/';
59    $this->servicePath = '';
60    $this->batchPath = 'batch';
61    $this->version = 'v1';
62    $this->serviceName = 'webrisk';
63
64    $this->hashes = new WebRisk\Resource\Hashes(
65        $this,
66        $this->serviceName,
67        'hashes',
68        [
69          'methods' => [
70            'search' => [
71              'path' => 'v1/hashes:search',
72              'httpMethod' => 'GET',
73              'parameters' => [
74                'hashPrefix' => [
75                  'location' => 'query',
76                  'type' => 'string',
77                ],
78                'threatTypes' => [
79                  'location' => 'query',
80                  'type' => 'string',
81                  'repeated' => true,
82                ],
83              ],
84            ],
85          ]
86        ]
87    );
88    $this->projects_operations = new WebRisk\Resource\ProjectsOperations(
89        $this,
90        $this->serviceName,
91        'operations',
92        [
93          'methods' => [
94            'cancel' => [
95              'path' => 'v1/{+name}:cancel',
96              'httpMethod' => 'POST',
97              'parameters' => [
98                'name' => [
99                  'location' => 'path',
100                  'type' => 'string',
101                  'required' => true,
102                ],
103              ],
104            ],'delete' => [
105              'path' => 'v1/{+name}',
106              'httpMethod' => 'DELETE',
107              'parameters' => [
108                'name' => [
109                  'location' => 'path',
110                  'type' => 'string',
111                  'required' => true,
112                ],
113              ],
114            ],'get' => [
115              'path' => 'v1/{+name}',
116              'httpMethod' => 'GET',
117              'parameters' => [
118                'name' => [
119                  'location' => 'path',
120                  'type' => 'string',
121                  'required' => true,
122                ],
123              ],
124            ],'list' => [
125              'path' => 'v1/{+name}/operations',
126              'httpMethod' => 'GET',
127              'parameters' => [
128                'name' => [
129                  'location' => 'path',
130                  'type' => 'string',
131                  'required' => true,
132                ],
133                'filter' => [
134                  'location' => 'query',
135                  'type' => 'string',
136                ],
137                'pageSize' => [
138                  'location' => 'query',
139                  'type' => 'integer',
140                ],
141                'pageToken' => [
142                  'location' => 'query',
143                  'type' => 'string',
144                ],
145              ],
146            ],
147          ]
148        ]
149    );
150    $this->projects_submissions = new WebRisk\Resource\ProjectsSubmissions(
151        $this,
152        $this->serviceName,
153        'submissions',
154        [
155          'methods' => [
156            'create' => [
157              'path' => 'v1/{+parent}/submissions',
158              'httpMethod' => 'POST',
159              'parameters' => [
160                'parent' => [
161                  'location' => 'path',
162                  'type' => 'string',
163                  'required' => true,
164                ],
165              ],
166            ],
167          ]
168        ]
169    );
170    $this->projects_uris = new WebRisk\Resource\ProjectsUris(
171        $this,
172        $this->serviceName,
173        'uris',
174        [
175          'methods' => [
176            'submit' => [
177              'path' => 'v1/{+parent}/uris:submit',
178              'httpMethod' => 'POST',
179              'parameters' => [
180                'parent' => [
181                  'location' => 'path',
182                  'type' => 'string',
183                  'required' => true,
184                ],
185              ],
186            ],
187          ]
188        ]
189    );
190    $this->threatLists = new WebRisk\Resource\ThreatLists(
191        $this,
192        $this->serviceName,
193        'threatLists',
194        [
195          'methods' => [
196            'computeDiff' => [
197              'path' => 'v1/threatLists:computeDiff',
198              'httpMethod' => 'GET',
199              'parameters' => [
200                'constraints.maxDatabaseEntries' => [
201                  'location' => 'query',
202                  'type' => 'integer',
203                ],
204                'constraints.maxDiffEntries' => [
205                  'location' => 'query',
206                  'type' => 'integer',
207                ],
208                'constraints.supportedCompressions' => [
209                  'location' => 'query',
210                  'type' => 'string',
211                  'repeated' => true,
212                ],
213                'threatType' => [
214                  'location' => 'query',
215                  'type' => 'string',
216                ],
217                'versionToken' => [
218                  'location' => 'query',
219                  'type' => 'string',
220                ],
221              ],
222            ],
223          ]
224        ]
225    );
226    $this->uris = new WebRisk\Resource\Uris(
227        $this,
228        $this->serviceName,
229        'uris',
230        [
231          'methods' => [
232            'search' => [
233              'path' => 'v1/uris:search',
234              'httpMethod' => 'GET',
235              'parameters' => [
236                'threatTypes' => [
237                  'location' => 'query',
238                  'type' => 'string',
239                  'repeated' => true,
240                ],
241                'uri' => [
242                  'location' => 'query',
243                  'type' => 'string',
244                ],
245              ],
246            ],
247          ]
248        ]
249    );
250  }
251}
252
253// Adding a class alias for backwards compatibility with the previous class name.
254class_alias(WebRisk::class, 'Google_Service_WebRisk');
255