source: vendor/google/apiclient-services/src/Safebrowsing.php@ e3d4e0a

Last change on this file since e3d4e0a was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 7 days ago

Upload project files

  • Property mode set to 100644
File size: 2.7 KB
Line 
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 Safebrowsing (v5).
24 *
25 * <p>
26 * Enables client applications to check web resources (most commonly URLs)
27 * against Google-generated lists of unsafe web resources. The Safe Browsing
28 * APIs are for non-commercial use only. If you need to use APIs to detect
29 * malicious URLs for commercial purposes – meaning “for sale or revenue-
30 * generating purposes” – please refer to the Web Risk API.</p>
31 *
32 * <p>
33 * For more information about this service, see the API
34 * <a href="https://developers.google.com/safe-browsing/" target="_blank">Documentation</a>
35 * </p>
36 *
37 * @author Google, Inc.
38 */
39class Safebrowsing extends \Google\Service
40{
41
42
43 public $hashes;
44 public $rootUrlTemplate;
45
46 /**
47 * Constructs the internal representation of the Safebrowsing 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://safebrowsing.googleapis.com/';
57 $this->rootUrlTemplate = $rootUrl ?: 'https://safebrowsing.UNIVERSE_DOMAIN/';
58 $this->servicePath = '';
59 $this->batchPath = 'batch';
60 $this->version = 'v5';
61 $this->serviceName = 'safebrowsing';
62
63 $this->hashes = new Safebrowsing\Resource\Hashes(
64 $this,
65 $this->serviceName,
66 'hashes',
67 [
68 'methods' => [
69 'search' => [
70 'path' => 'v5/hashes:search',
71 'httpMethod' => 'GET',
72 'parameters' => [
73 'hashPrefixes' => [
74 'location' => 'query',
75 'type' => 'string',
76 'repeated' => true,
77 ],
78 ],
79 ],
80 ]
81 ]
82 );
83 }
84}
85
86// Adding a class alias for backwards compatibility with the previous class name.
87class_alias(Safebrowsing::class, 'Google_Service_Safebrowsing');
Note: See TracBrowser for help on using the repository browser.