google-cloud-recaptcha_enterprise-v1beta1 0.6.0 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6d2b9b685918f1ddcc52586febf73554ff9f59c401314e96417466b960ec3e29
4
- data.tar.gz: f416b00e13330e2a7a2fb199b1cdd7f571056718dd6ce92d2a60d3bfc3f87896
3
+ metadata.gz: e48ddd8b5611b430fefd47dafda8bd583d57a47df77e293143781a51a0ebda85
4
+ data.tar.gz: d750e9eb5c847fcb2fda8b0d6b4e970b2ff66c477376cee1ec92f7db4aabdc04
5
5
  SHA512:
6
- metadata.gz: 294aea848ef458333a40d9ee2d10c6a2a99c3abf1aa13ad650b24daac11538cd48195f41683d9dec73d02b1425b37848f9d8905b7770b0241a4e3224be737445
7
- data.tar.gz: c436b82083e84f7fb9e4263afd117bf39cbbefc381dc8c16a3d0075d8e0a7f335d08ea3a0e61b6ba4734cf875024ab99247912578a6b8856fdfbdbd4f75883aa
6
+ metadata.gz: 6c7fdcd8f9246385dae4ab0b51c252f6a5ca98e29dee6e14ea57577cd2d5c6f7c4dbc41f631344308621798d04b4cfeec71ea41956e9c2cb21ac091bebdfc16f
7
+ data.tar.gz: 681f3b3c0c1f21bd3f3a5bf1791a8aeddf1c46148bf96c2a8a99f7bd1f00b166e20252e9822690bb82a3588a4a641c5a17e9c462df186915d9d50fc2e7c8b478
data/AUTHENTICATION.md CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
114
114
  To configure your system for this, simply:
115
115
 
116
116
  1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
117
- 2. Authenticate using OAuth 2.0 `$ gcloud auth login`
117
+ 2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
118
118
  3. Write code as if already authenticated.
119
119
 
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Ruby Client for the reCAPTCHA Enterprise V1beta1 API
2
2
 
3
- API Client library for the reCAPTCHA Enterprise V1beta1 API
3
+ Help protect your website from fraudulent activity, spam, and abuse without creating friction.
4
4
 
5
5
  reCAPTCHA Enterprise is a service that protects your site from spam and abuse.
6
6
 
@@ -46,8 +46,8 @@ for general usage information.
46
46
  ## Enabling Logging
47
47
 
48
48
  To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
49
+ The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
+ or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
51
  that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
52
  and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
53
 
@@ -250,7 +250,7 @@ module Google
250
250
  # @param options [::Gapic::CallOptions, ::Hash]
251
251
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
252
252
  #
253
- # @overload annotate_assessment(name: nil, annotation: nil, reasons: nil, hashed_account_id: nil)
253
+ # @overload annotate_assessment(name: nil, annotation: nil, reasons: nil, hashed_account_id: nil, transaction_event: nil)
254
254
  # Pass arguments to `annotate_assessment` via keyword arguments. Note that at
255
255
  # least one keyword argument is required. To specify no parameters, or to keep all
256
256
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -259,17 +259,21 @@ module Google
259
259
  # Required. The resource name of the Assessment, in the format
260
260
  # "projects/\\{project_number}/assessments/\\{assessment_id}".
261
261
  # @param annotation [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Annotation]
262
- # Optional. The annotation that will be assigned to the Event. This field can be left
263
- # empty to provide reasons that apply to an event without concluding whether
264
- # the event is legitimate or fraudulent.
262
+ # Optional. The annotation that will be assigned to the Event. This field can
263
+ # be left empty to provide reasons that apply to an event without concluding
264
+ # whether the event is legitimate or fraudulent.
265
265
  # @param reasons [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Reason>]
266
- # Optional. Optional reasons for the annotation that will be assigned to the Event.
266
+ # Optional. Optional reasons for the annotation that will be assigned to the
267
+ # Event.
267
268
  # @param hashed_account_id [::String]
268
- # Optional. Optional unique stable hashed user identifier to apply to the assessment.
269
- # This is an alternative to setting the hashed_account_id in
269
+ # Optional. Optional unique stable hashed user identifier to apply to the
270
+ # assessment. This is an alternative to setting the hashed_account_id in
270
271
  # CreateAssessment, for example when the account identifier is not yet known
271
272
  # in the initial request. It is recommended that the identifier is hashed
272
273
  # using hmac-sha256 with stable secret.
274
+ # @param transaction_event [::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionEvent, ::Hash]
275
+ # Optional. If the assessment is part of a payment transaction, provide
276
+ # details on payment lifecycle events that occur in the transaction.
273
277
  #
274
278
  # @yield [response, operation] Access the result along with the RPC operation
275
279
  # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse]
@@ -373,9 +377,9 @@ module Google
373
377
  # * (`String`) The path to a service account key file in JSON format
374
378
  # * (`Hash`) A service account key as a Hash
375
379
  # * (`Google::Auth::Credentials`) A googleauth credentials object
376
- # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
380
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
377
381
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
378
- # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
382
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
379
383
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
380
384
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
381
385
  # * (`nil`) indicating no credentials
@@ -0,0 +1,438 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_pb"
21
+ require "google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module RecaptchaEnterprise
26
+ module V1beta1
27
+ module RecaptchaEnterpriseService
28
+ module Rest
29
+ ##
30
+ # REST client for the RecaptchaEnterpriseService service.
31
+ #
32
+ # Service to determine the likelihood an event is legitimate.
33
+ #
34
+ class Client
35
+ include Paths
36
+
37
+ # @private
38
+ attr_reader :recaptcha_enterprise_service_stub
39
+
40
+ ##
41
+ # Configure the RecaptchaEnterpriseService Client class.
42
+ #
43
+ # See {::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client::Configuration}
44
+ # for a description of the configuration fields.
45
+ #
46
+ # @example
47
+ #
48
+ # # Modify the configuration for all RecaptchaEnterpriseService clients
49
+ # ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.configure do |config|
50
+ # config.timeout = 10.0
51
+ # end
52
+ #
53
+ # @yield [config] Configure the Client client.
54
+ # @yieldparam config [Client::Configuration]
55
+ #
56
+ # @return [Client::Configuration]
57
+ #
58
+ def self.configure
59
+ @configure ||= begin
60
+ namespace = ["Google", "Cloud", "RecaptchaEnterprise", "V1beta1"]
61
+ parent_config = while namespace.any?
62
+ parent_name = namespace.join "::"
63
+ parent_const = const_get parent_name
64
+ break parent_const.configure if parent_const.respond_to? :configure
65
+ namespace.pop
66
+ end
67
+ default_config = Client::Configuration.new parent_config
68
+
69
+ default_config.rpcs.create_assessment.timeout = 600.0
70
+
71
+ default_config.rpcs.annotate_assessment.timeout = 600.0
72
+
73
+ default_config
74
+ end
75
+ yield @configure if block_given?
76
+ @configure
77
+ end
78
+
79
+ ##
80
+ # Configure the RecaptchaEnterpriseService Client instance.
81
+ #
82
+ # The configuration is set to the derived mode, meaning that values can be changed,
83
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
84
+ # should be made on {Client.configure}.
85
+ #
86
+ # See {::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client::Configuration}
87
+ # for a description of the configuration fields.
88
+ #
89
+ # @yield [config] Configure the Client client.
90
+ # @yieldparam config [Client::Configuration]
91
+ #
92
+ # @return [Client::Configuration]
93
+ #
94
+ def configure
95
+ yield @config if block_given?
96
+ @config
97
+ end
98
+
99
+ ##
100
+ # Create a new RecaptchaEnterpriseService REST client object.
101
+ #
102
+ # @example
103
+ #
104
+ # # Create a client using the default configuration
105
+ # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new
106
+ #
107
+ # # Create a client using a custom configuration
108
+ # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new do |config|
109
+ # config.timeout = 10.0
110
+ # end
111
+ #
112
+ # @yield [config] Configure the RecaptchaEnterpriseService client.
113
+ # @yieldparam config [Client::Configuration]
114
+ #
115
+ def initialize
116
+ # Create the configuration object
117
+ @config = Configuration.new Client.configure
118
+
119
+ # Yield the configuration if needed
120
+ yield @config if block_given?
121
+
122
+ # Create credentials
123
+ credentials = @config.credentials
124
+ # Use self-signed JWT if the endpoint is unchanged from default,
125
+ # but only if the default endpoint does not have a region prefix.
126
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
127
+ !@config.endpoint.split(".").first.include?("-")
128
+ credentials ||= Credentials.default scope: @config.scope,
129
+ enable_self_signed_jwt: enable_self_signed_jwt
130
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
131
+ credentials = Credentials.new credentials, scope: @config.scope
132
+ end
133
+
134
+ @quota_project_id = @config.quota_project
135
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
136
+
137
+ @recaptcha_enterprise_service_stub = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
138
+ end
139
+
140
+ # Service calls
141
+
142
+ ##
143
+ # Creates an Assessment of the likelihood an event is legitimate.
144
+ #
145
+ # @overload create_assessment(request, options = nil)
146
+ # Pass arguments to `create_assessment` via a request object, either of type
147
+ # {::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest} or an equivalent Hash.
148
+ #
149
+ # @param request [::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest, ::Hash]
150
+ # A request object representing the call parameters. Required. To specify no
151
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
152
+ # @param options [::Gapic::CallOptions, ::Hash]
153
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
154
+ #
155
+ # @overload create_assessment(parent: nil, assessment: nil)
156
+ # Pass arguments to `create_assessment` via keyword arguments. Note that at
157
+ # least one keyword argument is required. To specify no parameters, or to keep all
158
+ # the default parameter values, pass an empty Hash as a request object (see above).
159
+ #
160
+ # @param parent [::String]
161
+ # Required. The name of the project in which the assessment will be created,
162
+ # in the format "projects/\\{project_number}".
163
+ # @param assessment [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment, ::Hash]
164
+ # Required. The assessment details.
165
+ # @yield [result, operation] Access the result along with the TransportOperation object
166
+ # @yieldparam result [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment]
167
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
168
+ #
169
+ # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment]
170
+ #
171
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
172
+ def create_assessment request, options = nil
173
+ raise ::ArgumentError, "request must be provided" if request.nil?
174
+
175
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest
176
+
177
+ # Converts hash and nil to an options object
178
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
179
+
180
+ # Customize the options with defaults
181
+ call_metadata = @config.rpcs.create_assessment.metadata.to_h
182
+
183
+ # Set x-goog-api-client and x-goog-user-project headers
184
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
185
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
186
+ gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION,
187
+ transports_version_send: [:rest]
188
+
189
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
190
+
191
+ options.apply_defaults timeout: @config.rpcs.create_assessment.timeout,
192
+ metadata: call_metadata,
193
+ retry_policy: @config.rpcs.create_assessment.retry_policy
194
+
195
+ options.apply_defaults timeout: @config.timeout,
196
+ metadata: @config.metadata,
197
+ retry_policy: @config.retry_policy
198
+
199
+ @recaptcha_enterprise_service_stub.create_assessment request, options do |result, operation|
200
+ yield result, operation if block_given?
201
+ return result
202
+ end
203
+ rescue ::Gapic::Rest::Error => e
204
+ raise ::Google::Cloud::Error.from_error(e)
205
+ end
206
+
207
+ ##
208
+ # Annotates a previously created Assessment to provide additional information
209
+ # on whether the event turned out to be authentic or fradulent.
210
+ #
211
+ # @overload annotate_assessment(request, options = nil)
212
+ # Pass arguments to `annotate_assessment` via a request object, either of type
213
+ # {::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest} or an equivalent Hash.
214
+ #
215
+ # @param request [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest, ::Hash]
216
+ # A request object representing the call parameters. Required. To specify no
217
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
218
+ # @param options [::Gapic::CallOptions, ::Hash]
219
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
220
+ #
221
+ # @overload annotate_assessment(name: nil, annotation: nil, reasons: nil, hashed_account_id: nil, transaction_event: nil)
222
+ # Pass arguments to `annotate_assessment` via keyword arguments. Note that at
223
+ # least one keyword argument is required. To specify no parameters, or to keep all
224
+ # the default parameter values, pass an empty Hash as a request object (see above).
225
+ #
226
+ # @param name [::String]
227
+ # Required. The resource name of the Assessment, in the format
228
+ # "projects/\\{project_number}/assessments/\\{assessment_id}".
229
+ # @param annotation [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Annotation]
230
+ # Optional. The annotation that will be assigned to the Event. This field can
231
+ # be left empty to provide reasons that apply to an event without concluding
232
+ # whether the event is legitimate or fraudulent.
233
+ # @param reasons [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Reason>]
234
+ # Optional. Optional reasons for the annotation that will be assigned to the
235
+ # Event.
236
+ # @param hashed_account_id [::String]
237
+ # Optional. Optional unique stable hashed user identifier to apply to the
238
+ # assessment. This is an alternative to setting the hashed_account_id in
239
+ # CreateAssessment, for example when the account identifier is not yet known
240
+ # in the initial request. It is recommended that the identifier is hashed
241
+ # using hmac-sha256 with stable secret.
242
+ # @param transaction_event [::Google::Cloud::RecaptchaEnterprise::V1beta1::TransactionEvent, ::Hash]
243
+ # Optional. If the assessment is part of a payment transaction, provide
244
+ # details on payment lifecycle events that occur in the transaction.
245
+ # @yield [result, operation] Access the result along with the TransportOperation object
246
+ # @yieldparam result [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse]
247
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
248
+ #
249
+ # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse]
250
+ #
251
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
252
+ def annotate_assessment request, options = nil
253
+ raise ::ArgumentError, "request must be provided" if request.nil?
254
+
255
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest
256
+
257
+ # Converts hash and nil to an options object
258
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
259
+
260
+ # Customize the options with defaults
261
+ call_metadata = @config.rpcs.annotate_assessment.metadata.to_h
262
+
263
+ # Set x-goog-api-client and x-goog-user-project headers
264
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
265
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
266
+ gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION,
267
+ transports_version_send: [:rest]
268
+
269
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
270
+
271
+ options.apply_defaults timeout: @config.rpcs.annotate_assessment.timeout,
272
+ metadata: call_metadata,
273
+ retry_policy: @config.rpcs.annotate_assessment.retry_policy
274
+
275
+ options.apply_defaults timeout: @config.timeout,
276
+ metadata: @config.metadata,
277
+ retry_policy: @config.retry_policy
278
+
279
+ @recaptcha_enterprise_service_stub.annotate_assessment request, options do |result, operation|
280
+ yield result, operation if block_given?
281
+ return result
282
+ end
283
+ rescue ::Gapic::Rest::Error => e
284
+ raise ::Google::Cloud::Error.from_error(e)
285
+ end
286
+
287
+ ##
288
+ # Configuration class for the RecaptchaEnterpriseService REST API.
289
+ #
290
+ # This class represents the configuration for RecaptchaEnterpriseService REST,
291
+ # providing control over timeouts, retry behavior, logging, transport
292
+ # parameters, and other low-level controls. Certain parameters can also be
293
+ # applied individually to specific RPCs. See
294
+ # {::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client::Configuration::Rpcs}
295
+ # for a list of RPCs that can be configured independently.
296
+ #
297
+ # Configuration can be applied globally to all clients, or to a single client
298
+ # on construction.
299
+ #
300
+ # @example
301
+ #
302
+ # # Modify the global config, setting the timeout for
303
+ # # create_assessment to 20 seconds,
304
+ # # and all remaining timeouts to 10 seconds.
305
+ # ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.configure do |config|
306
+ # config.timeout = 10.0
307
+ # config.rpcs.create_assessment.timeout = 20.0
308
+ # end
309
+ #
310
+ # # Apply the above configuration only to a new client.
311
+ # client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Rest::Client.new do |config|
312
+ # config.timeout = 10.0
313
+ # config.rpcs.create_assessment.timeout = 20.0
314
+ # end
315
+ #
316
+ # @!attribute [rw] endpoint
317
+ # The hostname or hostname:port of the service endpoint.
318
+ # Defaults to `"recaptchaenterprise.googleapis.com"`.
319
+ # @return [::String]
320
+ # @!attribute [rw] credentials
321
+ # Credentials to send with calls. You may provide any of the following types:
322
+ # * (`String`) The path to a service account key file in JSON format
323
+ # * (`Hash`) A service account key as a Hash
324
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
325
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
326
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
327
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
328
+ # * (`nil`) indicating no credentials
329
+ # @return [::Object]
330
+ # @!attribute [rw] scope
331
+ # The OAuth scopes
332
+ # @return [::Array<::String>]
333
+ # @!attribute [rw] lib_name
334
+ # The library name as recorded in instrumentation and logging
335
+ # @return [::String]
336
+ # @!attribute [rw] lib_version
337
+ # The library version as recorded in instrumentation and logging
338
+ # @return [::String]
339
+ # @!attribute [rw] timeout
340
+ # The call timeout in seconds.
341
+ # @return [::Numeric]
342
+ # @!attribute [rw] metadata
343
+ # Additional headers to be sent with the call.
344
+ # @return [::Hash{::Symbol=>::String}]
345
+ # @!attribute [rw] retry_policy
346
+ # The retry policy. The value is a hash with the following keys:
347
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
348
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
349
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
350
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
351
+ # trigger a retry.
352
+ # @return [::Hash]
353
+ # @!attribute [rw] quota_project
354
+ # A separate project against which to charge quota.
355
+ # @return [::String]
356
+ #
357
+ class Configuration
358
+ extend ::Gapic::Config
359
+
360
+ config_attr :endpoint, "recaptchaenterprise.googleapis.com", ::String
361
+ config_attr :credentials, nil do |value|
362
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
363
+ allowed.any? { |klass| klass === value }
364
+ end
365
+ config_attr :scope, nil, ::String, ::Array, nil
366
+ config_attr :lib_name, nil, ::String, nil
367
+ config_attr :lib_version, nil, ::String, nil
368
+ config_attr :timeout, nil, ::Numeric, nil
369
+ config_attr :metadata, nil, ::Hash, nil
370
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
371
+ config_attr :quota_project, nil, ::String, nil
372
+
373
+ # @private
374
+ def initialize parent_config = nil
375
+ @parent_config = parent_config unless parent_config.nil?
376
+
377
+ yield self if block_given?
378
+ end
379
+
380
+ ##
381
+ # Configurations for individual RPCs
382
+ # @return [Rpcs]
383
+ #
384
+ def rpcs
385
+ @rpcs ||= begin
386
+ parent_rpcs = nil
387
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
388
+ Rpcs.new parent_rpcs
389
+ end
390
+ end
391
+
392
+ ##
393
+ # Configuration RPC class for the RecaptchaEnterpriseService API.
394
+ #
395
+ # Includes fields providing the configuration for each RPC in this service.
396
+ # Each configuration object is of type `Gapic::Config::Method` and includes
397
+ # the following configuration fields:
398
+ #
399
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
400
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
401
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
402
+ # include the following keys:
403
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
404
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
405
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
406
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
407
+ # trigger a retry.
408
+ #
409
+ class Rpcs
410
+ ##
411
+ # RPC-specific configuration for `create_assessment`
412
+ # @return [::Gapic::Config::Method]
413
+ #
414
+ attr_reader :create_assessment
415
+ ##
416
+ # RPC-specific configuration for `annotate_assessment`
417
+ # @return [::Gapic::Config::Method]
418
+ #
419
+ attr_reader :annotate_assessment
420
+
421
+ # @private
422
+ def initialize parent_rpcs = nil
423
+ create_assessment_config = parent_rpcs.create_assessment if parent_rpcs.respond_to? :create_assessment
424
+ @create_assessment = ::Gapic::Config::Method.new create_assessment_config
425
+ annotate_assessment_config = parent_rpcs.annotate_assessment if parent_rpcs.respond_to? :annotate_assessment
426
+ @annotate_assessment = ::Gapic::Config::Method.new annotate_assessment_config
427
+
428
+ yield self if block_given?
429
+ end
430
+ end
431
+ end
432
+ end
433
+ end
434
+ end
435
+ end
436
+ end
437
+ end
438
+ end