Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions api_names_out.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -348175,6 +348175,14 @@
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5SearchHashesResponse/cacheDuration": cache_duration
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5SearchHashesResponse/fullHashes": full_hashes
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5SearchHashesResponse/fullHashes/full_hash": full_hash
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5SearchUrlsResponse": google_security_safebrowsing_v5_search_urls_response
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5SearchUrlsResponse/cacheDuration": cache_duration
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5SearchUrlsResponse/threats": threats
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5SearchUrlsResponse/threats/threat": threat
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5ThreatUrl": google_security_safebrowsing_v5_threat_url
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5ThreatUrl/threatTypes": threat_types
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5ThreatUrl/threatTypes/threat_type": threat_type
"/safebrowsing:v5/GoogleSecuritySafebrowsingV5ThreatUrl/url": url
"/safebrowsing:v5/fields": fields
"/safebrowsing:v5/key": key
"/safebrowsing:v5/quotaUser": quota_user
Expand All @@ -348193,6 +348201,8 @@
"/safebrowsing:v5/safebrowsing.hashLists.list/pageToken": page_token
"/safebrowsing:v5/safebrowsing.hashes.search": search_hashes
"/safebrowsing:v5/safebrowsing.hashes.search/hashPrefixes": hash_prefixes
"/safebrowsing:v5/safebrowsing.urls.search": search_urls
"/safebrowsing:v5/safebrowsing.urls.search/urls": urls
"/sasportal:v1alpha1/SasPortalAssignment": sas_portal_assignment
"/sasportal:v1alpha1/SasPortalAssignment/members": members
"/sasportal:v1alpha1/SasPortalAssignment/members/member": member
Expand Down
4 changes: 4 additions & 0 deletions generated/google-apis-safebrowsing_v5/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release history for google-apis-safebrowsing_v5

### v0.9.0 (2025-12-21)

* Regenerated from discovery document revision 20251214

### v0.8.0 (2025-05-25)

* Regenerated from discovery document revision 20250518
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,72 @@ def update!(**args)
@full_hashes = args[:full_hashes] if args.key?(:full_hashes)
end
end

# The response returned after searching threats matching the specified URLs. If
# nothing is found, the server will return an OK status (HTTP status code 200)
# with the `threats` field empty, rather than returning a NOT_FOUND status (HTTP
# status code 404).
class GoogleSecuritySafebrowsingV5SearchUrlsResponse
include Google::Apis::Core::Hashable

# The client-side cache duration. The client MUST add this duration to the
# current time to determine the expiration time. The expiration time then
# applies to every URL queried by the client in the request, regardless of how
# many URLs are returned in the response. Even if the server returns no matches
# for a particular URL, this fact MUST also be cached by the client. If and only
# if the field `threats` is empty, the client MAY increase the `cache_duration`
# to determine a new expiration that is later than that specified by the server.
# In any case, the increased cache duration must not be longer than 24 hours.
# Important: the client MUST NOT assume that the server will return the same
# cache duration for all responses. The server MAY choose different cache
# durations for different responses depending on the situation.
# Corresponds to the JSON property `cacheDuration`
# @return [String]
attr_accessor :cache_duration

# Unordered list. The unordered list of threat matches found. Each entry
# contains a URL and the threat types that were found matching that URL. The
# list size can be greater than the number of URLs in the request as the all
# expressions of the URL would've been considered.
# Corresponds to the JSON property `threats`
# @return [Array<Google::Apis::SafebrowsingV5::GoogleSecuritySafebrowsingV5ThreatUrl>]
attr_accessor :threats

def initialize(**args)
update!(**args)
end

# Update properties of this object
def update!(**args)
@cache_duration = args[:cache_duration] if args.key?(:cache_duration)
@threats = args[:threats] if args.key?(:threats)
end
end

# A URL matching one or more threats.
class GoogleSecuritySafebrowsingV5ThreatUrl
include Google::Apis::Core::Hashable

# Unordered list. The unordered list of threat that the URL is classified as.
# Corresponds to the JSON property `threatTypes`
# @return [Array<String>]
attr_accessor :threat_types

# The requested URL that was matched by one or more threats.
# Corresponds to the JSON property `url`
# @return [String]
attr_accessor :url

def initialize(**args)
update!(**args)
end

# Update properties of this object
def update!(**args)
@threat_types = args[:threat_types] if args.key?(:threat_types)
@url = args[:url] if args.key?(:url)
end
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ module Google
module Apis
module SafebrowsingV5
# Version of the google-apis-safebrowsing_v5 gem
GEM_VERSION = "0.8.0"
GEM_VERSION = "0.9.0"

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

# Revision of the discovery document this client was generated from
REVISION = "20250518"
REVISION = "20251214"
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ class Representation < Google::Apis::Core::JsonRepresentation; end
include Google::Apis::Core::JsonObjectSupport
end

class GoogleSecuritySafebrowsingV5SearchUrlsResponse
class Representation < Google::Apis::Core::JsonRepresentation; end

include Google::Apis::Core::JsonObjectSupport
end

class GoogleSecuritySafebrowsingV5ThreatUrl
class Representation < Google::Apis::Core::JsonRepresentation; end

include Google::Apis::Core::JsonObjectSupport
end

class GoogleSecuritySafebrowsingV5BatchGetHashListsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
Expand Down Expand Up @@ -207,6 +219,23 @@ class Representation < Google::Apis::Core::JsonRepresentation

end
end

class GoogleSecuritySafebrowsingV5SearchUrlsResponse
# @private
class Representation < Google::Apis::Core::JsonRepresentation
property :cache_duration, as: 'cacheDuration'
collection :threats, as: 'threats', class: Google::Apis::SafebrowsingV5::GoogleSecuritySafebrowsingV5ThreatUrl, decorator: Google::Apis::SafebrowsingV5::GoogleSecuritySafebrowsingV5ThreatUrl::Representation

end
end

class GoogleSecuritySafebrowsingV5ThreatUrl
# @private
class Representation < Google::Apis::Core::JsonRepresentation
collection :threat_types, as: 'threatTypes'
property :url, as: 'url'
end
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def initialize
@batch_path = 'batch'
end

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

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

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

# Search for full hashes matching the specified prefixes. This is a custom
# Searches for full hashes matching the specified prefixes. This is a custom
# method as defined by https://google.aip.dev/136 (the custom method refers to
# this method having a custom name within Google's general API development
# nomenclature; it does not refer to using a custom HTTP method).
Expand Down Expand Up @@ -241,6 +241,39 @@ def search_hashes(hash_prefixes: nil, fields: nil, quota_user: nil, options: nil
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end

# Searches for URLs matching known threats. Each URL and it's host-suffix and
# path-prefix expressions (up to a limited depth) are checked. This means that
# the response may contain URLs that were not included in the request, but are
# expressions of the requested URLs.
# @param [Array<String>, String] urls
# Required. The URLs to be looked up. Clients MUST NOT send more than 50 URLs.
# @param [String] fields
# Selector specifying which fields to include in a partial response.
# @param [String] quota_user
# Available to use for quota purposes for server-side applications. Can be any
# arbitrary string assigned to a user, but should not exceed 40 characters.
# @param [Google::Apis::RequestOptions] options
# Request-specific options
#
# @yield [result, err] Result & error if block supplied
# @yieldparam result [Google::Apis::SafebrowsingV5::GoogleSecuritySafebrowsingV5SearchUrlsResponse] parsed result object
# @yieldparam err [StandardError] error object if request failed
#
# @return [Google::Apis::SafebrowsingV5::GoogleSecuritySafebrowsingV5SearchUrlsResponse]
#
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
# @raise [Google::Apis::AuthorizationError] Authorization is required
def search_urls(urls: nil, fields: nil, quota_user: nil, options: nil, &block)
command = make_simple_command(:get, 'v5/urls:search', options)
command.response_representation = Google::Apis::SafebrowsingV5::GoogleSecuritySafebrowsingV5SearchUrlsResponse::Representation
command.response_class = Google::Apis::SafebrowsingV5::GoogleSecuritySafebrowsingV5SearchUrlsResponse
command.query['urls'] = urls unless urls.nil?
command.query['fields'] = fields unless fields.nil?
command.query['quotaUser'] = quota_user unless quota_user.nil?
execute_or_queue_command(command, &block)
end

protected

Expand Down