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

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

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::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) -> ::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) -> ::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
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/recaptcha_enterprise/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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
  • (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/recaptcha_enterprise/v1beta1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::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

#create_key

def create_key(request, options = nil) -> ::Google::Cloud::RecaptchaEnterprise::V1beta1::Key
def create_key(parent: nil, key: nil) -> ::Google::Cloud::RecaptchaEnterprise::V1beta1::Key

Creates a new reCAPTCHA Enterprise key.

Overloads
def create_key(request, options = nil) -> ::Google::Cloud::RecaptchaEnterprise::V1beta1::Key
Pass arguments to create_key via a request object, either of type CreateKeyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateKeyRequest, ::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_key(parent: nil, key: nil) -> ::Google::Cloud::RecaptchaEnterprise::V1beta1::Key
Pass arguments to create_key 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 in which the key will be created, in the format "projects/{project_number}".
  • key (::Google::Cloud::RecaptchaEnterprise::V1beta1::Key, ::Hash) — Required. Information to create a reCAPTCHA Enterprise key.
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/recaptcha_enterprise/v1beta1"

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

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

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

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

#delete_key

def delete_key(request, options = nil) -> ::Google::Protobuf::Empty
def delete_key(name: nil) -> ::Google::Protobuf::Empty

Deletes the specified key.

Overloads
def delete_key(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_key via a request object, either of type DeleteKeyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::RecaptchaEnterprise::V1beta1::DeleteKeyRequest, ::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 delete_key(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_key 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).
Parameter
  • name (::String) — Required. The name of the key to be deleted, in the format "projects/{project_number}/keys/{key_id}".
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/recaptcha_enterprise/v1beta1"

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

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

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

# The returned object is of type Google::Protobuf::Empty.
p result

#get_key

def get_key(request, options = nil) -> ::Google::Cloud::RecaptchaEnterprise::V1beta1::Key
def get_key(name: nil) -> ::Google::Cloud::RecaptchaEnterprise::V1beta1::Key

Returns the specified key.

Overloads
def get_key(request, options = nil) -> ::Google::Cloud::RecaptchaEnterprise::V1beta1::Key
Pass arguments to get_key via a request object, either of type GetKeyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::RecaptchaEnterprise::V1beta1::GetKeyRequest, ::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 get_key(name: nil) -> ::Google::Cloud::RecaptchaEnterprise::V1beta1::Key
Pass arguments to get_key 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).
Parameter
  • name (::String) — Required. The name of the requested key, in the format "projects/{project_number}/keys/{key_id}".
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/recaptcha_enterprise/v1beta1"

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

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

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

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

#initialize

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

Create a new RecaptchaEnterpriseService 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::Client.new

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

#list_keys

def list_keys(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1beta1::Key>
def list_keys(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1beta1::Key>

Returns the list of all keys that belong to a project.

Overloads
def list_keys(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1beta1::Key>
Pass arguments to list_keys via a request object, either of type ListKeysRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::RecaptchaEnterprise::V1beta1::ListKeysRequest, ::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 list_keys(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1beta1::Key>
Pass arguments to list_keys 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 that contains the keys that will be listed, in the format "projects/{project_number}".
  • page_size (::Integer) — Optional. The maximum number of keys to return. Default is 10. Max limit is 1000.
  • page_token (::String) — Optional. The next_page_token value returned from a previous. ListKeysRequest, if any.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC 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::Client.new

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

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1beta1::Key.
  p response
end

#update_key

def update_key(request, options = nil) -> ::Google::Cloud::RecaptchaEnterprise::V1beta1::Key
def update_key(key: nil, update_mask: nil) -> ::Google::Cloud::RecaptchaEnterprise::V1beta1::Key

Updates the specified key.

Overloads
def update_key(request, options = nil) -> ::Google::Cloud::RecaptchaEnterprise::V1beta1::Key
Pass arguments to update_key via a request object, either of type UpdateKeyRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::RecaptchaEnterprise::V1beta1::UpdateKeyRequest, ::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 update_key(key: nil, update_mask: nil) -> ::Google::Cloud::RecaptchaEnterprise::V1beta1::Key
Pass arguments to update_key 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
  • (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/recaptcha_enterprise/v1beta1"

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

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

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

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