Skip to content

Commit 6ba0bb1

Browse files
feat: Automated regeneration of safebrowsing v5 client (#25299)
Auto-created at 2025-12-21 10:31:36 +0000 using the toys pull request generator.
1 parent c338f60 commit 6ba0bb1

File tree

6 files changed

+151
-9
lines changed

6 files changed

+151
-9
lines changed

api_names_out.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348754,6 +348754,14 @@
348754348754
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5SearchHashesResponse/cacheDuration": cache_duration
348755348755
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5SearchHashesResponse/fullHashes": full_hashes
348756348756
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5SearchHashesResponse/fullHashes/full_hash": full_hash
348757+
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5SearchUrlsResponse": google_security_safebrowsing_v5_search_urls_response
348758+
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5SearchUrlsResponse/cacheDuration": cache_duration
348759+
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5SearchUrlsResponse/threats": threats
348760+
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5SearchUrlsResponse/threats/threat": threat
348761+
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5ThreatUrl": google_security_safebrowsing_v5_threat_url
348762+
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5ThreatUrl/threatTypes": threat_types
348763+
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5ThreatUrl/threatTypes/threat_type": threat_type
348764+
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5ThreatUrl/url": url
348757348765
"/safebrowsing:v5/fields": fields
348758348766
"/safebrowsing:v5/key": key
348759348767
"/safebrowsing:v5/quotaUser": quota_user
@@ -348772,6 +348780,8 @@
348772348780
"/safebrowsing:v5/safebrowsing.hashLists.list/pageToken": page_token
348773348781
"/safebrowsing:v5/safebrowsing.hashes.search": search_hashes
348774348782
"/safebrowsing:v5/safebrowsing.hashes.search/hashPrefixes": hash_prefixes
348783+
"/safebrowsing:v5/safebrowsing.urls.search": search_urls
348784+
"/safebrowsing:v5/safebrowsing.urls.search/urls": urls
348775348785
"/sasportal:v1alpha1/SasPortalAssignment": sas_portal_assignment
348776348786
"/sasportal:v1alpha1/SasPortalAssignment/members": members
348777348787
"/sasportal:v1alpha1/SasPortalAssignment/members/member": member

generated/google-apis-safebrowsing_v5/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release history for google-apis-safebrowsing_v5
22

3+
### v0.9.0 (2025-12-21)
4+
5+
* Regenerated from discovery document revision 20251214
6+
37
### v0.8.0 (2025-05-25)
48

59
* Regenerated from discovery document revision 20250518

generated/google-apis-safebrowsing_v5/lib/google/apis/safebrowsing_v5/classes.rb

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,72 @@ def update!(**args)
550550
@full_hashes = args[:full_hashes] if args.key?(:full_hashes)
551551
end
552552
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
553619
end
554620
end
555621
end

generated/google-apis-safebrowsing_v5/lib/google/apis/safebrowsing_v5/gem_version.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ module Google
1616
module Apis
1717
module SafebrowsingV5
1818
# Version of the google-apis-safebrowsing_v5 gem
19-
GEM_VERSION = "0.8.0"
19+
GEM_VERSION = "0.9.0"
2020

2121
# Version of the code generator used to generate this client
2222
GENERATOR_VERSION = "0.18.0"
2323

2424
# Revision of the discovery document this client was generated from
25-
REVISION = "20250518"
25+
REVISION = "20251214"
2626
end
2727
end
2828
end

generated/google-apis-safebrowsing_v5/lib/google/apis/safebrowsing_v5/representations.rb

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,18 @@ class Representation < Google::Apis::Core::JsonRepresentation; end
8888
include Google::Apis::Core::JsonObjectSupport
8989
end
9090

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+
91103
class GoogleSecuritySafebrowsingV5BatchGetHashListsResponse
92104
# @private
93105
class Representation < Google::Apis::Core::JsonRepresentation
@@ -207,6 +219,23 @@ class Representation < Google::Apis::Core::JsonRepresentation
207219

208220
end
209221
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
210239
end
211240
end
212241
end

generated/google-apis-safebrowsing_v5/lib/google/apis/safebrowsing_v5/service.rb

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def initialize
5555
@batch_path = 'batch'
5656
end
5757

58-
# Get the latest contents of a hash list. A hash list may either by a threat
58+
# Gets the latest contents of a hash list. A hash list may either by a threat
5959
# list or a non-threat list such as the Global Cache. This is a standard Get
6060
# method as defined by https://google.aip.dev/131 and the HTTP method is also
6161
# GET.
@@ -109,10 +109,10 @@ def get_hash_list(name, size_constraints_max_database_entries: nil, size_constra
109109
execute_or_queue_command(command, &block)
110110
end
111111

112-
# Get multiple hash lists at once. It is very common for a client to need to get
113-
# multiple hash lists. Using this method is preferred over using the regular Get
114-
# method multiple times. This is a standard batch Get method as defined by https:
115-
# //google.aip.dev/231 and the HTTP method is also GET.
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.
116116
# @param [Array<String>, String] names
117117
# Required. The names of the particular hash lists. The list MAY be a threat
118118
# list, or it may be the Global Cache. The names MUST NOT contain duplicates; if
@@ -167,7 +167,7 @@ def batch_hash_list_get(names: nil, size_constraints_max_database_entries: nil,
167167
execute_or_queue_command(command, &block)
168168
end
169169

170-
# List hash lists. In the V5 API, Google will never remove a hash list that has
170+
# Lists hash lists. In the V5 API, Google will never remove a hash list that has
171171
# ever been returned by this method. This enables clients to skip using this
172172
# method and simply hard-code all hash lists they need. This is a standard List
173173
# method as defined by https://google.aip.dev/132 and the HTTP method is GET.
@@ -206,7 +206,7 @@ def list_hash_lists(page_size: nil, page_token: nil, fields: nil, quota_user: ni
206206
execute_or_queue_command(command, &block)
207207
end
208208

209-
# Search for full hashes matching the specified prefixes. This is a custom
209+
# Searches for full hashes matching the specified prefixes. This is a custom
210210
# method as defined by https://google.aip.dev/136 (the custom method refers to
211211
# this method having a custom name within Google's general API development
212212
# nomenclature; it does not refer to using a custom HTTP method).
@@ -241,6 +241,39 @@ def search_hashes(hash_prefixes: nil, fields: nil, quota_user: nil, options: nil
241241
command.query['quotaUser'] = quota_user unless quota_user.nil?
242242
execute_or_queue_command(command, &block)
243243
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
244277

245278
protected
246279

0 commit comments

Comments
 (0)