google-cloud-recaptcha_enterprise-v1beta1 0.4.3 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0b38ec3567feb5a16188e5ab3a23d80c606bd95520677589c887cb3949434bee
4
- data.tar.gz: 1164e43d9b5de6b8a254154e258d1a28f4ee56cfb6cba68819e1f192cefbd058
3
+ metadata.gz: d725db565813ecf088e0455f27d57b12cb30501c90488751a2175912a3b8a814
4
+ data.tar.gz: c2519580e8d59434d1f1c8455ab14dc15e49b093567fdc93bb2d23374bc37c07
5
5
  SHA512:
6
- metadata.gz: 94d9e109bdb7f1156685d4bf0a0a475e48efae11ef4d9a43c3e44f6c1dfbfaf29185e66ead13aef683508ea868d4d53c632f43bbc188e104b83ecaf6acb3e346
7
- data.tar.gz: 4033bf954fef60ad29afc352b5b57e8fe63de4cc15c14539a9904cb3880e29b4e485c1703e964724ec677c24e850c47df6acca779721b95eb5173b10993a46b8
6
+ metadata.gz: 65662d5d8c1ad19f039934d6b31ac4aba1047fb64d6900e12dfe5115defce76e2f7eeb498983918218cebbcdc9bb8ecb51e562a31f34e032d10b9cb1d7d57002
7
+ data.tar.gz: aee7bb13eac33dff2048a8b447a7e7c904ba71af894fb9c919c2eb5d45d440c598d3df076c54711885a10089e5272c1e08948854caff516e2e62541c04bb9db4
data/.yardopts CHANGED
@@ -1,5 +1,5 @@
1
1
  --no-private
2
- --title=reCAPTCHA Enterprise V1beta1 API
2
+ --title="reCAPTCHA Enterprise V1beta1 API"
3
3
  --exclude _pb\.rb$
4
4
  --markup markdown
5
5
  --markup-provider redcarpet
data/AUTHENTICATION.md CHANGED
@@ -120,15 +120,6 @@ To configure your system for this, simply:
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
121
121
  *should* only be used during development.
122
122
 
123
- [gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
124
- [dev-console]: https://console.cloud.google.com/project
125
-
126
- [enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
127
-
128
- [create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
129
- [create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
130
- [reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
131
-
132
123
  ## Creating a Service Account
133
124
 
134
125
  Google Cloud requires **Service Account Credentials** to
@@ -139,31 +130,22 @@ If you are not running this client within
139
130
  [Google Cloud Platform environments](#google-cloud-platform-environments), you
140
131
  need a Google Developers service account.
141
132
 
142
- 1. Visit the [Google Developers Console][dev-console].
133
+ 1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
143
134
  2. Create a new project or click on an existing project.
144
- 3. Activate the slide-out navigation tray and select **API Manager**. From
135
+ 3. Activate the menu in the upper left and select **APIs & Services**. From
145
136
  here, you will enable the APIs that your application requires.
146
137
 
147
- ![Enable the APIs that your application requires][enable-apis]
148
-
149
138
  *Note: You may need to enable billing in order to use these services.*
150
139
 
151
140
  4. Select **Credentials** from the side navigation.
152
141
 
153
- You should see a screen like one of the following.
154
-
155
- ![Create a new service account][create-new-service-account]
156
-
157
- ![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
158
-
159
- Find the "Add credentials" drop down and select "Service account" to be
160
- guided through downloading a new JSON key file.
142
+ Find the "Create credentials" drop down near the top of the page, and select
143
+ "Service account" to be guided through downloading a new JSON key file.
161
144
 
162
145
  If you want to re-use an existing service account, you can easily generate a
163
- new key file. Just select the account you wish to re-use, and click "Generate
164
- new JSON key":
165
-
166
- ![Re-use an existing service account][reuse-service-account]
146
+ new key file. Just select the account you wish to re-use, click the pencil
147
+ tool on the right side to edit the service account, select the **Keys** tab,
148
+ and then select **Add Key**.
167
149
 
168
150
  The key file you download will be used by this library to authenticate API
169
151
  requests and should be stored in a secure location.
data/README.md CHANGED
@@ -37,7 +37,7 @@ request = ::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest
37
37
  response = client.create_assessment request
38
38
  ```
39
39
 
40
- View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-recaptcha_enterprise-v1beta1/latest)
40
+ View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-recaptcha_enterprise-v1beta1/latest)
41
41
  for class and method documentation.
42
42
 
43
43
  See also the [Product Documentation](https://cloud.google.com/recaptcha-enterprise)
@@ -68,16 +68,6 @@ module Google
68
68
 
69
69
  default_config.rpcs.annotate_assessment.timeout = 600.0
70
70
 
71
- default_config.rpcs.create_key.timeout = 600.0
72
-
73
- default_config.rpcs.list_keys.timeout = 600.0
74
-
75
- default_config.rpcs.get_key.timeout = 600.0
76
-
77
- default_config.rpcs.update_key.timeout = 600.0
78
-
79
- default_config.rpcs.delete_key.timeout = 600.0
80
-
81
71
  default_config
82
72
  end
83
73
  yield @configure if block_given?
@@ -190,6 +180,21 @@ module Google
190
180
  #
191
181
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
192
182
  #
183
+ # @example Basic example
184
+ # require "google/cloud/recaptcha_enterprise/v1beta1"
185
+ #
186
+ # # Create a client object. The client can be reused for multiple calls.
187
+ # client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new
188
+ #
189
+ # # Create a request. To set request fields, pass in keyword arguments.
190
+ # request = Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest.new
191
+ #
192
+ # # Call the create_assessment method.
193
+ # result = client.create_assessment request
194
+ #
195
+ # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment.
196
+ # p result
197
+ #
193
198
  def create_assessment request, options = nil
194
199
  raise ::ArgumentError, "request must be provided" if request.nil?
195
200
 
@@ -207,9 +212,11 @@ module Google
207
212
  gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION
208
213
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
209
214
 
210
- header_params = {
211
- "parent" => request.parent
212
- }
215
+ header_params = {}
216
+ if request.parent
217
+ header_params["parent"] = request.parent
218
+ end
219
+
213
220
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
214
221
  metadata[:"x-goog-request-params"] ||= request_params_header
215
222
 
@@ -243,7 +250,7 @@ module Google
243
250
  # @param options [::Gapic::CallOptions, ::Hash]
244
251
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
245
252
  #
246
- # @overload annotate_assessment(name: nil, annotation: nil)
253
+ # @overload annotate_assessment(name: nil, annotation: nil, reasons: nil, hashed_account_id: nil)
247
254
  # Pass arguments to `annotate_assessment` via keyword arguments. Note that at
248
255
  # least one keyword argument is required. To specify no parameters, or to keep all
249
256
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -252,7 +259,17 @@ module Google
252
259
  # Required. The resource name of the Assessment, in the format
253
260
  # "projects/\\{project_number}/assessments/\\{assessment_id}".
254
261
  # @param annotation [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Annotation]
255
- # Required. The annotation that will be assigned to the Event.
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.
265
+ # @param reasons [::Array<::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest::Reason>]
266
+ # Optional. Optional reasons for the annotation that will be assigned to the Event.
267
+ # @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
270
+ # CreateAssessment, for example when the account identifier is not yet known
271
+ # in the initial request. It is recommended that the identifier is hashed
272
+ # using hmac-sha256 with stable secret.
256
273
  #
257
274
  # @yield [response, operation] Access the result along with the RPC operation
258
275
  # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse]
@@ -262,303 +279,31 @@ module Google
262
279
  #
263
280
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
264
281
  #
265
- def annotate_assessment request, options = nil
266
- raise ::ArgumentError, "request must be provided" if request.nil?
267
-
268
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest
269
-
270
- # Converts hash and nil to an options object
271
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
272
-
273
- # Customize the options with defaults
274
- metadata = @config.rpcs.annotate_assessment.metadata.to_h
275
-
276
- # Set x-goog-api-client and x-goog-user-project headers
277
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
278
- lib_name: @config.lib_name, lib_version: @config.lib_version,
279
- gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION
280
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
281
-
282
- header_params = {
283
- "name" => request.name
284
- }
285
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
286
- metadata[:"x-goog-request-params"] ||= request_params_header
287
-
288
- options.apply_defaults timeout: @config.rpcs.annotate_assessment.timeout,
289
- metadata: metadata,
290
- retry_policy: @config.rpcs.annotate_assessment.retry_policy
291
-
292
- options.apply_defaults timeout: @config.timeout,
293
- metadata: @config.metadata,
294
- retry_policy: @config.retry_policy
295
-
296
- @recaptcha_enterprise_service_stub.call_rpc :annotate_assessment, request, options: options do |response, operation|
297
- yield response, operation if block_given?
298
- return response
299
- end
300
- rescue ::GRPC::BadStatus => e
301
- raise ::Google::Cloud::Error.from_error(e)
302
- end
303
-
304
- ##
305
- # Creates a new reCAPTCHA Enterprise key.
306
- #
307
- # @overload create_key(request, options = nil)
308
- # Pass arguments to `create_key` via a request object, either of type
309
- # {::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateKeyRequest} or an equivalent Hash.
310
- #
311
- # @param request [::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateKeyRequest, ::Hash]
312
- # A request object representing the call parameters. Required. To specify no
313
- # parameters, or to keep all the default parameter values, pass an empty Hash.
314
- # @param options [::Gapic::CallOptions, ::Hash]
315
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
316
- #
317
- # @overload create_key(parent: nil, key: nil)
318
- # Pass arguments to `create_key` via keyword arguments. Note that at
319
- # least one keyword argument is required. To specify no parameters, or to keep all
320
- # the default parameter values, pass an empty Hash as a request object (see above).
321
- #
322
- # @param parent [::String]
323
- # Required. The name of the project in which the key will be created, in the
324
- # format "projects/\\{project_number}".
325
- # @param key [::Google::Cloud::RecaptchaEnterprise::V1beta1::Key, ::Hash]
326
- # Required. Information to create a reCAPTCHA Enterprise key.
327
- #
328
- # @yield [response, operation] Access the result along with the RPC operation
329
- # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1beta1::Key]
330
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
331
- #
332
- # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::Key]
333
- #
334
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
335
- #
336
- def create_key request, options = nil
337
- raise ::ArgumentError, "request must be provided" if request.nil?
338
-
339
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1beta1::CreateKeyRequest
340
-
341
- # Converts hash and nil to an options object
342
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
343
-
344
- # Customize the options with defaults
345
- metadata = @config.rpcs.create_key.metadata.to_h
346
-
347
- # Set x-goog-api-client and x-goog-user-project headers
348
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
349
- lib_name: @config.lib_name, lib_version: @config.lib_version,
350
- gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION
351
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
352
-
353
- header_params = {
354
- "parent" => request.parent
355
- }
356
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
357
- metadata[:"x-goog-request-params"] ||= request_params_header
358
-
359
- options.apply_defaults timeout: @config.rpcs.create_key.timeout,
360
- metadata: metadata,
361
- retry_policy: @config.rpcs.create_key.retry_policy
362
-
363
- options.apply_defaults timeout: @config.timeout,
364
- metadata: @config.metadata,
365
- retry_policy: @config.retry_policy
366
-
367
- @recaptcha_enterprise_service_stub.call_rpc :create_key, request, options: options do |response, operation|
368
- yield response, operation if block_given?
369
- return response
370
- end
371
- rescue ::GRPC::BadStatus => e
372
- raise ::Google::Cloud::Error.from_error(e)
373
- end
374
-
375
- ##
376
- # Returns the list of all keys that belong to a project.
377
- #
378
- # @overload list_keys(request, options = nil)
379
- # Pass arguments to `list_keys` via a request object, either of type
380
- # {::Google::Cloud::RecaptchaEnterprise::V1beta1::ListKeysRequest} or an equivalent Hash.
381
- #
382
- # @param request [::Google::Cloud::RecaptchaEnterprise::V1beta1::ListKeysRequest, ::Hash]
383
- # A request object representing the call parameters. Required. To specify no
384
- # parameters, or to keep all the default parameter values, pass an empty Hash.
385
- # @param options [::Gapic::CallOptions, ::Hash]
386
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
387
- #
388
- # @overload list_keys(parent: nil, page_size: nil, page_token: nil)
389
- # Pass arguments to `list_keys` via keyword arguments. Note that at
390
- # least one keyword argument is required. To specify no parameters, or to keep all
391
- # the default parameter values, pass an empty Hash as a request object (see above).
392
- #
393
- # @param parent [::String]
394
- # Required. The name of the project that contains the keys that will be
395
- # listed, in the format "projects/\\{project_number}".
396
- # @param page_size [::Integer]
397
- # Optional. The maximum number of keys to return. Default is 10. Max limit is
398
- # 1000.
399
- # @param page_token [::String]
400
- # Optional. The next_page_token value returned from a previous.
401
- # ListKeysRequest, if any.
402
- #
403
- # @yield [response, operation] Access the result along with the RPC operation
404
- # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1beta1::Key>]
405
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
406
- #
407
- # @return [::Gapic::PagedEnumerable<::Google::Cloud::RecaptchaEnterprise::V1beta1::Key>]
408
- #
409
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
410
- #
411
- def list_keys request, options = nil
412
- raise ::ArgumentError, "request must be provided" if request.nil?
413
-
414
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1beta1::ListKeysRequest
415
-
416
- # Converts hash and nil to an options object
417
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
418
-
419
- # Customize the options with defaults
420
- metadata = @config.rpcs.list_keys.metadata.to_h
421
-
422
- # Set x-goog-api-client and x-goog-user-project headers
423
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
424
- lib_name: @config.lib_name, lib_version: @config.lib_version,
425
- gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION
426
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
427
-
428
- header_params = {
429
- "parent" => request.parent
430
- }
431
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
432
- metadata[:"x-goog-request-params"] ||= request_params_header
433
-
434
- options.apply_defaults timeout: @config.rpcs.list_keys.timeout,
435
- metadata: metadata,
436
- retry_policy: @config.rpcs.list_keys.retry_policy
437
-
438
- options.apply_defaults timeout: @config.timeout,
439
- metadata: @config.metadata,
440
- retry_policy: @config.retry_policy
441
-
442
- @recaptcha_enterprise_service_stub.call_rpc :list_keys, request, options: options do |response, operation|
443
- response = ::Gapic::PagedEnumerable.new @recaptcha_enterprise_service_stub, :list_keys, request, response, operation, options
444
- yield response, operation if block_given?
445
- return response
446
- end
447
- rescue ::GRPC::BadStatus => e
448
- raise ::Google::Cloud::Error.from_error(e)
449
- end
450
-
451
- ##
452
- # Returns the specified key.
453
- #
454
- # @overload get_key(request, options = nil)
455
- # Pass arguments to `get_key` via a request object, either of type
456
- # {::Google::Cloud::RecaptchaEnterprise::V1beta1::GetKeyRequest} or an equivalent Hash.
457
- #
458
- # @param request [::Google::Cloud::RecaptchaEnterprise::V1beta1::GetKeyRequest, ::Hash]
459
- # A request object representing the call parameters. Required. To specify no
460
- # parameters, or to keep all the default parameter values, pass an empty Hash.
461
- # @param options [::Gapic::CallOptions, ::Hash]
462
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
463
- #
464
- # @overload get_key(name: nil)
465
- # Pass arguments to `get_key` via keyword arguments. Note that at
466
- # least one keyword argument is required. To specify no parameters, or to keep all
467
- # the default parameter values, pass an empty Hash as a request object (see above).
468
- #
469
- # @param name [::String]
470
- # Required. The name of the requested key, in the format
471
- # "projects/\\{project_number}/keys/\\{key_id}".
472
- #
473
- # @yield [response, operation] Access the result along with the RPC operation
474
- # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1beta1::Key]
475
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
476
- #
477
- # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::Key]
478
- #
479
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
480
- #
481
- def get_key request, options = nil
482
- raise ::ArgumentError, "request must be provided" if request.nil?
483
-
484
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1beta1::GetKeyRequest
485
-
486
- # Converts hash and nil to an options object
487
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
488
-
489
- # Customize the options with defaults
490
- metadata = @config.rpcs.get_key.metadata.to_h
491
-
492
- # Set x-goog-api-client and x-goog-user-project headers
493
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
494
- lib_name: @config.lib_name, lib_version: @config.lib_version,
495
- gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION
496
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
497
-
498
- header_params = {
499
- "name" => request.name
500
- }
501
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
502
- metadata[:"x-goog-request-params"] ||= request_params_header
503
-
504
- options.apply_defaults timeout: @config.rpcs.get_key.timeout,
505
- metadata: metadata,
506
- retry_policy: @config.rpcs.get_key.retry_policy
507
-
508
- options.apply_defaults timeout: @config.timeout,
509
- metadata: @config.metadata,
510
- retry_policy: @config.retry_policy
511
-
512
- @recaptcha_enterprise_service_stub.call_rpc :get_key, request, options: options do |response, operation|
513
- yield response, operation if block_given?
514
- return response
515
- end
516
- rescue ::GRPC::BadStatus => e
517
- raise ::Google::Cloud::Error.from_error(e)
518
- end
519
-
520
- ##
521
- # Updates the specified key.
282
+ # @example Basic example
283
+ # require "google/cloud/recaptcha_enterprise/v1beta1"
522
284
  #
523
- # @overload update_key(request, options = nil)
524
- # Pass arguments to `update_key` via a request object, either of type
525
- # {::Google::Cloud::RecaptchaEnterprise::V1beta1::UpdateKeyRequest} or an equivalent Hash.
285
+ # # Create a client object. The client can be reused for multiple calls.
286
+ # client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new
526
287
  #
527
- # @param request [::Google::Cloud::RecaptchaEnterprise::V1beta1::UpdateKeyRequest, ::Hash]
528
- # A request object representing the call parameters. Required. To specify no
529
- # parameters, or to keep all the default parameter values, pass an empty Hash.
530
- # @param options [::Gapic::CallOptions, ::Hash]
531
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
532
- #
533
- # @overload update_key(key: nil, update_mask: nil)
534
- # Pass arguments to `update_key` via keyword arguments. Note that at
535
- # least one keyword argument is required. To specify no parameters, or to keep all
536
- # the default parameter values, pass an empty Hash as a request object (see above).
537
- #
538
- # @param key [::Google::Cloud::RecaptchaEnterprise::V1beta1::Key, ::Hash]
539
- # Required. The key to update.
540
- # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
541
- # Optional. The mask to control which field of the key get updated. If the mask is not
542
- # present, all fields will be updated.
543
- #
544
- # @yield [response, operation] Access the result along with the RPC operation
545
- # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1beta1::Key]
546
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
288
+ # # Create a request. To set request fields, pass in keyword arguments.
289
+ # request = Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest.new
547
290
  #
548
- # @return [::Google::Cloud::RecaptchaEnterprise::V1beta1::Key]
291
+ # # Call the annotate_assessment method.
292
+ # result = client.annotate_assessment request
549
293
  #
550
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
294
+ # # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse.
295
+ # p result
551
296
  #
552
- def update_key request, options = nil
297
+ def annotate_assessment request, options = nil
553
298
  raise ::ArgumentError, "request must be provided" if request.nil?
554
299
 
555
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1beta1::UpdateKeyRequest
300
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest
556
301
 
557
302
  # Converts hash and nil to an options object
558
303
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
559
304
 
560
305
  # Customize the options with defaults
561
- metadata = @config.rpcs.update_key.metadata.to_h
306
+ metadata = @config.rpcs.annotate_assessment.metadata.to_h
562
307
 
563
308
  # Set x-goog-api-client and x-goog-user-project headers
564
309
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
@@ -566,90 +311,23 @@ module Google
566
311
  gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION
567
312
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
568
313
 
569
- header_params = {
570
- "key.name" => request.key.name
571
- }
572
- request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
573
- metadata[:"x-goog-request-params"] ||= request_params_header
574
-
575
- options.apply_defaults timeout: @config.rpcs.update_key.timeout,
576
- metadata: metadata,
577
- retry_policy: @config.rpcs.update_key.retry_policy
578
-
579
- options.apply_defaults timeout: @config.timeout,
580
- metadata: @config.metadata,
581
- retry_policy: @config.retry_policy
582
-
583
- @recaptcha_enterprise_service_stub.call_rpc :update_key, request, options: options do |response, operation|
584
- yield response, operation if block_given?
585
- return response
314
+ header_params = {}
315
+ if request.name
316
+ header_params["name"] = request.name
586
317
  end
587
- rescue ::GRPC::BadStatus => e
588
- raise ::Google::Cloud::Error.from_error(e)
589
- end
590
318
 
591
- ##
592
- # Deletes the specified key.
593
- #
594
- # @overload delete_key(request, options = nil)
595
- # Pass arguments to `delete_key` via a request object, either of type
596
- # {::Google::Cloud::RecaptchaEnterprise::V1beta1::DeleteKeyRequest} or an equivalent Hash.
597
- #
598
- # @param request [::Google::Cloud::RecaptchaEnterprise::V1beta1::DeleteKeyRequest, ::Hash]
599
- # A request object representing the call parameters. Required. To specify no
600
- # parameters, or to keep all the default parameter values, pass an empty Hash.
601
- # @param options [::Gapic::CallOptions, ::Hash]
602
- # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
603
- #
604
- # @overload delete_key(name: nil)
605
- # Pass arguments to `delete_key` via keyword arguments. Note that at
606
- # least one keyword argument is required. To specify no parameters, or to keep all
607
- # the default parameter values, pass an empty Hash as a request object (see above).
608
- #
609
- # @param name [::String]
610
- # Required. The name of the key to be deleted, in the format
611
- # "projects/\\{project_number}/keys/\\{key_id}".
612
- #
613
- # @yield [response, operation] Access the result along with the RPC operation
614
- # @yieldparam response [::Google::Protobuf::Empty]
615
- # @yieldparam operation [::GRPC::ActiveCall::Operation]
616
- #
617
- # @return [::Google::Protobuf::Empty]
618
- #
619
- # @raise [::Google::Cloud::Error] if the RPC is aborted.
620
- #
621
- def delete_key request, options = nil
622
- raise ::ArgumentError, "request must be provided" if request.nil?
623
-
624
- request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1beta1::DeleteKeyRequest
625
-
626
- # Converts hash and nil to an options object
627
- options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
628
-
629
- # Customize the options with defaults
630
- metadata = @config.rpcs.delete_key.metadata.to_h
631
-
632
- # Set x-goog-api-client and x-goog-user-project headers
633
- metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
634
- lib_name: @config.lib_name, lib_version: @config.lib_version,
635
- gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION
636
- metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
637
-
638
- header_params = {
639
- "name" => request.name
640
- }
641
319
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
642
320
  metadata[:"x-goog-request-params"] ||= request_params_header
643
321
 
644
- options.apply_defaults timeout: @config.rpcs.delete_key.timeout,
322
+ options.apply_defaults timeout: @config.rpcs.annotate_assessment.timeout,
645
323
  metadata: metadata,
646
- retry_policy: @config.rpcs.delete_key.retry_policy
324
+ retry_policy: @config.rpcs.annotate_assessment.retry_policy
647
325
 
648
326
  options.apply_defaults timeout: @config.timeout,
649
327
  metadata: @config.metadata,
650
328
  retry_policy: @config.retry_policy
651
329
 
652
- @recaptcha_enterprise_service_stub.call_rpc :delete_key, request, options: options do |response, operation|
330
+ @recaptcha_enterprise_service_stub.call_rpc :annotate_assessment, request, options: options do |response, operation|
653
331
  yield response, operation if block_given?
654
332
  return response
655
333
  end
@@ -802,31 +480,6 @@ module Google
802
480
  # @return [::Gapic::Config::Method]
803
481
  #
804
482
  attr_reader :annotate_assessment
805
- ##
806
- # RPC-specific configuration for `create_key`
807
- # @return [::Gapic::Config::Method]
808
- #
809
- attr_reader :create_key
810
- ##
811
- # RPC-specific configuration for `list_keys`
812
- # @return [::Gapic::Config::Method]
813
- #
814
- attr_reader :list_keys
815
- ##
816
- # RPC-specific configuration for `get_key`
817
- # @return [::Gapic::Config::Method]
818
- #
819
- attr_reader :get_key
820
- ##
821
- # RPC-specific configuration for `update_key`
822
- # @return [::Gapic::Config::Method]
823
- #
824
- attr_reader :update_key
825
- ##
826
- # RPC-specific configuration for `delete_key`
827
- # @return [::Gapic::Config::Method]
828
- #
829
- attr_reader :delete_key
830
483
 
831
484
  # @private
832
485
  def initialize parent_rpcs = nil
@@ -834,16 +487,6 @@ module Google
834
487
  @create_assessment = ::Gapic::Config::Method.new create_assessment_config
835
488
  annotate_assessment_config = parent_rpcs.annotate_assessment if parent_rpcs.respond_to? :annotate_assessment
836
489
  @annotate_assessment = ::Gapic::Config::Method.new annotate_assessment_config
837
- create_key_config = parent_rpcs.create_key if parent_rpcs.respond_to? :create_key
838
- @create_key = ::Gapic::Config::Method.new create_key_config
839
- list_keys_config = parent_rpcs.list_keys if parent_rpcs.respond_to? :list_keys
840
- @list_keys = ::Gapic::Config::Method.new list_keys_config
841
- get_key_config = parent_rpcs.get_key if parent_rpcs.respond_to? :get_key
842
- @get_key = ::Gapic::Config::Method.new get_key_config
843
- update_key_config = parent_rpcs.update_key if parent_rpcs.respond_to? :update_key
844
- @update_key = ::Gapic::Config::Method.new update_key_config
845
- delete_key_config = parent_rpcs.delete_key if parent_rpcs.respond_to? :delete_key
846
- @delete_key = ::Gapic::Config::Method.new delete_key_config
847
490
 
848
491
  yield self if block_given?
849
492
  end
@@ -41,23 +41,6 @@ module Google
41
41
  "projects/#{project}/assessments/#{assessment}"
42
42
  end
43
43
 
44
- ##
45
- # Create a fully-qualified Key resource string.
46
- #
47
- # The resource will be in the following format:
48
- #
49
- # `projects/{project}/keys/{key}`
50
- #
51
- # @param project [String]
52
- # @param key [String]
53
- #
54
- # @return [::String]
55
- def key_path project:, key:
56
- raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
57
-
58
- "projects/#{project}/keys/#{key}"
59
- end
60
-
61
44
  ##
62
45
  # Create a fully-qualified Project resource string.
63
46
  #
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module RecaptchaEnterprise
23
23
  module V1beta1
24
- VERSION = "0.4.3"
24
+ VERSION = "0.5.0"
25
25
  end
26
26
  end
27
27
  end