google-cloud-recaptcha_enterprise-v1 0.4.0 → 0.5.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: 1bc7d7ed43fb34c6ba9c548aa7f68f6f25de923a7888c4c47730758ae73597b9
4
- data.tar.gz: f553a64a1e54b4977a1a34d523564164c6c7a8d660cfc94c3d26a25b8c8de7bb
3
+ metadata.gz: 80ac614deb6f19fdc91502ed03f14857e6b153008254cc22a61c9105fb3f4e0f
4
+ data.tar.gz: c8177212bb19aba5bf7242281e60fa07abbe5c3895392be2b1d1d479bb75e9ee
5
5
  SHA512:
6
- metadata.gz: 75b2d469d61ffef2472b06cec5069d8800c50ce8abb2c538b3f1b86c414d5a341185902272261c7f7cea0706b6466f717fa588c9190a8e1f9a5ff6c4ef89ea87
7
- data.tar.gz: 0643b2c5e6abc5bc292490addeef3a6860b659ec8fcdb664f72d478eb5231e9e7ee98260eb56ff28f35cf47ca3c87a394202af44394c96d1fb537da1fd57e6df
6
+ metadata.gz: eef410de801d8f28db19ec486243bdc9a1bef11770039e7198e1a957d3e34834f10ef067f5fc5a996e7c9bb82498d775e825325a88045f17fa6d8a84e5d5d12c
7
+ data.tar.gz: 6fcbd07ca6d8aaeb7f3c287353485b4da686d4c30ea91e3d82bc667457f179053b7fc4c3410b617495199ed1fb1a2ff1772c26bbe6b630fca8c7fa98a98ad96f
data/AUTHENTICATION.md CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-recaptcha_enterprise-v1
66
66
  checks for credentials are configured on the service Credentials class (such as
67
67
  {::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Credentials}):
68
68
 
69
- 1. `RECAPTCHA_ENTERPRISE_CREDENTIALS` - Path to JSON file, or JSON contents
70
- 2. `RECAPTCHA_ENTERPRISE_KEYFILE` - Path to JSON file, or JSON contents
71
- 3. `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
- 4. `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
- 5. `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
69
+ * `RECAPTCHA_ENTERPRISE_CREDENTIALS` - Path to JSON file, or JSON contents
70
+ * `RECAPTCHA_ENTERPRISE_KEYFILE` - Path to JSON file, or JSON contents
71
+ * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
+ * `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
+ * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
74
74
 
75
75
  ```ruby
76
76
  require "google/cloud/recaptcha_enterprise/v1"
@@ -82,8 +82,8 @@ client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::C
82
82
 
83
83
  ### Configuration
84
84
 
85
- The **Credentials JSON** can be configured instead of placing them in
86
- environment variables. Either on an individual client initialization:
85
+ The path to the **Credentials JSON** file can be configured instead of storing
86
+ it in an environment variable. Either on an individual client initialization:
87
87
 
88
88
  ```ruby
89
89
  require "google/cloud/recaptcha_enterprise/v1"
@@ -93,7 +93,7 @@ client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::C
93
93
  end
94
94
  ```
95
95
 
96
- Or configured globally for all clients:
96
+ Or globally for all clients:
97
97
 
98
98
  ```ruby
99
99
  require "google/cloud/recaptcha_enterprise/v1"
data/README.md CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
33
33
  require "google/cloud/recaptcha_enterprise/v1"
34
34
 
35
35
  client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new
36
- request = my_create_request
36
+ request = ::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest.new # (request fields as keyword arguments...)
37
37
  response = client.create_assessment request
38
38
  ```
39
39
 
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client::Configuration}
42
42
  # for a description of the configuration fields.
43
43
  #
44
- # ## Example
44
+ # @example
45
45
  #
46
- # To modify the configuration for all RecaptchaEnterpriseService clients:
47
- #
48
- # ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all RecaptchaEnterpriseService clients
47
+ # ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
51
50
  #
52
51
  # @yield [config] Configure the Client client.
53
52
  # @yieldparam config [Client::Configuration]
@@ -108,19 +107,15 @@ module Google
108
107
  ##
109
108
  # Create a new RecaptchaEnterpriseService client object.
110
109
  #
111
- # ## Examples
112
- #
113
- # To create a new RecaptchaEnterpriseService client with the default
114
- # configuration:
110
+ # @example
115
111
  #
116
- # client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new
112
+ # # Create a client using the default configuration
113
+ # client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new
117
114
  #
118
- # To create a new RecaptchaEnterpriseService client with a custom
119
- # configuration:
120
- #
121
- # client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config|
122
- # config.timeout = 10.0
123
- # end
115
+ # # Create a client using a custom configuration
116
+ # client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config|
117
+ # config.timeout = 10.0
118
+ # end
124
119
  #
125
120
  # @yield [config] Configure the RecaptchaEnterpriseService client.
126
121
  # @yieldparam config [Client::Configuration]
@@ -140,14 +135,13 @@ module Google
140
135
 
141
136
  # Create credentials
142
137
  credentials = @config.credentials
143
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
138
+ # Use self-signed JWT if the endpoint is unchanged from default,
144
139
  # but only if the default endpoint does not have a region prefix.
145
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
146
- @config.endpoint == Client.configure.endpoint &&
140
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
147
141
  !@config.endpoint.split(".").first.include?("-")
148
142
  credentials ||= Credentials.default scope: @config.scope,
149
143
  enable_self_signed_jwt: enable_self_signed_jwt
150
- if credentials.is_a?(String) || credentials.is_a?(Hash)
144
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
151
145
  credentials = Credentials.new credentials, scope: @config.scope
152
146
  end
153
147
  @quota_project_id = @config.quota_project
@@ -222,7 +216,9 @@ module Google
222
216
  options.apply_defaults timeout: @config.rpcs.create_assessment.timeout,
223
217
  metadata: metadata,
224
218
  retry_policy: @config.rpcs.create_assessment.retry_policy
225
- options.apply_defaults metadata: @config.metadata,
219
+
220
+ options.apply_defaults timeout: @config.timeout,
221
+ metadata: @config.metadata,
226
222
  retry_policy: @config.retry_policy
227
223
 
228
224
  @recaptcha_enterprise_service_stub.call_rpc :create_assessment, request, options: options do |response, operation|
@@ -235,7 +231,7 @@ module Google
235
231
 
236
232
  ##
237
233
  # Annotates a previously created Assessment to provide additional information
238
- # on whether the event turned out to be authentic or fradulent.
234
+ # on whether the event turned out to be authentic or fraudulent.
239
235
  #
240
236
  # @overload annotate_assessment(request, options = nil)
241
237
  # Pass arguments to `annotate_assessment` via a request object, either of type
@@ -247,7 +243,7 @@ module Google
247
243
  # @param options [::Gapic::CallOptions, ::Hash]
248
244
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
249
245
  #
250
- # @overload annotate_assessment(name: nil, annotation: nil)
246
+ # @overload annotate_assessment(name: nil, annotation: nil, reasons: nil)
251
247
  # Pass arguments to `annotate_assessment` via keyword arguments. Note that at
252
248
  # least one keyword argument is required. To specify no parameters, or to keep all
253
249
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -256,7 +252,11 @@ module Google
256
252
  # Required. The resource name of the Assessment, in the format
257
253
  # "projects/\\{project}/assessments/\\{assessment}".
258
254
  # @param annotation [::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest::Annotation]
259
- # Required. The annotation that will be assigned to the Event.
255
+ # Optional. The annotation that will be assigned to the Event. This field can be left
256
+ # empty to provide reasons that apply to an event without concluding whether
257
+ # the event is legitimate or fraudulent.
258
+ # @param reasons [::Array<::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest::Reason>]
259
+ # Optional. Optional reasons for the annotation that will be assigned to the Event.
260
260
  #
261
261
  # @yield [response, operation] Access the result along with the RPC operation
262
262
  # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse]
@@ -292,7 +292,9 @@ module Google
292
292
  options.apply_defaults timeout: @config.rpcs.annotate_assessment.timeout,
293
293
  metadata: metadata,
294
294
  retry_policy: @config.rpcs.annotate_assessment.retry_policy
295
- options.apply_defaults metadata: @config.metadata,
295
+
296
+ options.apply_defaults timeout: @config.timeout,
297
+ metadata: @config.metadata,
296
298
  retry_policy: @config.retry_policy
297
299
 
298
300
  @recaptcha_enterprise_service_stub.call_rpc :annotate_assessment, request, options: options do |response, operation|
@@ -361,7 +363,9 @@ module Google
361
363
  options.apply_defaults timeout: @config.rpcs.create_key.timeout,
362
364
  metadata: metadata,
363
365
  retry_policy: @config.rpcs.create_key.retry_policy
364
- options.apply_defaults metadata: @config.metadata,
366
+
367
+ options.apply_defaults timeout: @config.timeout,
368
+ metadata: @config.metadata,
365
369
  retry_policy: @config.retry_policy
366
370
 
367
371
  @recaptcha_enterprise_service_stub.call_rpc :create_key, request, options: options do |response, operation|
@@ -434,7 +438,9 @@ module Google
434
438
  options.apply_defaults timeout: @config.rpcs.list_keys.timeout,
435
439
  metadata: metadata,
436
440
  retry_policy: @config.rpcs.list_keys.retry_policy
437
- options.apply_defaults metadata: @config.metadata,
441
+
442
+ options.apply_defaults timeout: @config.timeout,
443
+ metadata: @config.metadata,
438
444
  retry_policy: @config.retry_policy
439
445
 
440
446
  @recaptcha_enterprise_service_stub.call_rpc :list_keys, request, options: options do |response, operation|
@@ -502,7 +508,9 @@ module Google
502
508
  options.apply_defaults timeout: @config.rpcs.get_key.timeout,
503
509
  metadata: metadata,
504
510
  retry_policy: @config.rpcs.get_key.retry_policy
505
- options.apply_defaults metadata: @config.metadata,
511
+
512
+ options.apply_defaults timeout: @config.timeout,
513
+ metadata: @config.metadata,
506
514
  retry_policy: @config.retry_policy
507
515
 
508
516
  @recaptcha_enterprise_service_stub.call_rpc :get_key, request, options: options do |response, operation|
@@ -534,7 +542,7 @@ module Google
534
542
  # @param key [::Google::Cloud::RecaptchaEnterprise::V1::Key, ::Hash]
535
543
  # Required. The key to update.
536
544
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
537
- # Optional. The mask to control which field of the key get updated. If the mask is not
545
+ # Optional. The mask to control which fields of the key get updated. If the mask is not
538
546
  # present, all fields will be updated.
539
547
  #
540
548
  # @yield [response, operation] Access the result along with the RPC operation
@@ -571,7 +579,9 @@ module Google
571
579
  options.apply_defaults timeout: @config.rpcs.update_key.timeout,
572
580
  metadata: metadata,
573
581
  retry_policy: @config.rpcs.update_key.retry_policy
574
- options.apply_defaults metadata: @config.metadata,
582
+
583
+ options.apply_defaults timeout: @config.timeout,
584
+ metadata: @config.metadata,
575
585
  retry_policy: @config.retry_policy
576
586
 
577
587
  @recaptcha_enterprise_service_stub.call_rpc :update_key, request, options: options do |response, operation|
@@ -638,7 +648,9 @@ module Google
638
648
  options.apply_defaults timeout: @config.rpcs.delete_key.timeout,
639
649
  metadata: metadata,
640
650
  retry_policy: @config.rpcs.delete_key.retry_policy
641
- options.apply_defaults metadata: @config.metadata,
651
+
652
+ options.apply_defaults timeout: @config.timeout,
653
+ metadata: @config.metadata,
642
654
  retry_policy: @config.retry_policy
643
655
 
644
656
  @recaptcha_enterprise_service_stub.call_rpc :delete_key, request, options: options do |response, operation|
@@ -649,6 +661,150 @@ module Google
649
661
  raise ::Google::Cloud::Error.from_error(e)
650
662
  end
651
663
 
664
+ ##
665
+ # Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise.
666
+ # Once a key is migrated, it can be used from either product. SiteVerify
667
+ # requests are billed as CreateAssessment calls. You must be
668
+ # authenticated as one of the current owners of the reCAPTCHA Site Key, and
669
+ # your user must have the reCAPTCHA Enterprise Admin IAM role in the
670
+ # destination project.
671
+ #
672
+ # @overload migrate_key(request, options = nil)
673
+ # Pass arguments to `migrate_key` via a request object, either of type
674
+ # {::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest} or an equivalent Hash.
675
+ #
676
+ # @param request [::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest, ::Hash]
677
+ # A request object representing the call parameters. Required. To specify no
678
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
679
+ # @param options [::Gapic::CallOptions, ::Hash]
680
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
681
+ #
682
+ # @overload migrate_key(name: nil)
683
+ # Pass arguments to `migrate_key` via keyword arguments. Note that at
684
+ # least one keyword argument is required. To specify no parameters, or to keep all
685
+ # the default parameter values, pass an empty Hash as a request object (see above).
686
+ #
687
+ # @param name [::String]
688
+ # Required. The name of the key to be migrated, in the format
689
+ # "projects/\\{project}/keys/\\{key}".
690
+ #
691
+ # @yield [response, operation] Access the result along with the RPC operation
692
+ # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::Key]
693
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
694
+ #
695
+ # @return [::Google::Cloud::RecaptchaEnterprise::V1::Key]
696
+ #
697
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
698
+ #
699
+ def migrate_key request, options = nil
700
+ raise ::ArgumentError, "request must be provided" if request.nil?
701
+
702
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest
703
+
704
+ # Converts hash and nil to an options object
705
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
706
+
707
+ # Customize the options with defaults
708
+ metadata = @config.rpcs.migrate_key.metadata.to_h
709
+
710
+ # Set x-goog-api-client and x-goog-user-project headers
711
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
712
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
713
+ gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
714
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
715
+
716
+ header_params = {
717
+ "name" => request.name
718
+ }
719
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
720
+ metadata[:"x-goog-request-params"] ||= request_params_header
721
+
722
+ options.apply_defaults timeout: @config.rpcs.migrate_key.timeout,
723
+ metadata: metadata,
724
+ retry_policy: @config.rpcs.migrate_key.retry_policy
725
+
726
+ options.apply_defaults timeout: @config.timeout,
727
+ metadata: @config.metadata,
728
+ retry_policy: @config.retry_policy
729
+
730
+ @recaptcha_enterprise_service_stub.call_rpc :migrate_key, request, options: options do |response, operation|
731
+ yield response, operation if block_given?
732
+ return response
733
+ end
734
+ rescue ::GRPC::BadStatus => e
735
+ raise ::Google::Cloud::Error.from_error(e)
736
+ end
737
+
738
+ ##
739
+ # Get some aggregated metrics for a Key. This data can be used to build
740
+ # dashboards.
741
+ #
742
+ # @overload get_metrics(request, options = nil)
743
+ # Pass arguments to `get_metrics` via a request object, either of type
744
+ # {::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest} or an equivalent Hash.
745
+ #
746
+ # @param request [::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest, ::Hash]
747
+ # A request object representing the call parameters. Required. To specify no
748
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
749
+ # @param options [::Gapic::CallOptions, ::Hash]
750
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
751
+ #
752
+ # @overload get_metrics(name: nil)
753
+ # Pass arguments to `get_metrics` via keyword arguments. Note that at
754
+ # least one keyword argument is required. To specify no parameters, or to keep all
755
+ # the default parameter values, pass an empty Hash as a request object (see above).
756
+ #
757
+ # @param name [::String]
758
+ # Required. The name of the requested metrics, in the format
759
+ # "projects/\\{project}/keys/\\{key}/metrics".
760
+ #
761
+ # @yield [response, operation] Access the result along with the RPC operation
762
+ # @yieldparam response [::Google::Cloud::RecaptchaEnterprise::V1::Metrics]
763
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
764
+ #
765
+ # @return [::Google::Cloud::RecaptchaEnterprise::V1::Metrics]
766
+ #
767
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
768
+ #
769
+ def get_metrics request, options = nil
770
+ raise ::ArgumentError, "request must be provided" if request.nil?
771
+
772
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest
773
+
774
+ # Converts hash and nil to an options object
775
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
776
+
777
+ # Customize the options with defaults
778
+ metadata = @config.rpcs.get_metrics.metadata.to_h
779
+
780
+ # Set x-goog-api-client and x-goog-user-project headers
781
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
782
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
783
+ gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1::VERSION
784
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
785
+
786
+ header_params = {
787
+ "name" => request.name
788
+ }
789
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
790
+ metadata[:"x-goog-request-params"] ||= request_params_header
791
+
792
+ options.apply_defaults timeout: @config.rpcs.get_metrics.timeout,
793
+ metadata: metadata,
794
+ retry_policy: @config.rpcs.get_metrics.retry_policy
795
+
796
+ options.apply_defaults timeout: @config.timeout,
797
+ metadata: @config.metadata,
798
+ retry_policy: @config.retry_policy
799
+
800
+ @recaptcha_enterprise_service_stub.call_rpc :get_metrics, request, options: options do |response, operation|
801
+ yield response, operation if block_given?
802
+ return response
803
+ end
804
+ rescue ::GRPC::BadStatus => e
805
+ raise ::Google::Cloud::Error.from_error(e)
806
+ end
807
+
652
808
  ##
653
809
  # Configuration class for the RecaptchaEnterpriseService API.
654
810
  #
@@ -662,22 +818,21 @@ module Google
662
818
  # Configuration can be applied globally to all clients, or to a single client
663
819
  # on construction.
664
820
  #
665
- # # Examples
666
- #
667
- # To modify the global config, setting the timeout for create_assessment
668
- # to 20 seconds, and all remaining timeouts to 10 seconds:
821
+ # @example
669
822
  #
670
- # ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.configure do |config|
671
- # config.timeout = 10.0
672
- # config.rpcs.create_assessment.timeout = 20.0
673
- # end
823
+ # # Modify the global config, setting the timeout for
824
+ # # create_assessment to 20 seconds,
825
+ # # and all remaining timeouts to 10 seconds.
826
+ # ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.configure do |config|
827
+ # config.timeout = 10.0
828
+ # config.rpcs.create_assessment.timeout = 20.0
829
+ # end
674
830
  #
675
- # To apply the above configuration only to a new client:
676
- #
677
- # client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config|
678
- # config.timeout = 10.0
679
- # config.rpcs.create_assessment.timeout = 20.0
680
- # end
831
+ # # Apply the above configuration only to a new client.
832
+ # client = ::Google::Cloud::RecaptchaEnterprise::V1::RecaptchaEnterpriseService::Client.new do |config|
833
+ # config.timeout = 10.0
834
+ # config.rpcs.create_assessment.timeout = 20.0
835
+ # end
681
836
  #
682
837
  # @!attribute [rw] endpoint
683
838
  # The hostname or hostname:port of the service endpoint.
@@ -820,6 +975,16 @@ module Google
820
975
  # @return [::Gapic::Config::Method]
821
976
  #
822
977
  attr_reader :delete_key
978
+ ##
979
+ # RPC-specific configuration for `migrate_key`
980
+ # @return [::Gapic::Config::Method]
981
+ #
982
+ attr_reader :migrate_key
983
+ ##
984
+ # RPC-specific configuration for `get_metrics`
985
+ # @return [::Gapic::Config::Method]
986
+ #
987
+ attr_reader :get_metrics
823
988
 
824
989
  # @private
825
990
  def initialize parent_rpcs = nil
@@ -837,6 +1002,10 @@ module Google
837
1002
  @update_key = ::Gapic::Config::Method.new update_key_config
838
1003
  delete_key_config = parent_rpcs.delete_key if parent_rpcs.respond_to? :delete_key
839
1004
  @delete_key = ::Gapic::Config::Method.new delete_key_config
1005
+ migrate_key_config = parent_rpcs.migrate_key if parent_rpcs.respond_to? :migrate_key
1006
+ @migrate_key = ::Gapic::Config::Method.new migrate_key_config
1007
+ get_metrics_config = parent_rpcs.get_metrics if parent_rpcs.respond_to? :get_metrics
1008
+ @get_metrics = ::Gapic::Config::Method.new get_metrics_config
840
1009
 
841
1010
  yield self if block_given?
842
1011
  end
@@ -58,6 +58,23 @@ module Google
58
58
  "projects/#{project}/keys/#{key}"
59
59
  end
60
60
 
61
+ ##
62
+ # Create a fully-qualified Metrics resource string.
63
+ #
64
+ # The resource will be in the following format:
65
+ #
66
+ # `projects/{project}/keys/{key}/metrics`
67
+ #
68
+ # @param project [String]
69
+ # @param key [String]
70
+ #
71
+ # @return [::String]
72
+ def metrics_path project:, key:
73
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
74
+
75
+ "projects/#{project}/keys/#{key}/metrics"
76
+ end
77
+
61
78
  ##
62
79
  # Create a fully-qualified Project resource string.
63
80
  #
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module RecaptchaEnterprise
23
23
  module V1
24
- VERSION = "0.4.0"
24
+ VERSION = "0.5.0"
25
25
  end
26
26
  end
27
27
  end
@@ -19,6 +19,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
19
19
  add_message "google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest" do
20
20
  optional :name, :string, 1
21
21
  optional :annotation, :enum, 2, "google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation"
22
+ repeated :reasons, :enum, 3, "google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason"
22
23
  end
23
24
  add_enum "google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation" do
24
25
  value :ANNOTATION_UNSPECIFIED, 0
@@ -27,6 +28,16 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
27
28
  value :PASSWORD_CORRECT, 3
28
29
  value :PASSWORD_INCORRECT, 4
29
30
  end
31
+ add_enum "google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason" do
32
+ value :REASON_UNSPECIFIED, 0
33
+ value :CHARGEBACK, 1
34
+ value :PAYMENT_HEURISTICS, 2
35
+ value :INITIATED_TWO_FACTOR, 7
36
+ value :PASSED_TWO_FACTOR, 3
37
+ value :FAILED_TWO_FACTOR, 4
38
+ value :CORRECT_PASSWORD, 5
39
+ value :INCORRECT_PASSWORD, 6
40
+ end
30
41
  add_message "google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse" do
31
42
  end
32
43
  add_message "google.cloud.recaptchaenterprise.v1.Assessment" do
@@ -68,6 +79,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
68
79
  value :EXPIRED, 3
69
80
  value :DUPE, 4
70
81
  value :MISSING, 5
82
+ value :BROWSER_ERROR, 6
71
83
  end
72
84
  add_message "google.cloud.recaptchaenterprise.v1.CreateKeyRequest" do
73
85
  optional :parent, :string, 1
@@ -92,17 +104,39 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
92
104
  add_message "google.cloud.recaptchaenterprise.v1.DeleteKeyRequest" do
93
105
  optional :name, :string, 1
94
106
  end
107
+ add_message "google.cloud.recaptchaenterprise.v1.MigrateKeyRequest" do
108
+ optional :name, :string, 1
109
+ end
110
+ add_message "google.cloud.recaptchaenterprise.v1.GetMetricsRequest" do
111
+ optional :name, :string, 1
112
+ end
113
+ add_message "google.cloud.recaptchaenterprise.v1.Metrics" do
114
+ optional :name, :string, 4
115
+ optional :start_time, :message, 1, "google.protobuf.Timestamp"
116
+ repeated :score_metrics, :message, 2, "google.cloud.recaptchaenterprise.v1.ScoreMetrics"
117
+ repeated :challenge_metrics, :message, 3, "google.cloud.recaptchaenterprise.v1.ChallengeMetrics"
118
+ end
95
119
  add_message "google.cloud.recaptchaenterprise.v1.Key" do
96
120
  optional :name, :string, 1
97
121
  optional :display_name, :string, 2
98
122
  map :labels, :string, :string, 6
99
123
  optional :create_time, :message, 7, "google.protobuf.Timestamp"
124
+ optional :testing_options, :message, 9, "google.cloud.recaptchaenterprise.v1.TestingOptions"
100
125
  oneof :platform_settings do
101
126
  optional :web_settings, :message, 3, "google.cloud.recaptchaenterprise.v1.WebKeySettings"
102
127
  optional :android_settings, :message, 4, "google.cloud.recaptchaenterprise.v1.AndroidKeySettings"
103
128
  optional :ios_settings, :message, 5, "google.cloud.recaptchaenterprise.v1.IOSKeySettings"
104
129
  end
105
130
  end
131
+ add_message "google.cloud.recaptchaenterprise.v1.TestingOptions" do
132
+ optional :testing_score, :float, 1
133
+ optional :testing_challenge, :enum, 2, "google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge"
134
+ end
135
+ add_enum "google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge" do
136
+ value :TESTING_CHALLENGE_UNSPECIFIED, 0
137
+ value :NOCAPTCHA, 1
138
+ value :UNSOLVABLE_CHALLENGE, 2
139
+ end
106
140
  add_message "google.cloud.recaptchaenterprise.v1.WebKeySettings" do
107
141
  optional :allow_all_domains, :bool, 3
108
142
  repeated :allowed_domains, :string, 1
@@ -123,11 +157,26 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
123
157
  value :SECURITY, 3
124
158
  end
125
159
  add_message "google.cloud.recaptchaenterprise.v1.AndroidKeySettings" do
160
+ optional :allow_all_package_names, :bool, 2
126
161
  repeated :allowed_package_names, :string, 1
127
162
  end
128
163
  add_message "google.cloud.recaptchaenterprise.v1.IOSKeySettings" do
164
+ optional :allow_all_bundle_ids, :bool, 2
129
165
  repeated :allowed_bundle_ids, :string, 1
130
166
  end
167
+ add_message "google.cloud.recaptchaenterprise.v1.ScoreDistribution" do
168
+ map :score_buckets, :int32, :int64, 1
169
+ end
170
+ add_message "google.cloud.recaptchaenterprise.v1.ScoreMetrics" do
171
+ optional :overall_metrics, :message, 1, "google.cloud.recaptchaenterprise.v1.ScoreDistribution"
172
+ map :action_metrics, :string, :message, 2, "google.cloud.recaptchaenterprise.v1.ScoreDistribution"
173
+ end
174
+ add_message "google.cloud.recaptchaenterprise.v1.ChallengeMetrics" do
175
+ optional :pageload_count, :int64, 1
176
+ optional :nocaptcha_count, :int64, 2
177
+ optional :failed_count, :int64, 3
178
+ optional :passed_count, :int64, 4
179
+ end
131
180
  end
132
181
  end
133
182
 
@@ -138,6 +187,7 @@ module Google
138
187
  CreateAssessmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.CreateAssessmentRequest").msgclass
139
188
  AnnotateAssessmentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest").msgclass
140
189
  AnnotateAssessmentRequest::Annotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Annotation").enummodule
190
+ AnnotateAssessmentRequest::Reason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AnnotateAssessmentRequest.Reason").enummodule
141
191
  AnnotateAssessmentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AnnotateAssessmentResponse").msgclass
142
192
  Assessment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Assessment").msgclass
143
193
  Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Event").msgclass
@@ -151,12 +201,20 @@ module Google
151
201
  GetKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.GetKeyRequest").msgclass
152
202
  UpdateKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.UpdateKeyRequest").msgclass
153
203
  DeleteKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.DeleteKeyRequest").msgclass
204
+ MigrateKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.MigrateKeyRequest").msgclass
205
+ GetMetricsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.GetMetricsRequest").msgclass
206
+ Metrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Metrics").msgclass
154
207
  Key = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.Key").msgclass
208
+ TestingOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TestingOptions").msgclass
209
+ TestingOptions::TestingChallenge = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.TestingOptions.TestingChallenge").enummodule
155
210
  WebKeySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WebKeySettings").msgclass
156
211
  WebKeySettings::IntegrationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WebKeySettings.IntegrationType").enummodule
157
212
  WebKeySettings::ChallengeSecurityPreference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.WebKeySettings.ChallengeSecurityPreference").enummodule
158
213
  AndroidKeySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.AndroidKeySettings").msgclass
159
214
  IOSKeySettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.IOSKeySettings").msgclass
215
+ ScoreDistribution = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ScoreDistribution").msgclass
216
+ ScoreMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ScoreMetrics").msgclass
217
+ ChallengeMetrics = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.recaptchaenterprise.v1.ChallengeMetrics").msgclass
160
218
  end
161
219
  end
162
220
  end
@@ -36,7 +36,7 @@ module Google
36
36
  # Creates an Assessment of the likelihood an event is legitimate.
37
37
  rpc :CreateAssessment, ::Google::Cloud::RecaptchaEnterprise::V1::CreateAssessmentRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Assessment
38
38
  # Annotates a previously created Assessment to provide additional information
39
- # on whether the event turned out to be authentic or fradulent.
39
+ # on whether the event turned out to be authentic or fraudulent.
40
40
  rpc :AnnotateAssessment, ::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest, ::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentResponse
41
41
  # Creates a new reCAPTCHA Enterprise key.
42
42
  rpc :CreateKey, ::Google::Cloud::RecaptchaEnterprise::V1::CreateKeyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Key
@@ -48,6 +48,16 @@ module Google
48
48
  rpc :UpdateKey, ::Google::Cloud::RecaptchaEnterprise::V1::UpdateKeyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Key
49
49
  # Deletes the specified key.
50
50
  rpc :DeleteKey, ::Google::Cloud::RecaptchaEnterprise::V1::DeleteKeyRequest, ::Google::Protobuf::Empty
51
+ # Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise.
52
+ # Once a key is migrated, it can be used from either product. SiteVerify
53
+ # requests are billed as CreateAssessment calls. You must be
54
+ # authenticated as one of the current owners of the reCAPTCHA Site Key, and
55
+ # your user must have the reCAPTCHA Enterprise Admin IAM role in the
56
+ # destination project.
57
+ rpc :MigrateKey, ::Google::Cloud::RecaptchaEnterprise::V1::MigrateKeyRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Key
58
+ # Get some aggregated metrics for a Key. This data can be used to build
59
+ # dashboards.
60
+ rpc :GetMetrics, ::Google::Cloud::RecaptchaEnterprise::V1::GetMetricsRequest, ::Google::Cloud::RecaptchaEnterprise::V1::Metrics
51
61
  end
52
62
 
53
63
  Stub = Service.rpc_stub_class
@@ -57,9 +57,15 @@ module Google
57
57
 
58
58
  # Denotes that a (repeated) field is an unordered list.
59
59
  # This indicates that the service may provide the elements of the list
60
- # in any arbitrary order, rather than the order the user originally
60
+ # in any arbitrary order, rather than the order the user originally
61
61
  # provided. Additionally, the list's order may or may not be stable.
62
62
  UNORDERED_LIST = 6
63
+
64
+ # Denotes that this field returns a non-empty default value if not set.
65
+ # This indicates that if the user provides the empty value in a request,
66
+ # a non-empty value will be returned. The user will not be aware of what
67
+ # non-empty value to expect.
68
+ NON_EMPTY_DEFAULT = 7
63
69
  end
64
70
  end
65
71
  end
@@ -41,12 +41,17 @@ module Google
41
41
  # "projects/\\{project}/assessments/\\{assessment}".
42
42
  # @!attribute [rw] annotation
43
43
  # @return [::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest::Annotation]
44
- # Required. The annotation that will be assigned to the Event.
44
+ # Optional. The annotation that will be assigned to the Event. This field can be left
45
+ # empty to provide reasons that apply to an event without concluding whether
46
+ # the event is legitimate or fraudulent.
47
+ # @!attribute [rw] reasons
48
+ # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::AnnotateAssessmentRequest::Reason>]
49
+ # Optional. Optional reasons for the annotation that will be assigned to the Event.
45
50
  class AnnotateAssessmentRequest
46
51
  include ::Google::Protobuf::MessageExts
47
52
  extend ::Google::Protobuf::MessageExts::ClassMethods
48
53
 
49
- # Enum that reprensents the types of annotations.
54
+ # Enum that represents the types of annotations.
50
55
  module Annotation
51
56
  # Default unspecified type.
52
57
  ANNOTATION_UNSPECIFIED = 0
@@ -58,13 +63,48 @@ module Google
58
63
  FRAUDULENT = 2
59
64
 
60
65
  # Provides information that the event was related to a login event in which
61
- # the user typed the correct password.
66
+ # the user typed the correct password. Deprecated, prefer indicating
67
+ # CORRECT_PASSWORD through the reasons field instead.
62
68
  PASSWORD_CORRECT = 3
63
69
 
64
70
  # Provides information that the event was related to a login event in which
65
- # the user typed the incorrect password.
71
+ # the user typed the incorrect password. Deprecated, prefer indicating
72
+ # INCORRECT_PASSWORD through the reasons field instead.
66
73
  PASSWORD_INCORRECT = 4
67
74
  end
75
+
76
+ # Enum that represents potential reasons for annotating an assessment.
77
+ module Reason
78
+ # Default unspecified reason.
79
+ REASON_UNSPECIFIED = 0
80
+
81
+ # Indicates a chargeback for fraud was issued for the transaction
82
+ # associated with the assessment.
83
+ CHARGEBACK = 1
84
+
85
+ # Indicates the transaction associated with the assessment is suspected of
86
+ # being fraudulent based on the payment method, billing details, shipping
87
+ # address or other transaction information.
88
+ PAYMENT_HEURISTICS = 2
89
+
90
+ # Indicates that the user was served a 2FA challenge. An old assessment
91
+ # with `ENUM_VALUES.INITIATED_TWO_FACTOR` reason that has not been
92
+ # overwritten with `PASSED_TWO_FACTOR` is treated as an abandoned 2FA flow.
93
+ # This is equivalent to `FAILED_TWO_FACTOR`.
94
+ INITIATED_TWO_FACTOR = 7
95
+
96
+ # Indicates that the user passed a 2FA challenge.
97
+ PASSED_TWO_FACTOR = 3
98
+
99
+ # Indicates that the user failed a 2FA challenge.
100
+ FAILED_TWO_FACTOR = 4
101
+
102
+ # Indicates the user provided the correct password.
103
+ CORRECT_PASSWORD = 5
104
+
105
+ # Indicates the user provided an incorrect password.
106
+ INCORRECT_PASSWORD = 6
107
+ end
68
108
  end
69
109
 
70
110
  # Empty response for AnnotateAssessment.
@@ -130,7 +170,6 @@ module Google
130
170
  include ::Google::Protobuf::MessageExts
131
171
  extend ::Google::Protobuf::MessageExts::ClassMethods
132
172
 
133
- # LINT.IfChange(classification_reason)
134
173
  # Reasons contributing to the risk analysis verdict.
135
174
  module ClassificationReason
136
175
  # Default unspecified type.
@@ -178,7 +217,6 @@ module Google
178
217
  include ::Google::Protobuf::MessageExts
179
218
  extend ::Google::Protobuf::MessageExts::ClassMethods
180
219
 
181
- # LINT.IfChange
182
220
  # Enum that represents the types of invalid token reasons.
183
221
  module InvalidReason
184
222
  # Default unspecified type.
@@ -198,6 +236,10 @@ module Google
198
236
 
199
237
  # The user verification token was not present.
200
238
  MISSING = 5
239
+
240
+ # A retriable error (such as network failure) occurred on the browser.
241
+ # Could easily be simulated by an attacker.
242
+ BROWSER_ERROR = 6
201
243
  end
202
244
  end
203
245
 
@@ -261,7 +303,7 @@ module Google
261
303
  # Required. The key to update.
262
304
  # @!attribute [rw] update_mask
263
305
  # @return [::Google::Protobuf::FieldMask]
264
- # Optional. The mask to control which field of the key get updated. If the mask is not
306
+ # Optional. The mask to control which fields of the key get updated. If the mask is not
265
307
  # present, all fields will be updated.
266
308
  class UpdateKeyRequest
267
309
  include ::Google::Protobuf::MessageExts
@@ -278,6 +320,48 @@ module Google
278
320
  extend ::Google::Protobuf::MessageExts::ClassMethods
279
321
  end
280
322
 
323
+ # The migrate key request message.
324
+ # @!attribute [rw] name
325
+ # @return [::String]
326
+ # Required. The name of the key to be migrated, in the format
327
+ # "projects/\\{project}/keys/\\{key}".
328
+ class MigrateKeyRequest
329
+ include ::Google::Protobuf::MessageExts
330
+ extend ::Google::Protobuf::MessageExts::ClassMethods
331
+ end
332
+
333
+ # The get metrics request message.
334
+ # @!attribute [rw] name
335
+ # @return [::String]
336
+ # Required. The name of the requested metrics, in the format
337
+ # "projects/\\{project}/keys/\\{key}/metrics".
338
+ class GetMetricsRequest
339
+ include ::Google::Protobuf::MessageExts
340
+ extend ::Google::Protobuf::MessageExts::ClassMethods
341
+ end
342
+
343
+ # Metrics for a single Key.
344
+ # @!attribute [r] name
345
+ # @return [::String]
346
+ # Output only. The name of the metrics, in the format
347
+ # "projects/\\{project}/keys/\\{key}/metrics".
348
+ # @!attribute [rw] start_time
349
+ # @return [::Google::Protobuf::Timestamp]
350
+ # Inclusive start time aligned to a day (UTC).
351
+ # @!attribute [rw] score_metrics
352
+ # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::ScoreMetrics>]
353
+ # Metrics will be continuous and in order by dates, and in the granularity
354
+ # of day. All Key types should have score-based data.
355
+ # @!attribute [rw] challenge_metrics
356
+ # @return [::Array<::Google::Cloud::RecaptchaEnterprise::V1::ChallengeMetrics>]
357
+ # Metrics will be continuous and in order by dates, and in the granularity
358
+ # of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have
359
+ # challenge-based data.
360
+ class Metrics
361
+ include ::Google::Protobuf::MessageExts
362
+ extend ::Google::Protobuf::MessageExts::ClassMethods
363
+ end
364
+
281
365
  # A key used to identify and configure applications (web and/or mobile) that
282
366
  # use reCAPTCHA Enterprise.
283
367
  # @!attribute [rw] name
@@ -298,11 +382,14 @@ module Google
298
382
  # Settings for keys that can be used by iOS apps.
299
383
  # @!attribute [rw] labels
300
384
  # @return [::Google::Protobuf::Map{::String => ::String}]
301
- # Optional. See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
385
+ # See <a href="https://cloud.google.com/recaptcha-enterprise/docs/labels">
302
386
  # Creating and managing labels</a>.
303
387
  # @!attribute [rw] create_time
304
388
  # @return [::Google::Protobuf::Timestamp]
305
389
  # The timestamp corresponding to the creation of this Key.
390
+ # @!attribute [rw] testing_options
391
+ # @return [::Google::Cloud::RecaptchaEnterprise::V1::TestingOptions]
392
+ # Options for user acceptance testing.
306
393
  class Key
307
394
  include ::Google::Protobuf::MessageExts
308
395
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -317,6 +404,37 @@ module Google
317
404
  end
318
405
  end
319
406
 
407
+ # Options for user acceptance testing.
408
+ # @!attribute [rw] testing_score
409
+ # @return [::Float]
410
+ # All assessments for this Key will return this score. Must be between 0
411
+ # (likely not legitimate) and 1 (likely legitimate) inclusive.
412
+ # @!attribute [rw] testing_challenge
413
+ # @return [::Google::Cloud::RecaptchaEnterprise::V1::TestingOptions::TestingChallenge]
414
+ # For challenge-based keys only (CHECKBOX, INVISIBLE), all challenge requests
415
+ # for this site will return nocaptcha if NOCAPTCHA, or an unsolvable
416
+ # challenge if CHALLENGE.
417
+ class TestingOptions
418
+ include ::Google::Protobuf::MessageExts
419
+ extend ::Google::Protobuf::MessageExts::ClassMethods
420
+
421
+ # Enum that represents the challenge option for challenge-based (CHECKBOX,
422
+ # INVISIBLE) testing keys.
423
+ module TestingChallenge
424
+ # Perform the normal risk analysis and return either nocaptcha or a
425
+ # challenge depending on risk and trust factors.
426
+ TESTING_CHALLENGE_UNSPECIFIED = 0
427
+
428
+ # Challenge requests for this key will always return a nocaptcha, which
429
+ # does not require a solution.
430
+ NOCAPTCHA = 1
431
+
432
+ # Challenge requests for this key will always return an unsolvable
433
+ # challenge.
434
+ UNSOLVABLE_CHALLENGE = 2
435
+ end
436
+ end
437
+
320
438
  # Settings specific to keys that can be used by websites.
321
439
  # @!attribute [rw] allow_all_domains
322
440
  # @return [::Boolean]
@@ -330,6 +448,7 @@ module Google
330
448
  # @!attribute [rw] allow_amp_traffic
331
449
  # @return [::Boolean]
332
450
  # Required. Whether this key can be used on AMP (Accelerated Mobile Pages) websites.
451
+ # This can only be set for the SCORE integration type.
333
452
  # @!attribute [rw] integration_type
334
453
  # @return [::Google::Cloud::RecaptchaEnterprise::V1::WebKeySettings::IntegrationType]
335
454
  # Required. Describes how this key is integrated with the website.
@@ -380,6 +499,9 @@ module Google
380
499
  end
381
500
 
382
501
  # Settings specific to keys that can be used by Android apps.
502
+ # @!attribute [rw] allow_all_package_names
503
+ # @return [::Boolean]
504
+ # If set to true, it means allowed_package_names will not be enforced.
383
505
  # @!attribute [rw] allowed_package_names
384
506
  # @return [::Array<::String>]
385
507
  # Android package names of apps allowed to use the key.
@@ -390,6 +512,9 @@ module Google
390
512
  end
391
513
 
392
514
  # Settings specific to keys that can be used by iOS apps.
515
+ # @!attribute [rw] allow_all_bundle_ids
516
+ # @return [::Boolean]
517
+ # If set to true, it means allowed_bundle_ids will not be enforced.
393
518
  # @!attribute [rw] allowed_bundle_ids
394
519
  # @return [::Array<::String>]
395
520
  # iOS bundle ids of apps allowed to use the key.
@@ -398,6 +523,71 @@ module Google
398
523
  include ::Google::Protobuf::MessageExts
399
524
  extend ::Google::Protobuf::MessageExts::ClassMethods
400
525
  end
526
+
527
+ # Score distribution.
528
+ # @!attribute [rw] score_buckets
529
+ # @return [::Google::Protobuf::Map{::Integer => ::Integer}]
530
+ # Map key is score value multiplied by 100. The scores are discrete values
531
+ # between [0, 1]. The maximum number of buckets is on order of a few dozen,
532
+ # but typically much lower (ie. 10).
533
+ class ScoreDistribution
534
+ include ::Google::Protobuf::MessageExts
535
+ extend ::Google::Protobuf::MessageExts::ClassMethods
536
+
537
+ # @!attribute [rw] key
538
+ # @return [::Integer]
539
+ # @!attribute [rw] value
540
+ # @return [::Integer]
541
+ class ScoreBucketsEntry
542
+ include ::Google::Protobuf::MessageExts
543
+ extend ::Google::Protobuf::MessageExts::ClassMethods
544
+ end
545
+ end
546
+
547
+ # Metrics related to scoring.
548
+ # @!attribute [rw] overall_metrics
549
+ # @return [::Google::Cloud::RecaptchaEnterprise::V1::ScoreDistribution]
550
+ # Aggregated score metrics for all traffic.
551
+ # @!attribute [rw] action_metrics
552
+ # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::RecaptchaEnterprise::V1::ScoreDistribution}]
553
+ # Action-based metrics. The map key is the action name which specified by the
554
+ # site owners at time of the "execute" client-side call.
555
+ # Populated only for SCORE keys.
556
+ class ScoreMetrics
557
+ include ::Google::Protobuf::MessageExts
558
+ extend ::Google::Protobuf::MessageExts::ClassMethods
559
+
560
+ # @!attribute [rw] key
561
+ # @return [::String]
562
+ # @!attribute [rw] value
563
+ # @return [::Google::Cloud::RecaptchaEnterprise::V1::ScoreDistribution]
564
+ class ActionMetricsEntry
565
+ include ::Google::Protobuf::MessageExts
566
+ extend ::Google::Protobuf::MessageExts::ClassMethods
567
+ end
568
+ end
569
+
570
+ # Metrics related to challenges.
571
+ # @!attribute [rw] pageload_count
572
+ # @return [::Integer]
573
+ # Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent
574
+ # to a count of pageloads for pages that include reCAPTCHA.
575
+ # @!attribute [rw] nocaptcha_count
576
+ # @return [::Integer]
577
+ # Count of nocaptchas (successful verification without a challenge) issued.
578
+ # @!attribute [rw] failed_count
579
+ # @return [::Integer]
580
+ # Count of submitted challenge solutions that were incorrect or otherwise
581
+ # deemed suspicious such that a subsequent challenge was triggered.
582
+ # @!attribute [rw] passed_count
583
+ # @return [::Integer]
584
+ # Count of nocaptchas (successful verification without a challenge) plus
585
+ # submitted challenge solutions that were correct and resulted in
586
+ # verification.
587
+ class ChallengeMetrics
588
+ include ::Google::Protobuf::MessageExts
589
+ extend ::Google::Protobuf::MessageExts::ClassMethods
590
+ end
401
591
  end
402
592
  end
403
593
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-recaptcha_enterprise-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-09 00:00:00.000000000 Z
11
+ date: 2021-09-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0.7'
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: '0.3'
22
+ version: 2.a
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '0.7'
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '0.3'
32
+ version: 2.a
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: google-cloud-errors
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -198,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
198
204
  - !ruby/object:Gem::Version
199
205
  version: '0'
200
206
  requirements: []
201
- rubygems_version: 3.2.13
207
+ rubygems_version: 3.2.17
202
208
  signing_key:
203
209
  specification_version: 4
204
210
  summary: API Client library for the reCAPTCHA Enterprise V1 API