|
| 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 | + |
| 18 | +namespace Google\Service\Safebrowsing; |
| 19 | + |
| 20 | +class GoogleSecuritySafebrowsingV5SearchUrlsResponse extends \Google\Collection |
| 21 | +{ |
| 22 | + protected $collection_key = 'threats'; |
| 23 | + /** |
| 24 | + * The client-side cache duration. The client MUST add this duration to the |
| 25 | + * current time to determine the expiration time. The expiration time then |
| 26 | + * applies to every URL queried by the client in the request, regardless of |
| 27 | + * how many URLs are returned in the response. Even if the server returns no |
| 28 | + * matches for a particular URL, this fact MUST also be cached by the client. |
| 29 | + * If and only if the field `threats` is empty, the client MAY increase the |
| 30 | + * `cache_duration` to determine a new expiration that is later than that |
| 31 | + * specified by the server. In any case, the increased cache duration must not |
| 32 | + * be longer than 24 hours. Important: the client MUST NOT assume that the |
| 33 | + * server will return the same cache duration for all responses. The server |
| 34 | + * MAY choose different cache durations for different responses depending on |
| 35 | + * the situation. |
| 36 | + * |
| 37 | + * @var string |
| 38 | + */ |
| 39 | + public $cacheDuration; |
| 40 | + protected $threatsType = GoogleSecuritySafebrowsingV5ThreatUrl::class; |
| 41 | + protected $threatsDataType = 'array'; |
| 42 | + |
| 43 | + /** |
| 44 | + * The client-side cache duration. The client MUST add this duration to the |
| 45 | + * current time to determine the expiration time. The expiration time then |
| 46 | + * applies to every URL queried by the client in the request, regardless of |
| 47 | + * how many URLs are returned in the response. Even if the server returns no |
| 48 | + * matches for a particular URL, this fact MUST also be cached by the client. |
| 49 | + * If and only if the field `threats` is empty, the client MAY increase the |
| 50 | + * `cache_duration` to determine a new expiration that is later than that |
| 51 | + * specified by the server. In any case, the increased cache duration must not |
| 52 | + * be longer than 24 hours. Important: the client MUST NOT assume that the |
| 53 | + * server will return the same cache duration for all responses. The server |
| 54 | + * MAY choose different cache durations for different responses depending on |
| 55 | + * the situation. |
| 56 | + * |
| 57 | + * @param string $cacheDuration |
| 58 | + */ |
| 59 | + public function setCacheDuration($cacheDuration) |
| 60 | + { |
| 61 | + $this->cacheDuration = $cacheDuration; |
| 62 | + } |
| 63 | + /** |
| 64 | + * @return string |
| 65 | + */ |
| 66 | + public function getCacheDuration() |
| 67 | + { |
| 68 | + return $this->cacheDuration; |
| 69 | + } |
| 70 | + /** |
| 71 | + * Unordered list. The unordered list of threat matches found. Each entry |
| 72 | + * contains a URL and the threat types that were found matching that URL. The |
| 73 | + * list size can be greater than the number of URLs in the request as the all |
| 74 | + * expressions of the URL would've been considered. |
| 75 | + * |
| 76 | + * @param GoogleSecuritySafebrowsingV5ThreatUrl[] $threats |
| 77 | + */ |
| 78 | + public function setThreats($threats) |
| 79 | + { |
| 80 | + $this->threats = $threats; |
| 81 | + } |
| 82 | + /** |
| 83 | + * @return GoogleSecuritySafebrowsingV5ThreatUrl[] |
| 84 | + */ |
| 85 | + public function getThreats() |
| 86 | + { |
| 87 | + return $this->threats; |
| 88 | + } |
| 89 | +} |
| 90 | + |
| 91 | +// Adding a class alias for backwards compatibility with the previous class name. |
| 92 | +class_alias(GoogleSecuritySafebrowsingV5SearchUrlsResponse::class, 'Google_Service_Safebrowsing_GoogleSecuritySafebrowsingV5SearchUrlsResponse'); |
0 commit comments