diff --git a/api_names_out.yaml b/api_names_out.yaml index 2c97658a3..b6cbe71d6 100644 --- a/api_names_out.yaml +++ b/api_names_out.yaml @@ -56509,6 +56509,7 @@ "/safebrowsing:v4/Constraints/region": region "/safebrowsing:v4/Constraints/supportedCompressions": supported_compressions "/safebrowsing:v4/Constraints/supportedCompressions/supported_compression": supported_compression +"/safebrowsing:v4/Empty": empty "/safebrowsing:v4/FetchThreatListUpdatesRequest": fetch_threat_list_updates_request "/safebrowsing:v4/FetchThreatListUpdatesRequest/client": client "/safebrowsing:v4/FetchThreatListUpdatesRequest/listUpdateRequests": list_update_requests @@ -56581,6 +56582,14 @@ "/safebrowsing:v4/ThreatEntrySet/rawIndices": raw_indices "/safebrowsing:v4/ThreatEntrySet/riceHashes": rice_hashes "/safebrowsing:v4/ThreatEntrySet/riceIndices": rice_indices +"/safebrowsing:v4/ThreatHit": threat_hit +"/safebrowsing:v4/ThreatHit/clientInfo": client_info +"/safebrowsing:v4/ThreatHit/entry": entry +"/safebrowsing:v4/ThreatHit/platformType": platform_type +"/safebrowsing:v4/ThreatHit/resources": resources +"/safebrowsing:v4/ThreatHit/resources/resource": resource +"/safebrowsing:v4/ThreatHit/threatType": threat_type +"/safebrowsing:v4/ThreatHit/userInfo": user_info "/safebrowsing:v4/ThreatInfo": threat_info "/safebrowsing:v4/ThreatInfo/platformTypes": platform_types "/safebrowsing:v4/ThreatInfo/platformTypes/platform_type": platform_type @@ -56601,6 +56610,14 @@ "/safebrowsing:v4/ThreatMatch/threatEntryMetadata": threat_entry_metadata "/safebrowsing:v4/ThreatMatch/threatEntryType": threat_entry_type "/safebrowsing:v4/ThreatMatch/threatType": threat_type +"/safebrowsing:v4/ThreatSource": threat_source +"/safebrowsing:v4/ThreatSource/referrer": referrer +"/safebrowsing:v4/ThreatSource/remoteIp": remote_ip +"/safebrowsing:v4/ThreatSource/type": type +"/safebrowsing:v4/ThreatSource/url": url +"/safebrowsing:v4/UserInfo": user_info +"/safebrowsing:v4/UserInfo/regionCode": region_code +"/safebrowsing:v4/UserInfo/userId": user_id "/safebrowsing:v4/fields": fields "/safebrowsing:v4/key": key "/safebrowsing:v4/quotaUser": quota_user @@ -56613,6 +56630,7 @@ "/safebrowsing:v4/safebrowsing.encodedUpdates.get/clientVersion": client_version "/safebrowsing:v4/safebrowsing.encodedUpdates.get/encodedRequest": encoded_request "/safebrowsing:v4/safebrowsing.fullHashes.find": find_full_hashes +"/safebrowsing:v4/safebrowsing.threatHits.create": create_threat_hit "/safebrowsing:v4/safebrowsing.threatListUpdates.fetch": fetch_threat_list_updates "/safebrowsing:v4/safebrowsing.threatLists.list": list_threat_lists "/safebrowsing:v4/safebrowsing.threatMatches.find": find_threat_matches diff --git a/generated/google/apis/bigquerydatatransfer_v1.rb b/generated/google/apis/bigquerydatatransfer_v1.rb index 8b1f76f89..46900ed3d 100644 --- a/generated/google/apis/bigquerydatatransfer_v1.rb +++ b/generated/google/apis/bigquerydatatransfer_v1.rb @@ -26,7 +26,7 @@ module Google # @see https://cloud.google.com/bigquery/ module BigquerydatatransferV1 VERSION = 'V1' - REVISION = '20171128' + REVISION = '20171203' # View and manage your data in Google BigQuery AUTH_BIGQUERY = 'https://www.googleapis.com/auth/bigquery' diff --git a/generated/google/apis/bigquerydatatransfer_v1/classes.rb b/generated/google/apis/bigquerydatatransfer_v1/classes.rb index 53a94d744..71f0b3fef 100644 --- a/generated/google/apis/bigquerydatatransfer_v1/classes.rb +++ b/generated/google/apis/bigquerydatatransfer_v1/classes.rb @@ -788,7 +788,7 @@ module Google end # Represents a data transfer run. - # Next id: 24 + # Next id: 25 class TransferRun include Google::Apis::Core::Hashable diff --git a/generated/google/apis/safebrowsing_v4.rb b/generated/google/apis/safebrowsing_v4.rb index 9b4d65eee..2c1c15cef 100644 --- a/generated/google/apis/safebrowsing_v4.rb +++ b/generated/google/apis/safebrowsing_v4.rb @@ -26,7 +26,7 @@ module Google # @see https://developers.google.com/safe-browsing/ module SafebrowsingV4 VERSION = 'V4' - REVISION = '20170809' + REVISION = '20171203' end end end diff --git a/generated/google/apis/safebrowsing_v4/classes.rb b/generated/google/apis/safebrowsing_v4/classes.rb index 66bc71067..a2e98a629 100644 --- a/generated/google/apis/safebrowsing_v4/classes.rb +++ b/generated/google/apis/safebrowsing_v4/classes.rb @@ -112,6 +112,25 @@ module Google end end + # A generic empty message that you can re-use to avoid defining duplicated + # empty messages in your APIs. A typical example is to use it as the request + # or the response type of an API method. For instance: + # service Foo ` + # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + # ` + # The JSON representation for `Empty` is empty JSON object ````. + class Empty + include Google::Apis::Core::Hashable + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + end + end + # Describes a Safe Browsing API update request. Clients can request updates for # multiple lists in a single request. # NOTE: Field index 2 is unused. @@ -644,6 +663,56 @@ module Google end end + # + class ThreatHit + include Google::Apis::Core::Hashable + + # The client metadata associated with Safe Browsing API requests. + # Corresponds to the JSON property `clientInfo` + # @return [Google::Apis::SafebrowsingV4::ClientInfo] + attr_accessor :client_info + + # An individual threat; for example, a malicious URL or its hash + # representation. Only one of these fields should be set. + # Corresponds to the JSON property `entry` + # @return [Google::Apis::SafebrowsingV4::ThreatEntry] + attr_accessor :entry + + # The platform type reported. + # Corresponds to the JSON property `platformType` + # @return [String] + attr_accessor :platform_type + + # The resources related to the threat hit. + # Corresponds to the JSON property `resources` + # @return [Array] + attr_accessor :resources + + # The threat type reported. + # Corresponds to the JSON property `threatType` + # @return [String] + attr_accessor :threat_type + + # Details about the user that encountered the threat. + # Corresponds to the JSON property `userInfo` + # @return [Google::Apis::SafebrowsingV4::UserInfo] + attr_accessor :user_info + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @client_info = args[:client_info] if args.key?(:client_info) + @entry = args[:entry] if args.key?(:entry) + @platform_type = args[:platform_type] if args.key?(:platform_type) + @resources = args[:resources] if args.key?(:resources) + @threat_type = args[:threat_type] if args.key?(:threat_type) + @user_info = args[:user_info] if args.key?(:user_info) + end + end + # The information regarding one or more threats that a client submits when # checking for matches in threat lists. class ThreatInfo @@ -766,6 +835,69 @@ module Google @threat_type = args[:threat_type] if args.key?(:threat_type) end end + + # A single resource related to a threat hit. + class ThreatSource + include Google::Apis::Core::Hashable + + # Referrer of the resource. Only set if the referrer is available. + # Corresponds to the JSON property `referrer` + # @return [String] + attr_accessor :referrer + + # The remote IP of the resource in ASCII format. Either IPv4 or IPv6. + # Corresponds to the JSON property `remoteIp` + # @return [String] + attr_accessor :remote_ip + + # The type of source reported. + # Corresponds to the JSON property `type` + # @return [String] + attr_accessor :type + + # The URL of the resource. + # 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) + @referrer = args[:referrer] if args.key?(:referrer) + @remote_ip = args[:remote_ip] if args.key?(:remote_ip) + @type = args[:type] if args.key?(:type) + @url = args[:url] if args.key?(:url) + end + end + + # Details about the user that encountered the threat. + class UserInfo + include Google::Apis::Core::Hashable + + # The UN M.49 region code associated with the user's location. + # Corresponds to the JSON property `regionCode` + # @return [String] + attr_accessor :region_code + + # Unique user identifier defined by the client. + # Corresponds to the JSON property `userId` + # NOTE: Values are automatically base64 encoded/decoded in the client library. + # @return [String] + attr_accessor :user_id + + def initialize(**args) + update!(**args) + end + + # Update properties of this object + def update!(**args) + @region_code = args[:region_code] if args.key?(:region_code) + @user_id = args[:user_id] if args.key?(:user_id) + end + end end end end diff --git a/generated/google/apis/safebrowsing_v4/representations.rb b/generated/google/apis/safebrowsing_v4/representations.rb index 3f7572b37..c1ad9a10c 100644 --- a/generated/google/apis/safebrowsing_v4/representations.rb +++ b/generated/google/apis/safebrowsing_v4/representations.rb @@ -40,6 +40,12 @@ module Google include Google::Apis::Core::JsonObjectSupport end + class Empty + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + class FetchThreatListUpdatesRequest class Representation < Google::Apis::Core::JsonRepresentation; end @@ -136,6 +142,12 @@ module Google include Google::Apis::Core::JsonObjectSupport end + class ThreatHit + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + class ThreatInfo class Representation < Google::Apis::Core::JsonRepresentation; end @@ -154,6 +166,18 @@ module Google include Google::Apis::Core::JsonObjectSupport end + class ThreatSource + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + + class UserInfo + class Representation < Google::Apis::Core::JsonRepresentation; end + + include Google::Apis::Core::JsonObjectSupport + end + class Checksum # @private class Representation < Google::Apis::Core::JsonRepresentation @@ -179,6 +203,12 @@ module Google end end + class Empty + # @private + class Representation < Google::Apis::Core::JsonRepresentation + end + end + class FetchThreatListUpdatesRequest # @private class Representation < Google::Apis::Core::JsonRepresentation @@ -341,6 +371,22 @@ module Google end end + class ThreatHit + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :client_info, as: 'clientInfo', class: Google::Apis::SafebrowsingV4::ClientInfo, decorator: Google::Apis::SafebrowsingV4::ClientInfo::Representation + + property :entry, as: 'entry', class: Google::Apis::SafebrowsingV4::ThreatEntry, decorator: Google::Apis::SafebrowsingV4::ThreatEntry::Representation + + property :platform_type, as: 'platformType' + collection :resources, as: 'resources', class: Google::Apis::SafebrowsingV4::ThreatSource, decorator: Google::Apis::SafebrowsingV4::ThreatSource::Representation + + property :threat_type, as: 'threatType' + property :user_info, as: 'userInfo', class: Google::Apis::SafebrowsingV4::UserInfo, decorator: Google::Apis::SafebrowsingV4::UserInfo::Representation + + end + end + class ThreatInfo # @private class Representation < Google::Apis::Core::JsonRepresentation @@ -374,6 +420,24 @@ module Google property :threat_type, as: 'threatType' end end + + class ThreatSource + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :referrer, as: 'referrer' + property :remote_ip, as: 'remoteIp' + property :type, as: 'type' + property :url, as: 'url' + end + end + + class UserInfo + # @private + class Representation < Google::Apis::Core::JsonRepresentation + property :region_code, as: 'regionCode' + property :user_id, :base64 => true, as: 'userId' + end + end end end end diff --git a/generated/google/apis/safebrowsing_v4/service.rb b/generated/google/apis/safebrowsing_v4/service.rb index 7bea79666..3c0165dd4 100644 --- a/generated/google/apis/safebrowsing_v4/service.rb +++ b/generated/google/apis/safebrowsing_v4/service.rb @@ -152,6 +152,37 @@ module Google execute_or_queue_command(command, &block) end + # Reports a Safe Browsing threat list hit to Google. Only projects with + # TRUSTED_REPORTER visibility can use this method. + # @param [Google::Apis::SafebrowsingV4::ThreatHit] threat_hit_object + # @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::SafebrowsingV4::Empty] parsed result object + # @yieldparam err [StandardError] error object if request failed + # + # @return [Google::Apis::SafebrowsingV4::Empty] + # + # @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 create_threat_hit(threat_hit_object = nil, fields: nil, quota_user: nil, options: nil, &block) + command = make_simple_command(:post, 'v4/threatHits', options) + command.request_representation = Google::Apis::SafebrowsingV4::ThreatHit::Representation + command.request_object = threat_hit_object + command.response_representation = Google::Apis::SafebrowsingV4::Empty::Representation + command.response_class = Google::Apis::SafebrowsingV4::Empty + command.query['fields'] = fields unless fields.nil? + command.query['quotaUser'] = quota_user unless quota_user.nil? + execute_or_queue_command(command, &block) + end + # Fetches the most recent threat list updates. A client can request updates # for multiple lists at once. # @param [Google::Apis::SafebrowsingV4::FetchThreatListUpdatesRequest] fetch_threat_list_updates_request_object