google-apis-safebrowsing_v5 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dc5493c0b0c68deffa76a3bac649d6bc339d8d797fb5dea4fd4ad294555b8bd7
|
|
4
|
+
data.tar.gz: 826b05a941e0020f59e68034d649b91e0af82a3647d20a347d148424aac94872
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d2c9f041e7007a42e60893c2808f42d6a525ed98a638e1356bddd72895eab8c6d3b697dfb19a684c879bc114c550b364dc9b6d9128618c85c3dc803b448148c5
|
|
7
|
+
data.tar.gz: 3dd82a9c381fbae2357ff101ce3567b6bf63afcc324945b7f100fc9964a1d5d3e546636ee712715a53d6f1de9613fd68dcdd269673fdf3bf43d84617409e1030
|
data/CHANGELOG.md
CHANGED
|
@@ -550,6 +550,72 @@ module Google
|
|
|
550
550
|
@full_hashes = args[:full_hashes] if args.key?(:full_hashes)
|
|
551
551
|
end
|
|
552
552
|
end
|
|
553
|
+
|
|
554
|
+
# The response returned after searching threats matching the specified URLs. If
|
|
555
|
+
# nothing is found, the server will return an OK status (HTTP status code 200)
|
|
556
|
+
# with the `threats` field empty, rather than returning a NOT_FOUND status (HTTP
|
|
557
|
+
# status code 404).
|
|
558
|
+
class GoogleSecuritySafebrowsingV5SearchUrlsResponse
|
|
559
|
+
include Google::Apis::Core::Hashable
|
|
560
|
+
|
|
561
|
+
# The client-side cache duration. The client MUST add this duration to the
|
|
562
|
+
# current time to determine the expiration time. The expiration time then
|
|
563
|
+
# applies to every URL queried by the client in the request, regardless of how
|
|
564
|
+
# many URLs are returned in the response. Even if the server returns no matches
|
|
565
|
+
# for a particular URL, this fact MUST also be cached by the client. If and only
|
|
566
|
+
# if the field `threats` is empty, the client MAY increase the `cache_duration`
|
|
567
|
+
# to determine a new expiration that is later than that specified by the server.
|
|
568
|
+
# In any case, the increased cache duration must not be longer than 24 hours.
|
|
569
|
+
# Important: the client MUST NOT assume that the server will return the same
|
|
570
|
+
# cache duration for all responses. The server MAY choose different cache
|
|
571
|
+
# durations for different responses depending on the situation.
|
|
572
|
+
# Corresponds to the JSON property `cacheDuration`
|
|
573
|
+
# @return [String]
|
|
574
|
+
attr_accessor :cache_duration
|
|
575
|
+
|
|
576
|
+
# Unordered list. The unordered list of threat matches found. Each entry
|
|
577
|
+
# contains a URL and the threat types that were found matching that URL. The
|
|
578
|
+
# list size can be greater than the number of URLs in the request as the all
|
|
579
|
+
# expressions of the URL would've been considered.
|
|
580
|
+
# Corresponds to the JSON property `threats`
|
|
581
|
+
# @return [Array<Google::Apis::SafebrowsingV5::GoogleSecuritySafebrowsingV5ThreatUrl>]
|
|
582
|
+
attr_accessor :threats
|
|
583
|
+
|
|
584
|
+
def initialize(**args)
|
|
585
|
+
update!(**args)
|
|
586
|
+
end
|
|
587
|
+
|
|
588
|
+
# Update properties of this object
|
|
589
|
+
def update!(**args)
|
|
590
|
+
@cache_duration = args[:cache_duration] if args.key?(:cache_duration)
|
|
591
|
+
@threats = args[:threats] if args.key?(:threats)
|
|
592
|
+
end
|
|
593
|
+
end
|
|
594
|
+
|
|
595
|
+
# A URL matching one or more threats.
|
|
596
|
+
class GoogleSecuritySafebrowsingV5ThreatUrl
|
|
597
|
+
include Google::Apis::Core::Hashable
|
|
598
|
+
|
|
599
|
+
# Unordered list. The unordered list of threat that the URL is classified as.
|
|
600
|
+
# Corresponds to the JSON property `threatTypes`
|
|
601
|
+
# @return [Array<String>]
|
|
602
|
+
attr_accessor :threat_types
|
|
603
|
+
|
|
604
|
+
# The requested URL that was matched by one or more threats.
|
|
605
|
+
# Corresponds to the JSON property `url`
|
|
606
|
+
# @return [String]
|
|
607
|
+
attr_accessor :url
|
|
608
|
+
|
|
609
|
+
def initialize(**args)
|
|
610
|
+
update!(**args)
|
|
611
|
+
end
|
|
612
|
+
|
|
613
|
+
# Update properties of this object
|
|
614
|
+
def update!(**args)
|
|
615
|
+
@threat_types = args[:threat_types] if args.key?(:threat_types)
|
|
616
|
+
@url = args[:url] if args.key?(:url)
|
|
617
|
+
end
|
|
618
|
+
end
|
|
553
619
|
end
|
|
554
620
|
end
|
|
555
621
|
end
|
|
@@ -16,13 +16,13 @@ module Google
|
|
|
16
16
|
module Apis
|
|
17
17
|
module SafebrowsingV5
|
|
18
18
|
# Version of the google-apis-safebrowsing_v5 gem
|
|
19
|
-
GEM_VERSION = "0.
|
|
19
|
+
GEM_VERSION = "0.9.0"
|
|
20
20
|
|
|
21
21
|
# Version of the code generator used to generate this client
|
|
22
22
|
GENERATOR_VERSION = "0.18.0"
|
|
23
23
|
|
|
24
24
|
# Revision of the discovery document this client was generated from
|
|
25
|
-
REVISION = "
|
|
25
|
+
REVISION = "20251214"
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
end
|
|
@@ -88,6 +88,18 @@ module Google
|
|
|
88
88
|
include Google::Apis::Core::JsonObjectSupport
|
|
89
89
|
end
|
|
90
90
|
|
|
91
|
+
class GoogleSecuritySafebrowsingV5SearchUrlsResponse
|
|
92
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
|
93
|
+
|
|
94
|
+
include Google::Apis::Core::JsonObjectSupport
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
class GoogleSecuritySafebrowsingV5ThreatUrl
|
|
98
|
+
class Representation < Google::Apis::Core::JsonRepresentation; end
|
|
99
|
+
|
|
100
|
+
include Google::Apis::Core::JsonObjectSupport
|
|
101
|
+
end
|
|
102
|
+
|
|
91
103
|
class GoogleSecuritySafebrowsingV5BatchGetHashListsResponse
|
|
92
104
|
# @private
|
|
93
105
|
class Representation < Google::Apis::Core::JsonRepresentation
|
|
@@ -207,6 +219,23 @@ module Google
|
|
|
207
219
|
|
|
208
220
|
end
|
|
209
221
|
end
|
|
222
|
+
|
|
223
|
+
class GoogleSecuritySafebrowsingV5SearchUrlsResponse
|
|
224
|
+
# @private
|
|
225
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
|
226
|
+
property :cache_duration, as: 'cacheDuration'
|
|
227
|
+
collection :threats, as: 'threats', class: Google::Apis::SafebrowsingV5::GoogleSecuritySafebrowsingV5ThreatUrl, decorator: Google::Apis::SafebrowsingV5::GoogleSecuritySafebrowsingV5ThreatUrl::Representation
|
|
228
|
+
|
|
229
|
+
end
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
class GoogleSecuritySafebrowsingV5ThreatUrl
|
|
233
|
+
# @private
|
|
234
|
+
class Representation < Google::Apis::Core::JsonRepresentation
|
|
235
|
+
collection :threat_types, as: 'threatTypes'
|
|
236
|
+
property :url, as: 'url'
|
|
237
|
+
end
|
|
238
|
+
end
|
|
210
239
|
end
|
|
211
240
|
end
|
|
212
241
|
end
|
|
@@ -55,7 +55,7 @@ module Google
|
|
|
55
55
|
@batch_path = 'batch'
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
-
#
|
|
58
|
+
# Gets the latest contents of a hash list. A hash list may either by a threat
|
|
59
59
|
# list or a non-threat list such as the Global Cache. This is a standard Get
|
|
60
60
|
# method as defined by https://google.aip.dev/131 and the HTTP method is also
|
|
61
61
|
# GET.
|
|
@@ -109,10 +109,10 @@ module Google
|
|
|
109
109
|
execute_or_queue_command(command, &block)
|
|
110
110
|
end
|
|
111
111
|
|
|
112
|
-
#
|
|
113
|
-
# multiple hash lists. Using this method is preferred over using the regular
|
|
114
|
-
# method multiple times. This is a standard batch Get method as defined by
|
|
115
|
-
#
|
|
112
|
+
# Gets multiple hash lists at once. It is very common for a client to need to
|
|
113
|
+
# get multiple hash lists. Using this method is preferred over using the regular
|
|
114
|
+
# Get method multiple times. This is a standard batch Get method as defined by
|
|
115
|
+
# https://google.aip.dev/231 and the HTTP method is also GET.
|
|
116
116
|
# @param [Array<String>, String] names
|
|
117
117
|
# Required. The names of the particular hash lists. The list MAY be a threat
|
|
118
118
|
# list, or it may be the Global Cache. The names MUST NOT contain duplicates; if
|
|
@@ -167,7 +167,7 @@ module Google
|
|
|
167
167
|
execute_or_queue_command(command, &block)
|
|
168
168
|
end
|
|
169
169
|
|
|
170
|
-
#
|
|
170
|
+
# Lists hash lists. In the V5 API, Google will never remove a hash list that has
|
|
171
171
|
# ever been returned by this method. This enables clients to skip using this
|
|
172
172
|
# method and simply hard-code all hash lists they need. This is a standard List
|
|
173
173
|
# method as defined by https://google.aip.dev/132 and the HTTP method is GET.
|
|
@@ -206,7 +206,7 @@ module Google
|
|
|
206
206
|
execute_or_queue_command(command, &block)
|
|
207
207
|
end
|
|
208
208
|
|
|
209
|
-
#
|
|
209
|
+
# Searches for full hashes matching the specified prefixes. This is a custom
|
|
210
210
|
# method as defined by https://google.aip.dev/136 (the custom method refers to
|
|
211
211
|
# this method having a custom name within Google's general API development
|
|
212
212
|
# nomenclature; it does not refer to using a custom HTTP method).
|
|
@@ -241,6 +241,39 @@ module Google
|
|
|
241
241
|
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
242
242
|
execute_or_queue_command(command, &block)
|
|
243
243
|
end
|
|
244
|
+
|
|
245
|
+
# Searches for URLs matching known threats. Each URL and it's host-suffix and
|
|
246
|
+
# path-prefix expressions (up to a limited depth) are checked. This means that
|
|
247
|
+
# the response may contain URLs that were not included in the request, but are
|
|
248
|
+
# expressions of the requested URLs.
|
|
249
|
+
# @param [Array<String>, String] urls
|
|
250
|
+
# Required. The URLs to be looked up. Clients MUST NOT send more than 50 URLs.
|
|
251
|
+
# @param [String] fields
|
|
252
|
+
# Selector specifying which fields to include in a partial response.
|
|
253
|
+
# @param [String] quota_user
|
|
254
|
+
# Available to use for quota purposes for server-side applications. Can be any
|
|
255
|
+
# arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
256
|
+
# @param [Google::Apis::RequestOptions] options
|
|
257
|
+
# Request-specific options
|
|
258
|
+
#
|
|
259
|
+
# @yield [result, err] Result & error if block supplied
|
|
260
|
+
# @yieldparam result [Google::Apis::SafebrowsingV5::GoogleSecuritySafebrowsingV5SearchUrlsResponse] parsed result object
|
|
261
|
+
# @yieldparam err [StandardError] error object if request failed
|
|
262
|
+
#
|
|
263
|
+
# @return [Google::Apis::SafebrowsingV5::GoogleSecuritySafebrowsingV5SearchUrlsResponse]
|
|
264
|
+
#
|
|
265
|
+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
|
|
266
|
+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
|
|
267
|
+
# @raise [Google::Apis::AuthorizationError] Authorization is required
|
|
268
|
+
def search_urls(urls: nil, fields: nil, quota_user: nil, options: nil, &block)
|
|
269
|
+
command = make_simple_command(:get, 'v5/urls:search', options)
|
|
270
|
+
command.response_representation = Google::Apis::SafebrowsingV5::GoogleSecuritySafebrowsingV5SearchUrlsResponse::Representation
|
|
271
|
+
command.response_class = Google::Apis::SafebrowsingV5::GoogleSecuritySafebrowsingV5SearchUrlsResponse
|
|
272
|
+
command.query['urls'] = urls unless urls.nil?
|
|
273
|
+
command.query['fields'] = fields unless fields.nil?
|
|
274
|
+
command.query['quotaUser'] = quota_user unless quota_user.nil?
|
|
275
|
+
execute_or_queue_command(command, &block)
|
|
276
|
+
end
|
|
244
277
|
|
|
245
278
|
protected
|
|
246
279
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: google-apis-safebrowsing_v5
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.9.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Google LLC
|
|
@@ -57,7 +57,7 @@ licenses:
|
|
|
57
57
|
metadata:
|
|
58
58
|
bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
|
|
59
59
|
changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-safebrowsing_v5/CHANGELOG.md
|
|
60
|
-
documentation_uri: https://googleapis.dev/ruby/google-apis-safebrowsing_v5/v0.
|
|
60
|
+
documentation_uri: https://googleapis.dev/ruby/google-apis-safebrowsing_v5/v0.9.0
|
|
61
61
|
source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/generated/google-apis-safebrowsing_v5
|
|
62
62
|
rdoc_options: []
|
|
63
63
|
require_paths:
|