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\WebRisk\Resource;
19
20use Google\Service\WebRisk\GoogleCloudWebriskV1ComputeThreatListDiffResponse;
21
22/**
23 * The "threatLists" collection of methods.
24 * Typical usage is:
25 *  <code>
26 *   $webriskService = new Google\Service\WebRisk(...);
27 *   $threatLists = $webriskService->threatLists;
28 *  </code>
29 */
30class ThreatLists extends \Google\Service\Resource
31{
32  /**
33   * Gets the most recent threat list diffs. These diffs should be applied to a
34   * local database of hashes to keep it up-to-date. If the local database is
35   * empty or excessively out-of-date, a complete snapshot of the database will be
36   * returned. This Method only updates a single ThreatList at a time. To update
37   * multiple ThreatList databases, this method needs to be called once for each
38   * list. (threatLists.computeDiff)
39   *
40   * @param array $optParams Optional parameters.
41   *
42   * @opt_param int constraints.maxDatabaseEntries Sets the maximum number of
43   * entries that the client is willing to have in the local database. This should
44   * be a power of 2 between 2**10 and 2**20. If zero, no database size limit is
45   * set.
46   * @opt_param int constraints.maxDiffEntries The maximum size in number of
47   * entries. The diff will not contain more entries than this value. This should
48   * be a power of 2 between 2**10 and 2**20. If zero, no diff size limit is set.
49   * @opt_param string constraints.supportedCompressions The compression types
50   * supported by the client.
51   * @opt_param string threatType Required. The threat list to update. Only a
52   * single ThreatType should be specified per request. If you want to handle
53   * multiple ThreatTypes, you must make one request per ThreatType.
54   * @opt_param string versionToken The current version token of the client for
55   * the requested list (the client version that was received from the last
56   * successful diff). If the client does not have a version token (this is the
57   * first time calling ComputeThreatListDiff), this may be left empty and a full
58   * database snapshot will be returned.
59   * @return GoogleCloudWebriskV1ComputeThreatListDiffResponse
60   */
61  public function computeDiff($optParams = [])
62  {
63    $params = [];
64    $params = array_merge($params, $optParams);
65    return $this->call('computeDiff', [$params], GoogleCloudWebriskV1ComputeThreatListDiffResponse::class);
66  }
67}
68
69// Adding a class alias for backwards compatibility with the previous class name.
70class_alias(ThreatLists::class, 'Google_Service_WebRisk_Resource_ThreatLists');
71