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
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://webrisk.$UNIVERSE_DOMAIN$/"
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.
Constructor Details
#initialize ⇒ WebRiskService
Returns a new instance of WebRiskService.
47 48 49 50 51 52 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 47 def initialize super(DEFAULT_ENDPOINT_TEMPLATE, '', 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.
40 41 42 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 40 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.
45 46 47 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 45 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.
121 122 123 124 125 126 127 128 129 130 131 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 121 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.
319 320 321 322 323 324 325 326 327 328 329 330 331 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 319 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.
265 266 267 268 269 270 271 272 273 274 275 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 265 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.
156 157 158 159 160 161 162 163 164 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 156 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.
187 188 189 190 191 192 193 194 195 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 187 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.
224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 224 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.
82 83 84 85 86 87 88 89 90 91 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 82 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.
358 359 360 361 362 363 364 365 366 367 |
# File 'lib/google/apis/webrisk_v1/service.rb', line 358 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 |