reCAPTCHA Enterprise V1beta1 API - Class Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client (v0.16.0)

Reference documentation and code samples for the reCAPTCHA Enterprise V1beta1 API class Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.

REST client for the RecaptchaEnterpriseService service.

Service to determine the likelihood an event is legitimate.

Inherits

  • Object

Methods

.configure

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

Configure the RecaptchaEnterpriseService 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 RecaptchaEnterpriseService clients
::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.configure do |config|
  config.timeout = 10.0
end

#annotate_assessment

def annotate_assessment(request, options = nil) -> ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse
def annotate_assessment(name: nil, annotation: nil, reasons: nil, hashed_account_id: nil, transaction_event: nil) -> ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse

Annotates a previously created Assessment to provide additional information on whether the event turned out to be authentic or fradulent.

Overloads
def annotate_assessment(request, options = nil) -> ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse
Pass arguments to annotate_assessment via a request object, either of type AnnotateAssessmentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest, ::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 annotate_assessment(name: nil, annotation: nil, reasons: nil, hashed_account_id: nil, transaction_event: nil) -> ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse
Pass arguments to annotate_assessment 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
  • name (::String) — Required. The resource name of the Assessment, in the format projects/{project_number}/assessments/{assessment_id}.
  • annotation (::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Annotation) — Optional. The annotation that is assigned to the Event. This field can be left empty to provide reasons that apply to an event without concluding whether the event is legitimate or fraudulent.
  • reasons (::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Reason>) — Optional. Reasons for the annotation that are assigned to the event.
  • hashed_account_id (::String) — Optional. Unique stable hashed user identifier to apply to the assessment. This is an alternative to setting the hashed_account_id in CreateAssessment, for example, when the account identifier is not yet known in the initial request. It is recommended that the identifier is hashed using hmac-sha256 with stable secret.
  • transaction_event (::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionEvent, ::Hash) — Optional. If the assessment is part of a payment transaction, provide details on payment lifecycle events that occur in the transaction.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/recaptcha_enterprise/v1beta1"

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

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

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

# The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse.
p result

#configure

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

Configure the RecaptchaEnterpriseService 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

#create_assessment

def create_assessment(request, options = nil) -> ::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment
def create_assessment(parent: nil, assessment: nil) -> ::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment

Creates an Assessment of the likelihood an event is legitimate.

Overloads
def create_assessment(request, options = nil) -> ::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment
Pass arguments to create_assessment via a request object, either of type CreateAssessmentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest, ::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 create_assessment(parent: nil, assessment: nil) -> ::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment
Pass arguments to create_assessment 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
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/recaptcha_enterprise/v1beta1"

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

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

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

# The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment.
p result

#initialize

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

Create a new RecaptchaEnterpriseService REST client object.

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

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

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)