Class: Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb

Overview

Client for the RecaptchaEnterpriseService service.

Service to determine the likelihood an event is legitimate.

Defined Under Namespace

Classes: Configuration

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#assessment_path, #firewall_policy_path, #key_path, #metrics_path, #project_path, #related_account_group_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new RecaptchaEnterpriseService client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new

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

Yields:

  • (config)

    Configure the RecaptchaEnterpriseService client.

Yield Parameters:



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 135

def initialize
  # These require statements are intentionally placed here to initialize
  # the gRPC module only when it's required.
  # See https://github.com/googleapis/toolkit/issues/446
  require "gapic/grpc"
  require "google/cloud/recaptchaenterprise/v1/recaptchaenterprise_services_pb"

  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-"))
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end
  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @recaptcha_enterprise_service_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Stub,
    credentials: credentials,
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors,
    channel_pool_config: @config.channel_pool
  )
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the RecaptchaEnterpriseService Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all RecaptchaEnterpriseService clients
::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 59

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "RecaptchaEnterprise", "V1"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.rpcs.create_assessment.timeout = 600.0

    default_config.rpcs.annotate_assessment.timeout = 600.0

    default_config.rpcs.create_key.timeout = 600.0

    default_config.rpcs.list_keys.timeout = 600.0

    default_config.rpcs.get_key.timeout = 600.0

    default_config.rpcs.update_key.timeout = 600.0

    default_config.rpcs.delete_key.timeout = 600.0

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#annotate_assessment(request, options = nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse #annotate_assessment(name: nil, annotation: nil, reasons: nil, account_id: nil, hashed_account_id: nil, transaction_event: nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse

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

Examples:

Basic example

require "google/cloud/recaptcha_enterprise/v1"

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

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

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

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

Overloads:

  • #annotate_assessment(request, options = nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse

    Pass arguments to annotate_assessment via a request object, either of type AnnotateAssessmentRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::RecaptchaEnterprise::V1::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #annotate_assessment(name: nil, annotation: nil, reasons: nil, account_id: nil, hashed_account_id: nil, transaction_event: nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::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) (defaults to: nil)

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

    • annotation (::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest::Annotation) (defaults to: nil)

      Optional. The annotation that will be 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::V1::AnnotateAssessmentRequest::Reason>) (defaults to: nil)

      Optional. Reasons for the annotation that are assigned to the event.

    • account_id (::String) (defaults to: nil)

      Optional. A stable account identifier to apply to the assessment. This is an alternative to setting account_id in CreateAssessment, for example when a stable account identifier is not yet known in the initial request.

    • hashed_account_id (::String) (defaults to: nil)

      Optional. A stable hashed account identifier to apply to the assessment. This is an alternative to setting hashed_account_id in CreateAssessment, for example when a stable account identifier is not yet known in the initial request.

    • transaction_event (::Google::Cloud::RecaptchaEnterprise::V1::TransactionEvent, ::Hash) (defaults to: nil)

      Optional. If the assessment is part of a payment transaction, provide details on payment lifecycle events that occur in the transaction.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 329

def annotate_assessment request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.annotate_assessment..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.annotate_assessment.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.annotate_assessment.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @recaptcha_enterprise_service_stub.call_rpc :annotate_assessment, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#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 configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



105
106
107
108
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 105

def configure
  yield @config if block_given?
  @config
end

#create_assessment(request, options = nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::Assessment #create_assessment(parent: nil, assessment: nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::Assessment

Creates an Assessment of the likelihood an event is legitimate.

Examples:

Basic example

require "google/cloud/recaptcha_enterprise/v1"

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

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

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

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

Overloads:

  • #create_assessment(request, options = nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::Assessment

    Pass arguments to create_assessment via a request object, either of type CreateAssessmentRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::RecaptchaEnterprise::V1::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_assessment(parent: nil, assessment: nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::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:

    • parent (::String) (defaults to: nil)

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

    • assessment (::Google::Cloud::RecaptchaEnterprise::V1::Assessment, ::Hash) (defaults to: nil)

      Required. The assessment details.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 224

def create_assessment request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_assessment..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_assessment.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_assessment.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @recaptcha_enterprise_service_stub.call_rpc :create_assessment, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_firewall_policy(request, options = nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy #create_firewall_policy(parent: nil, firewall_policy: nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy

Creates a new FirewallPolicy, specifying conditions at which reCAPTCHA Enterprise actions can be executed. A project may have a maximum of 1000 policies.

Examples:

Basic example

require "google/cloud/recaptcha_enterprise/v1"

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

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

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

# The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 1139

def create_firewall_policy request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::CreateFirewallPolicyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_firewall_policy..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_firewall_policy.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_firewall_policy.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @recaptcha_enterprise_service_stub.call_rpc :create_firewall_policy, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_key(request, options = nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::Key #create_key(parent: nil, key: nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::Key

Creates a new reCAPTCHA Enterprise key.

Examples:

Basic example

require "google/cloud/recaptcha_enterprise/v1"

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

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

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

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

Overloads:

  • #create_key(request, options = nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::Key

    Pass arguments to create_key via a request object, either of type CreateKeyRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::RecaptchaEnterprise::V1::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #create_key(parent: nil, key: nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::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) (defaults to: nil)

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

    • key (::Google::Cloud::RecaptchaEnterprise::V1::Key, ::Hash) (defaults to: nil)

      Required. Information to create a reCAPTCHA Enterprise key.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 417

def create_key request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_key..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.create_key.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_key.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @recaptcha_enterprise_service_stub.call_rpc :create_key, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_firewall_policy(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_firewall_policy(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes the specified firewall policy.

Examples:

Basic example

require "google/cloud/recaptcha_enterprise/v1"

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

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

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

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

Overloads:

  • #delete_firewall_policy(request, options = nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_firewall_policy via a request object, either of type DeleteFirewallPolicyRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #delete_firewall_policy(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_firewall_policy 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) (defaults to: nil)

      Required. The name of the policy to be deleted, in the format projects/{project}/firewallpolicies/{firewallpolicy}.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 1496

def delete_firewall_policy request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::DeleteFirewallPolicyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_firewall_policy..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_firewall_policy.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_firewall_policy.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @recaptcha_enterprise_service_stub.call_rpc :delete_firewall_policy, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_key(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_key(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes the specified key.

Examples:

Basic example

require "google/cloud/recaptcha_enterprise/v1"

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

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

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

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

Overloads:

  • #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::V1::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #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).

    Parameters:

    • name (::String) (defaults to: nil)

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

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 862

def delete_key request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_key..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.delete_key.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_key.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @recaptcha_enterprise_service_stub.call_rpc :delete_key, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_firewall_policy(request, options = nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy #get_firewall_policy(name: nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy

Returns the specified firewall policy.

Examples:

Basic example

require "google/cloud/recaptcha_enterprise/v1"

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

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

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

# The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy.
p result

Overloads:

  • #get_firewall_policy(request, options = nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy

    Pass arguments to get_firewall_policy via a request object, either of type GetFirewallPolicyRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_firewall_policy(name: nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy

    Pass arguments to get_firewall_policy 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) (defaults to: nil)

      Required. The name of the requested policy, in the format projects/{project}/firewallpolicies/{firewallpolicy}.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 1322

def get_firewall_policy request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::GetFirewallPolicyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_firewall_policy..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_firewall_policy.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_firewall_policy.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @recaptcha_enterprise_service_stub.call_rpc :get_firewall_policy, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_key(request, options = nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::Key #get_key(name: nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::Key

Returns the specified key.

Examples:

Basic example

require "google/cloud/recaptcha_enterprise/v1"

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

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

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

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

Overloads:

  • #get_key(request, options = nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::Key

    Pass arguments to get_key via a request object, either of type GetKeyRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::RecaptchaEnterprise::V1::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_key(name: nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::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).

    Parameters:

    • name (::String) (defaults to: nil)

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

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 688

def get_key request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::GetKeyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_key..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_key.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_key.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @recaptcha_enterprise_service_stub.call_rpc :get_key, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_metrics(request, options = nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::Metrics #get_metrics(name: nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::Metrics

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

Examples:

Basic example

require "google/cloud/recaptcha_enterprise/v1"

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

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

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

# The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::Metrics.
p result

Overloads:

  • #get_metrics(request, options = nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::Metrics

    Pass arguments to get_metrics via a request object, either of type GetMetricsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #get_metrics(name: nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::Metrics

    Pass arguments to get_metrics 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) (defaults to: nil)

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

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 1049

def get_metrics request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_metrics..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.get_metrics.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_metrics.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @recaptcha_enterprise_service_stub.call_rpc :get_metrics, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_firewall_policies(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy> #list_firewall_policies(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy>

Returns the list of all firewall policies that belong to a project.

Examples:

Basic example

require "google/cloud/recaptcha_enterprise/v1"

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

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

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

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy.
  p item
end

Overloads:

  • #list_firewall_policies(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy>

    Pass arguments to list_firewall_policies via a request object, either of type ListFirewallPoliciesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_firewall_policies(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy>

    Pass arguments to list_firewall_policies 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) (defaults to: nil)

      Required. The name of the project to list the policies for, in the format projects/{project}.

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of policies 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. ListFirewallPoliciesRequest, 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.



1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 1235

def list_firewall_policies request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::ListFirewallPoliciesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_firewall_policies..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_firewall_policies.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_firewall_policies.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @recaptcha_enterprise_service_stub.call_rpc :list_firewall_policies, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @recaptcha_enterprise_service_stub, :list_firewall_policies, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_keys(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::Key> #list_keys(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::Key>

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

Examples:

Basic example

require "google/cloud/recaptcha_enterprise/v1"

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

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

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

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::Key.
  p item
end

Overloads:

  • #list_keys(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::Key>

    Pass arguments to list_keys via a request object, either of type ListKeysRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::RecaptchaEnterprise::V1::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_keys(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::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) (defaults to: nil)

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

    • page_size (::Integer) (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.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 513

def list_keys request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::ListKeysRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_keys..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.list_keys.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_keys.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @recaptcha_enterprise_service_stub.call_rpc :list_keys, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @recaptcha_enterprise_service_stub, :list_keys, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

Get memberships in a group of related accounts.

Examples:

Basic example

require "google/cloud/recaptcha_enterprise/v1"

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

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

# Call the list_related_account_group_memberships method.
result = client. request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership.
  p item
end

Overloads:

  • #list_related_account_group_memberships(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership>

    Pass arguments to list_related_account_group_memberships via a request object, either of type ListRelatedAccountGroupMembershipsRequest or an equivalent Hash.

    Parameters:

  • #list_related_account_group_memberships(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership>

    Pass arguments to list_related_account_group_memberships 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) (defaults to: nil)

      Required. The resource name for the related account group in the format projects/{project}/relatedaccountgroups/{relatedaccountgroup}.

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of accounts to return. The service might return fewer than this value. If unspecified, at most 50 accounts are returned. The maximum value is 1000; values above 1000 are coerced to 1000.

    • page_token (::String) (defaults to: nil)

      Optional. A page token, received from a previous ListRelatedAccountGroupMemberships call.

      When paginating, all other parameters provided to ListRelatedAccountGroupMemberships must match the call that provided the page token.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 1788

def  request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupMembershipsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs...to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs..timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs..retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @recaptcha_enterprise_service_stub.call_rpc :list_related_account_group_memberships, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @recaptcha_enterprise_service_stub, :list_related_account_group_memberships, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

List groups of related accounts.

Examples:

Basic example

require "google/cloud/recaptcha_enterprise/v1"

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

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

# Call the list_related_account_groups method.
result = client. request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroup.
  p item
end

Overloads:

  • #list_related_account_groups(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroup>

    Pass arguments to list_related_account_groups via a request object, either of type ListRelatedAccountGroupsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #list_related_account_groups(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroup>

    Pass arguments to list_related_account_groups 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) (defaults to: nil)

      Required. The name of the project to list related account groups from, in the format projects/{project}.

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of groups to return. The service might return fewer than this value. If unspecified, at most 50 groups are returned. The maximum value is 1000; values above 1000 are coerced to 1000.

    • page_token (::String) (defaults to: nil)

      Optional. A page token, received from a previous ListRelatedAccountGroups call. Provide this to retrieve the subsequent page.

      When paginating, all other parameters provided to ListRelatedAccountGroups must match the call that provided the page token.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 1686

def  request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::ListRelatedAccountGroupsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs...to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs..timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs..retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @recaptcha_enterprise_service_stub.call_rpc :list_related_account_groups, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @recaptcha_enterprise_service_stub, :list_related_account_groups, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#migrate_key(request, options = nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::Key #migrate_key(name: nil, skip_billing_check: nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::Key

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 Key, and your user must have the reCAPTCHA Enterprise Admin IAM role in the destination project.

Examples:

Basic example

require "google/cloud/recaptcha_enterprise/v1"

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

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

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

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

Overloads:

  • #migrate_key(request, options = nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::Key

    Pass arguments to migrate_key via a request object, either of type MigrateKeyRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #migrate_key(name: nil, skip_billing_check: nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::Key

    Pass arguments to migrate_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:

    • name (::String) (defaults to: nil)

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

    • skip_billing_check (::Boolean) (defaults to: nil)

      Optional. If true, skips the billing check. A reCAPTCHA Enterprise key or migrated key behaves differently than a reCAPTCHA (non-Enterprise version) key when you reach a quota limit (see https://cloud.google.com/recaptcha-enterprise/quotas#quota_limit). To avoid any disruption of your usage, we check that a billing account is present. If your usage of reCAPTCHA is under the free quota, you can safely skip the billing check and proceed with the migration. See https://cloud.google.com/recaptcha-enterprise/docs/billing-information.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 962

def migrate_key request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.migrate_key..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.migrate_key.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.migrate_key.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @recaptcha_enterprise_service_stub.call_rpc :migrate_key, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#reorder_firewall_policies(request, options = nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesResponse #reorder_firewall_policies(parent: nil, names: nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesResponse

Reorders all firewall policies.

Examples:

Basic example

require "google/cloud/recaptcha_enterprise/v1"

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

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

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

# The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesResponse.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 1585

def reorder_firewall_policies request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::ReorderFirewallPoliciesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.reorder_firewall_policies..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.reorder_firewall_policies.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.reorder_firewall_policies.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @recaptcha_enterprise_service_stub.call_rpc :reorder_firewall_policies, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#retrieve_legacy_secret_key(request, options = nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyResponse #retrieve_legacy_secret_key(key: nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyResponse

Returns the secret key related to the specified public key. You must use the legacy secret key only in a 3rd party integration with legacy reCAPTCHA.

Examples:

Basic example

require "google/cloud/recaptcha_enterprise/v1"

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

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

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

# The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyResponse.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 602

def retrieve_legacy_secret_key request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::RetrieveLegacySecretKeyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.retrieve_legacy_secret_key..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.key
    header_params["key"] = request.key
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.retrieve_legacy_secret_key.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.retrieve_legacy_secret_key.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @recaptcha_enterprise_service_stub.call_rpc :retrieve_legacy_secret_key, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

Search group memberships related to a given account.

Examples:

Basic example

require "google/cloud/recaptcha_enterprise/v1"

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

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

# Call the search_related_account_group_memberships method.
result = client. request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership.
  p item
end

Overloads:

  • #search_related_account_group_memberships(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership>

    Pass arguments to search_related_account_group_memberships via a request object, either of type SearchRelatedAccountGroupMembershipsRequest or an equivalent Hash.

    Parameters:

  • #search_related_account_group_memberships(project: nil, account_id: nil, hashed_account_id: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1::RelatedAccountGroupMembership>

    Pass arguments to search_related_account_group_memberships 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:

    • project (::String) (defaults to: nil)

      Required. The name of the project to search related account group memberships from. Specify the project name in the following format: projects/{project}.

    • account_id (::String) (defaults to: nil)

      Optional. The unique stable account identifier used to search connections. The identifier should correspond to an account_id provided in a previous CreateAssessment or AnnotateAssessment call. Either hashed_account_id or account_id must be set, but not both.

    • hashed_account_id (::String) (defaults to: nil)

      Optional. Deprecated: use account_id instead. The unique stable hashed account identifier used to search connections. The identifier should correspond to a hashed_account_id provided in a previous CreateAssessment or AnnotateAssessment call. Either hashed_account_id or account_id must be set, but not both.

    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of groups to return. The service might return fewer than this value. If unspecified, at most 50 groups are returned. The maximum value is 1000; values above 1000 are coerced to 1000.

    • page_token (::String) (defaults to: nil)

      Optional. A page token, received from a previous SearchRelatedAccountGroupMemberships call. Provide this to retrieve the subsequent page.

      When paginating, all other parameters provided to SearchRelatedAccountGroupMemberships must match the call that provided the page token.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 1903

def  request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::SearchRelatedAccountGroupMembershipsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs...to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.project
    header_params["project"] = request.project
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs..timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs..retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @recaptcha_enterprise_service_stub.call_rpc :search_related_account_group_memberships, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @recaptcha_enterprise_service_stub, :search_related_account_group_memberships, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


115
116
117
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 115

def universe_domain
  @recaptcha_enterprise_service_stub.universe_domain
end

#update_firewall_policy(request, options = nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy #update_firewall_policy(firewall_policy: nil, update_mask: nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy

Updates the specified firewall policy.

Examples:

Basic example

require "google/cloud/recaptcha_enterprise/v1"

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

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

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

# The returned object is of type Google::Cloud::RecaptchaEnterprise::V1::FirewallPolicy.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 1410

def update_firewall_policy request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::UpdateFirewallPolicyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_firewall_policy..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.firewall_policy&.name
    header_params["firewall_policy.name"] = request.firewall_policy.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_firewall_policy.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_firewall_policy.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @recaptcha_enterprise_service_stub.call_rpc :update_firewall_policy, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#update_key(request, options = nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::Key #update_key(key: nil, update_mask: nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::Key

Updates the specified key.

Examples:

Basic example

require "google/cloud/recaptcha_enterprise/v1"

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

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

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

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

Overloads:

  • #update_key(request, options = nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::Key

    Pass arguments to update_key via a request object, either of type UpdateKeyRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::RecaptchaEnterprise::V1::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.

  • #update_key(key: nil, update_mask: nil) ⇒ ::Google::Cloud::RecaptchaEnterprise::V1::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:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the RPC is aborted.



776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
# File 'lib/google/cloud/recaptcha_enterprise/v1/recaptcha_enterprise_service/client.rb', line 776

def update_key request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_key..to_h

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.key&.name
    header_params["key.name"] = request.key.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  options.apply_defaults timeout:      @config.rpcs.update_key.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_key.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @recaptcha_enterprise_service_stub.call_rpc :update_key, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end