Class: Google::Apis::RecaptchaenterpriseV1::RecaptchaEnterpriseService

Inherits:
Core::BaseService
  • Object
show all
Defined in:
lib/google/apis/recaptchaenterprise_v1/service.rb

Overview

reCAPTCHA Enterprise API

Examples:

require 'google/apis/recaptchaenterprise_v1'

Recaptchaenterprise = Google::Apis::RecaptchaenterpriseV1 # Alias the module
service = Recaptchaenterprise::RecaptchaEnterpriseService.new

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRecaptchaEnterpriseService

Returns a new instance of RecaptchaEnterpriseService.



45
46
47
48
49
50
# File 'lib/google/apis/recaptchaenterprise_v1/service.rb', line 45

def initialize
  super('https://recaptchaenterprise.googleapis.com/', '',
        client_name: 'google-apis-recaptchaenterprise_v1',
        client_version: Google::Apis::RecaptchaenterpriseV1::GEM_VERSION)
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

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.

Returns:

  • (String)

    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/recaptchaenterprise_v1/service.rb', line 38

def key
  @key
end

#quota_userString

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.

Returns:

  • (String)

    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/recaptchaenterprise_v1/service.rb', line 43

def quota_user
  @quota_user
end

Instance Method Details

#annotate_project_assessment(name, google_cloud_recaptchaenterprise_v1_annotate_assessment_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentResponse

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

Parameters:

  • name (String)

    Required. The resource name of the Assessment, in the format "projects/ project/assessments/assessment".

  • google_cloud_recaptchaenterprise_v1_annotate_assessment_request_object (Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



75
76
77
78
79
80
81
82
83
84
85
# File 'lib/google/apis/recaptchaenterprise_v1/service.rb', line 75

def annotate_project_assessment(name, google_cloud_recaptchaenterprise_v1_annotate_assessment_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:annotate', options)
  command.request_representation = Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentRequest::Representation
  command.request_object = google_cloud_recaptchaenterprise_v1_annotate_assessment_request_object
  command.response_representation = Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentResponse::Representation
  command.response_class = Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentResponse
  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

#create_project_assessment(parent, google_cloud_recaptchaenterprise_v1_assessment_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Assessment

Creates an Assessment of the likelihood an event is legitimate.

Parameters:

  • parent (String)

    Required. The name of the project in which the assessment will be created, in the format "projects/project".

  • google_cloud_recaptchaenterprise_v1_assessment_object (Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Assessment) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



109
110
111
112
113
114
115
116
117
118
119
# File 'lib/google/apis/recaptchaenterprise_v1/service.rb', line 109

def create_project_assessment(parent, google_cloud_recaptchaenterprise_v1_assessment_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/assessments', options)
  command.request_representation = Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Assessment::Representation
  command.request_object = google_cloud_recaptchaenterprise_v1_assessment_object
  command.response_representation = Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Assessment::Representation
  command.response_class = Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Assessment
  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

#create_project_key(parent, google_cloud_recaptchaenterprise_v1_key_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Key

Creates a new reCAPTCHA Enterprise key.

Parameters:

  • parent (String)

    Required. The name of the project in which the key will be created, in the format "projects/project".

  • google_cloud_recaptchaenterprise_v1_key_object (Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Key) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



143
144
145
146
147
148
149
150
151
152
153
# File 'lib/google/apis/recaptchaenterprise_v1/service.rb', line 143

def create_project_key(parent, google_cloud_recaptchaenterprise_v1_key_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+parent}/keys', options)
  command.request_representation = Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Key::Representation
  command.request_object = google_cloud_recaptchaenterprise_v1_key_object
  command.response_representation = Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Key::Representation
  command.response_class = Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Key
  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_key(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RecaptchaenterpriseV1::GoogleProtobufEmpty

Deletes the specified key.

Parameters:

  • name (String)

    Required. The name of the key to be deleted, in the format "projects/project/ keys/key".

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



176
177
178
179
180
181
182
183
184
# File 'lib/google/apis/recaptchaenterprise_v1/service.rb', line 176

def delete_project_key(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:delete, 'v1/{+name}', options)
  command.response_representation = Google::Apis::RecaptchaenterpriseV1::GoogleProtobufEmpty::Representation
  command.response_class = Google::Apis::RecaptchaenterpriseV1::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_key(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Key

Returns the specified key.

Parameters:

  • name (String)

    Required. The name of the requested key, in the format "projects/project/ keys/key".

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



207
208
209
210
211
212
213
214
215
# File 'lib/google/apis/recaptchaenterprise_v1/service.rb', line 207

def get_project_key(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Key::Representation
  command.response_class = Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Key
  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_key_metrics(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Metrics

Get some aggregated metrics for a Key. This data can be used to build dashboards.

Parameters:

  • name (String)

    Required. The name of the requested metrics, in the format "projects/project/ keys/key/metrics".

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



239
240
241
242
243
244
245
246
247
# File 'lib/google/apis/recaptchaenterprise_v1/service.rb', line 239

def get_project_key_metrics(name, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Metrics::Representation
  command.response_class = Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Metrics
  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_keys(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1ListKeysResponse

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

Parameters:

  • parent (String)

    Required. The name of the project that contains the keys that will be listed, in the format "projects/project".

  • page_size (Fixnum) (defaults to: nil)

    Optional. The maximum number of keys to return. Default is 10. Max limit is 1000.

  • page_token (String) (defaults to: nil)

    Optional. The next_page_token value returned from a previous. ListKeysRequest, if any.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



276
277
278
279
280
281
282
283
284
285
286
# File 'lib/google/apis/recaptchaenterprise_v1/service.rb', line 276

def list_project_keys(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:get, 'v1/{+parent}/keys', options)
  command.response_representation = Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1ListKeysResponse::Representation
  command.response_class = Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1ListKeysResponse
  command.params['parent'] = parent unless parent.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

#migrate_project_key(name, google_cloud_recaptchaenterprise_v1_migrate_key_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Key

Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. Once a key is migrated, it can be used from either product. SiteVerify requests are billed as CreateAssessment calls. You must be authenticated as one of the current owners of the reCAPTCHA Site Key, and your user must have the reCAPTCHA Enterprise Admin IAM role in the destination project.

Parameters:

  • name (String)

    Required. The name of the key to be migrated, in the format "projects/project /keys/key".

  • google_cloud_recaptchaenterprise_v1_migrate_key_request_object (Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1MigrateKeyRequest) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



314
315
316
317
318
319
320
321
322
323
324
# File 'lib/google/apis/recaptchaenterprise_v1/service.rb', line 314

def migrate_project_key(name, google_cloud_recaptchaenterprise_v1_migrate_key_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:post, 'v1/{+name}:migrate', options)
  command.request_representation = Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1MigrateKeyRequest::Representation
  command.request_object = google_cloud_recaptchaenterprise_v1_migrate_key_request_object
  command.response_representation = Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Key::Representation
  command.response_class = Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Key
  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

#patch_project_key(name, google_cloud_recaptchaenterprise_v1_key_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Key

Updates the specified key.

Parameters:

  • name (String)

    The resource name for the Key in the format "projects/project/keys/key".

  • google_cloud_recaptchaenterprise_v1_key_object (Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Key) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Optional. The mask to control which fields of the key get updated. If the mask is not present, all fields will be updated.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    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.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:

  • (Google::Apis::ServerError)

    An error occurred on the server and the request can be retried

  • (Google::Apis::ClientError)

    The request is invalid and should not be retried without modification

  • (Google::Apis::AuthorizationError)

    Authorization is required



350
351
352
353
354
355
356
357
358
359
360
361
# File 'lib/google/apis/recaptchaenterprise_v1/service.rb', line 350

def patch_project_key(name, google_cloud_recaptchaenterprise_v1_key_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  command = make_simple_command(:patch, 'v1/{+name}', options)
  command.request_representation = Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Key::Representation
  command.request_object = google_cloud_recaptchaenterprise_v1_key_object
  command.response_representation = Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Key::Representation
  command.response_class = Google::Apis::RecaptchaenterpriseV1::GoogleCloudRecaptchaenterpriseV1Key
  command.params['name'] = name unless name.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end