Class: Google::Apis::WebriskV1::WebRiskService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::WebriskV1::WebRiskService
- Defined in:
- lib/google/apis/webrisk_v1/service.rb
Overview
Web Risk API
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#cancel_project_operation(name, google_longrunning_cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebriskV1::GoogleProtobufEmpty
Starts asynchronous cancellation on a long-running operation.
-
#compute_threat_list_diff(constraints_max_database_entries: nil, constraints_max_diff_entries: nil, constraints_supported_compressions: nil, threat_type: nil, version_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebriskV1::GoogleCloudWebriskV1ComputeThreatListDiffResponse
Gets the most recent threat list diffs.
-
#create_project_submission(parent, google_cloud_webrisk_v1_submission_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebriskV1::GoogleCloudWebriskV1Submission
Creates a Submission of a URI suspected of containing phishing content to be reviewed.
-
#delete_project_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebriskV1::GoogleProtobufEmpty
Deletes a long-running operation.
-
#get_project_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebriskV1::GoogleLongrunningOperation
Gets the latest state of a long-running operation.
-
#initialize ⇒ WebRiskService
constructor
A new instance of WebRiskService.
-
#list_project_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebriskV1::GoogleLongrunningListOperationsResponse
Lists operations that match the specified filter in the request.
-
#search_hashes(hash_prefix: nil, threat_types: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebriskV1::GoogleCloudWebriskV1SearchHashesResponse
Gets the full hashes that match the requested hash prefix.
-
#search_uris(threat_types: nil, uri: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebriskV1::GoogleCloudWebriskV1SearchUrisResponse
This method is used to check whether a URI is on a given threatList.
-
#submit_project_uri(parent, google_cloud_webrisk_v1_submit_uri_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebriskV1::GoogleLongrunningOperation
Submits a URI suspected of containing malicious content to be reviewed.
Constructor Details
#initialize ⇒ WebRiskService
Returns a new instance of WebRiskService.
45 46 47 48 49 50 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 45 def initialize super('https://webrisk.googleapis.com/', '', client_name: 'google-apis-webrisk_v1', client_version: Google::Apis::WebriskV1::GEM_VERSION) @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
38 39 40 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 38 def key @key end |
#quota_user ⇒ String
Returns 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.
43 44 45 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 43 def quota_user @quota_user end |
Instance Method Details
#cancel_project_operation(name, google_longrunning_cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebriskV1::GoogleProtobufEmpty
Starts asynchronous cancellation on a long-running operation. The server makes
a best effort to cancel the operation, but success is not guaranteed. If the
server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.
Clients can use Operations.GetOperation or other methods to check whether the
cancellation succeeded or whether the operation completed despite cancellation.
On successful cancellation, the operation is not deleted; instead, it becomes
an operation with an Operation.error value with a google.rpc.Status.code of 1,
corresponding to Code.CANCELLED.
119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 119 def cancel_project_operation(name, google_longrunning_cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+name}:cancel', ) command.request_representation = Google::Apis::WebriskV1::GoogleLongrunningCancelOperationRequest::Representation command.request_object = google_longrunning_cancel_operation_request_object command.response_representation = Google::Apis::WebriskV1::GoogleProtobufEmpty::Representation command.response_class = Google::Apis::WebriskV1::GoogleProtobufEmpty command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#compute_threat_list_diff(constraints_max_database_entries: nil, constraints_max_diff_entries: nil, constraints_supported_compressions: nil, threat_type: nil, version_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebriskV1::GoogleCloudWebriskV1ComputeThreatListDiffResponse
Gets the most recent threat list diffs. These diffs should be applied to a local database of hashes to keep it up-to-date. If the local database is empty or excessively out-of-date, a complete snapshot of the database will be returned. This Method only updates a single ThreatList at a time. To update multiple ThreatList databases, this method needs to be called once for each list.
366 367 368 369 370 371 372 373 374 375 376 377 378 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 366 def compute_threat_list_diff(constraints_max_database_entries: nil, constraints_max_diff_entries: nil, constraints_supported_compressions: nil, threat_type: nil, version_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/threatLists:computeDiff', ) command.response_representation = Google::Apis::WebriskV1::GoogleCloudWebriskV1ComputeThreatListDiffResponse::Representation command.response_class = Google::Apis::WebriskV1::GoogleCloudWebriskV1ComputeThreatListDiffResponse command.query['constraints.maxDatabaseEntries'] = constraints_max_database_entries unless constraints_max_database_entries.nil? command.query['constraints.maxDiffEntries'] = constraints_max_diff_entries unless constraints_max_diff_entries.nil? command.query['constraints.supportedCompressions'] = constraints_supported_compressions unless constraints_supported_compressions.nil? command.query['threatType'] = threat_type unless threat_type.nil? command.query['versionToken'] = version_token unless version_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#create_project_submission(parent, google_cloud_webrisk_v1_submission_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebriskV1::GoogleCloudWebriskV1Submission
Creates a Submission of a URI suspected of containing phishing content to be reviewed. If the result verifies the existence of malicious phishing content, the site will be added to the Google's Social Engineering lists in order to protect users that could get exposed to this threat in the future. Only allowlisted projects can use this method during Early Access. Please reach out to Sales or your customer engineer to obtain access.
269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 269 def create_project_submission(parent, google_cloud_webrisk_v1_submission_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/submissions', ) command.request_representation = Google::Apis::WebriskV1::GoogleCloudWebriskV1Submission::Representation command.request_object = google_cloud_webrisk_v1_submission_object command.response_representation = Google::Apis::WebriskV1::GoogleCloudWebriskV1Submission::Representation command.response_class = Google::Apis::WebriskV1::GoogleCloudWebriskV1Submission command.params['parent'] = parent unless parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#delete_project_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebriskV1::GoogleProtobufEmpty
Deletes a long-running operation. This method indicates that the client is no
longer interested in the operation result. It does not cancel the operation.
If the server doesn't support this method, it returns google.rpc.Code.
UNIMPLEMENTED.
154 155 156 157 158 159 160 161 162 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 154 def delete_project_operation(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v1/{+name}', ) command.response_representation = Google::Apis::WebriskV1::GoogleProtobufEmpty::Representation command.response_class = Google::Apis::WebriskV1::GoogleProtobufEmpty command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#get_project_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebriskV1::GoogleLongrunningOperation
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
185 186 187 188 189 190 191 192 193 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 185 def get_project_operation(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) command.response_representation = Google::Apis::WebriskV1::GoogleLongrunningOperation::Representation command.response_class = Google::Apis::WebriskV1::GoogleLongrunningOperation command.params['name'] = name unless name.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#list_project_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebriskV1::GoogleLongrunningListOperationsResponse
Lists operations that match the specified filter in the request. If the server
doesn't support this method, it returns UNIMPLEMENTED. NOTE: the name
binding allows API services to override the binding to use different resource
name schemes, such as users/*/operations. To override the binding, API
services can add a binding such as "/v1/name=users/*/operations" to their
service configuration. For backwards compatibility, the default name includes
the operations collection id, however overriding users must ensure the name
binding is the parent resource, without the operations collection id.
228 229 230 231 232 233 234 235 236 237 238 239 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 228 def list_project_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}/operations', ) command.response_representation = Google::Apis::WebriskV1::GoogleLongrunningListOperationsResponse::Representation command.response_class = Google::Apis::WebriskV1::GoogleLongrunningListOperationsResponse command.params['name'] = name unless name.nil? command.query['filter'] = filter unless filter.nil? command.query['pageSize'] = page_size unless page_size.nil? command.query['pageToken'] = page_token unless page_token.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#search_hashes(hash_prefix: nil, threat_types: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebriskV1::GoogleCloudWebriskV1SearchHashesResponse
Gets the full hashes that match the requested hash prefix. This is used after a hash prefix is looked up in a threatList and there is a match. The client side threatList only holds partial hashes so the client must query this method to determine if there is a full hash match of a threat.
80 81 82 83 84 85 86 87 88 89 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 80 def search_hashes(hash_prefix: nil, threat_types: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/hashes:search', ) command.response_representation = Google::Apis::WebriskV1::GoogleCloudWebriskV1SearchHashesResponse::Representation command.response_class = Google::Apis::WebriskV1::GoogleCloudWebriskV1SearchHashesResponse command.query['hashPrefix'] = hash_prefix unless hash_prefix.nil? command.query['threatTypes'] = threat_types unless threat_types.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#search_uris(threat_types: nil, uri: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebriskV1::GoogleCloudWebriskV1SearchUrisResponse
This method is used to check whether a URI is on a given threatList. Multiple threatLists may be searched in a single query. The response will list all requested threatLists the URI was found to match. If the URI is not found on any of the requested ThreatList an empty response will be returned.
405 406 407 408 409 410 411 412 413 414 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 405 def search_uris(threat_types: nil, uri: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/uris:search', ) command.response_representation = Google::Apis::WebriskV1::GoogleCloudWebriskV1SearchUrisResponse::Representation command.response_class = Google::Apis::WebriskV1::GoogleCloudWebriskV1SearchUrisResponse command.query['threatTypes'] = threat_types unless threat_types.nil? command.query['uri'] = uri unless uri.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |
#submit_project_uri(parent, google_cloud_webrisk_v1_submit_uri_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::WebriskV1::GoogleLongrunningOperation
Submits a URI suspected of containing malicious content to be reviewed. Returns a google.longrunning.Operation which, once the review is complete, is updated with its result. You can use the Pub/Sub API to receive notifications for the returned Operation. If the result verifies the existence of malicious content, the site will be added to the Google's Social Engineering lists in order to protect users that could get exposed to this threat in the future. Only allowlisted projects can use this method during Early Access. Please reach out to Sales or your customer engineer to obtain access.
312 313 314 315 316 317 318 319 320 321 322 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 312 def submit_project_uri(parent, google_cloud_webrisk_v1_submit_uri_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+parent}/uris:submit', ) command.request_representation = Google::Apis::WebriskV1::GoogleCloudWebriskV1SubmitUriRequest::Representation command.request_object = google_cloud_webrisk_v1_submit_uri_request_object command.response_representation = Google::Apis::WebriskV1::GoogleLongrunningOperation::Representation command.response_class = Google::Apis::WebriskV1::GoogleLongrunningOperation command.params['parent'] = parent unless parent.nil? command.query['fields'] = fields unless fields.nil? command.query['quotaUser'] = quota_user unless quota_user.nil? execute_or_queue_command(command, &block) end |