Phishing Protection V1beta1 API - Class Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Client (v0.6.0)

Reference documentation and code samples for the Phishing Protection V1beta1 API class Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Client.

Client for the PhishingProtectionService service.

Service to report phishing URIs.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the PhishingProtectionService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all PhishingProtectionService clients
::Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the PhishingProtectionService Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#initialize

def initialize() { |config| ... } -> Client

Create a new PhishingProtectionService client object.

Yields
  • (config) — Configure the PhishingProtectionService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Client.new do |config|
  config.timeout = 10.0
end

#report_phishing

def report_phishing(request, options = nil) -> ::Google::Cloud::PhishingProtection::V1beta1::ReportPhishingResponse
def report_phishing(parent: nil, uri: nil) -> ::Google::Cloud::PhishingProtection::V1beta1::ReportPhishingResponse

Reports a URI suspected of containing phishing content to be reviewed. Once the report review is complete, its result can be found in the Cloud Security Command Center findings dashboard for Phishing Protection. If the result verifies the existence of malicious phishing content, the site will be added the to Google's Social Engineering lists in order to protect users that could get exposed to this threat in the future.

Overloads
def report_phishing(request, options = nil) -> ::Google::Cloud::PhishingProtection::V1beta1::ReportPhishingResponse
Pass arguments to report_phishing via a request object, either of type ReportPhishingRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::PhishingProtection::V1beta1::ReportPhishingRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def report_phishing(parent: nil, uri: nil) -> ::Google::Cloud::PhishingProtection::V1beta1::ReportPhishingResponse
Pass arguments to report_phishing via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The name of the project for which the report will be created, in the format "projects/{project_number}".
  • uri (::String) — Required. The URI that is being reported for phishing content to be analyzed.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/phishing_protection/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::PhishingProtection::V1beta1::PhishingProtectionService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::PhishingProtection::V1beta1::ReportPhishingRequest.new

# Call the report_phishing method.
result = client.report_phishing request

# The returned object is of type Google::Cloud::PhishingProtection::V1beta1::ReportPhishingResponse.
p result