google-cloud-recaptcha_enterprise-v1beta1 0.4.1 → 0.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/AUTHENTICATION.md +15 -33
- data/README.md +1 -1
- data/lib/google/cloud/recaptcha_enterprise/v1beta1/recaptcha_enterprise_service/client.rb +197 -65
- data/lib/google/cloud/recaptcha_enterprise/v1beta1/version.rb +1 -1
- data/lib/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise_pb.rb +2 -2
- data/proto_docs/google/api/field_behavior.rb +7 -1
- data/proto_docs/google/api/resource.rb +10 -71
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6575f12649703f75c691fcd8834cd9623a02714a015c7923bb8c916b9a8c9602
|
4
|
+
data.tar.gz: 2e6aacdeecc7899b692c4523775cbd1e470b0fe4a9cce2dde06492d48aaa2d3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94110565d43cbae20197768eb7c1d22dae970d82237e8d22f9e10b73b2933fad6c5197c74ad1c5ff4d41003dce107f257385ae155029e9d97f5b07b929d9e8f6
|
7
|
+
data.tar.gz: bf73b6828491e85c1a07000851e27c497a1719a8d96e9cab7f35b94ab72c591951b353021b24f59b4dcac7a4a182974dd8d8b2e42eb282be522a73df872def5c
|
data/.yardopts
CHANGED
data/AUTHENTICATION.md
CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-recaptcha_enterprise-v1beta1
|
|
66
66
|
checks for credentials are configured on the service Credentials class (such as
|
67
67
|
{::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Credentials}):
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
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/v1beta1"
|
@@ -82,8 +82,8 @@ client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseServi
|
|
82
82
|
|
83
83
|
### Configuration
|
84
84
|
|
85
|
-
The **Credentials JSON** can be configured instead of
|
86
|
-
environment
|
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/v1beta1"
|
@@ -93,7 +93,7 @@ client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseServi
|
|
93
93
|
end
|
94
94
|
```
|
95
95
|
|
96
|
-
Or
|
96
|
+
Or globally for all clients:
|
97
97
|
|
98
98
|
```ruby
|
99
99
|
require "google/cloud/recaptcha_enterprise/v1beta1"
|
@@ -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
|
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
|
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
|
-
|
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,
|
164
|
-
|
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
@@ -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/v1beta1"
|
34
34
|
|
35
35
|
client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new
|
36
|
-
request =
|
36
|
+
request = ::Google::Cloud::RecaptchaEnterprise::V1beta1::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::V1beta1::RecaptchaEnterpriseService::Client::Configuration}
|
42
42
|
# for a description of the configuration fields.
|
43
43
|
#
|
44
|
-
#
|
44
|
+
# @example
|
45
45
|
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
# end
|
46
|
+
# # Modify the configuration for all RecaptchaEnterpriseService clients
|
47
|
+
# ::Google::Cloud::RecaptchaEnterprise::V1beta1::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
|
-
#
|
112
|
-
#
|
113
|
-
# To create a new RecaptchaEnterpriseService client with the default
|
114
|
-
# configuration:
|
110
|
+
# @example
|
115
111
|
#
|
116
|
-
#
|
112
|
+
# # Create a client using the default configuration
|
113
|
+
# client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new
|
117
114
|
#
|
118
|
-
#
|
119
|
-
#
|
120
|
-
#
|
121
|
-
#
|
122
|
-
# config.timeout = 10.0
|
123
|
-
# end
|
115
|
+
# # Create a client using a custom configuration
|
116
|
+
# client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::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
|
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.
|
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
|
@@ -196,6 +190,21 @@ module Google
|
|
196
190
|
#
|
197
191
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
198
192
|
#
|
193
|
+
# @example Basic example
|
194
|
+
# require "google/cloud/recaptcha_enterprise/v1beta1"
|
195
|
+
#
|
196
|
+
# # Create a client object. The client can be reused for multiple calls.
|
197
|
+
# client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new
|
198
|
+
#
|
199
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
200
|
+
# request = Google::Cloud::RecaptchaEnterprise::V1beta1::CreateAssessmentRequest.new
|
201
|
+
#
|
202
|
+
# # Call the create_assessment method.
|
203
|
+
# result = client.create_assessment request
|
204
|
+
#
|
205
|
+
# # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::Assessment.
|
206
|
+
# p result
|
207
|
+
#
|
199
208
|
def create_assessment request, options = nil
|
200
209
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
201
210
|
|
@@ -213,16 +222,20 @@ module Google
|
|
213
222
|
gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION
|
214
223
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
215
224
|
|
216
|
-
header_params = {
|
217
|
-
|
218
|
-
|
225
|
+
header_params = {}
|
226
|
+
if request.parent
|
227
|
+
header_params["parent"] = request.parent
|
228
|
+
end
|
229
|
+
|
219
230
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
220
231
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
221
232
|
|
222
233
|
options.apply_defaults timeout: @config.rpcs.create_assessment.timeout,
|
223
234
|
metadata: metadata,
|
224
235
|
retry_policy: @config.rpcs.create_assessment.retry_policy
|
225
|
-
|
236
|
+
|
237
|
+
options.apply_defaults timeout: @config.timeout,
|
238
|
+
metadata: @config.metadata,
|
226
239
|
retry_policy: @config.retry_policy
|
227
240
|
|
228
241
|
@recaptcha_enterprise_service_stub.call_rpc :create_assessment, request, options: options do |response, operation|
|
@@ -266,6 +279,21 @@ module Google
|
|
266
279
|
#
|
267
280
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
268
281
|
#
|
282
|
+
# @example Basic example
|
283
|
+
# require "google/cloud/recaptcha_enterprise/v1beta1"
|
284
|
+
#
|
285
|
+
# # Create a client object. The client can be reused for multiple calls.
|
286
|
+
# client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new
|
287
|
+
#
|
288
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
289
|
+
# request = Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentRequest.new
|
290
|
+
#
|
291
|
+
# # Call the annotate_assessment method.
|
292
|
+
# result = client.annotate_assessment request
|
293
|
+
#
|
294
|
+
# # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::AnnotateAssessmentResponse.
|
295
|
+
# p result
|
296
|
+
#
|
269
297
|
def annotate_assessment request, options = nil
|
270
298
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
271
299
|
|
@@ -283,16 +311,20 @@ module Google
|
|
283
311
|
gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION
|
284
312
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
285
313
|
|
286
|
-
header_params = {
|
287
|
-
|
288
|
-
|
314
|
+
header_params = {}
|
315
|
+
if request.name
|
316
|
+
header_params["name"] = request.name
|
317
|
+
end
|
318
|
+
|
289
319
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
290
320
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
291
321
|
|
292
322
|
options.apply_defaults timeout: @config.rpcs.annotate_assessment.timeout,
|
293
323
|
metadata: metadata,
|
294
324
|
retry_policy: @config.rpcs.annotate_assessment.retry_policy
|
295
|
-
|
325
|
+
|
326
|
+
options.apply_defaults timeout: @config.timeout,
|
327
|
+
metadata: @config.metadata,
|
296
328
|
retry_policy: @config.retry_policy
|
297
329
|
|
298
330
|
@recaptcha_enterprise_service_stub.call_rpc :annotate_assessment, request, options: options do |response, operation|
|
@@ -335,6 +367,21 @@ module Google
|
|
335
367
|
#
|
336
368
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
337
369
|
#
|
370
|
+
# @example Basic example
|
371
|
+
# require "google/cloud/recaptcha_enterprise/v1beta1"
|
372
|
+
#
|
373
|
+
# # Create a client object. The client can be reused for multiple calls.
|
374
|
+
# client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new
|
375
|
+
#
|
376
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
377
|
+
# request = Google::Cloud::RecaptchaEnterprise::V1beta1::CreateKeyRequest.new
|
378
|
+
#
|
379
|
+
# # Call the create_key method.
|
380
|
+
# result = client.create_key request
|
381
|
+
#
|
382
|
+
# # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::Key.
|
383
|
+
# p result
|
384
|
+
#
|
338
385
|
def create_key request, options = nil
|
339
386
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
340
387
|
|
@@ -352,16 +399,20 @@ module Google
|
|
352
399
|
gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION
|
353
400
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
354
401
|
|
355
|
-
header_params = {
|
356
|
-
|
357
|
-
|
402
|
+
header_params = {}
|
403
|
+
if request.parent
|
404
|
+
header_params["parent"] = request.parent
|
405
|
+
end
|
406
|
+
|
358
407
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
359
408
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
360
409
|
|
361
410
|
options.apply_defaults timeout: @config.rpcs.create_key.timeout,
|
362
411
|
metadata: metadata,
|
363
412
|
retry_policy: @config.rpcs.create_key.retry_policy
|
364
|
-
|
413
|
+
|
414
|
+
options.apply_defaults timeout: @config.timeout,
|
415
|
+
metadata: @config.metadata,
|
365
416
|
retry_policy: @config.retry_policy
|
366
417
|
|
367
418
|
@recaptcha_enterprise_service_stub.call_rpc :create_key, request, options: options do |response, operation|
|
@@ -408,6 +459,27 @@ module Google
|
|
408
459
|
#
|
409
460
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
410
461
|
#
|
462
|
+
# @example Basic example
|
463
|
+
# require "google/cloud/recaptcha_enterprise/v1beta1"
|
464
|
+
#
|
465
|
+
# # Create a client object. The client can be reused for multiple calls.
|
466
|
+
# client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new
|
467
|
+
#
|
468
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
469
|
+
# request = Google::Cloud::RecaptchaEnterprise::V1beta1::ListKeysRequest.new
|
470
|
+
#
|
471
|
+
# # Call the list_keys method.
|
472
|
+
# result = client.list_keys request
|
473
|
+
#
|
474
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
475
|
+
# # iterate over all elements by calling #each, and the enumerable
|
476
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
477
|
+
# # methods are also available for managing paging directly.
|
478
|
+
# result.each do |response|
|
479
|
+
# # Each element is of type ::Google::Cloud::RecaptchaEnterprise::V1beta1::Key.
|
480
|
+
# p response
|
481
|
+
# end
|
482
|
+
#
|
411
483
|
def list_keys request, options = nil
|
412
484
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
413
485
|
|
@@ -425,16 +497,20 @@ module Google
|
|
425
497
|
gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION
|
426
498
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
427
499
|
|
428
|
-
header_params = {
|
429
|
-
|
430
|
-
|
500
|
+
header_params = {}
|
501
|
+
if request.parent
|
502
|
+
header_params["parent"] = request.parent
|
503
|
+
end
|
504
|
+
|
431
505
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
432
506
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
433
507
|
|
434
508
|
options.apply_defaults timeout: @config.rpcs.list_keys.timeout,
|
435
509
|
metadata: metadata,
|
436
510
|
retry_policy: @config.rpcs.list_keys.retry_policy
|
437
|
-
|
511
|
+
|
512
|
+
options.apply_defaults timeout: @config.timeout,
|
513
|
+
metadata: @config.metadata,
|
438
514
|
retry_policy: @config.retry_policy
|
439
515
|
|
440
516
|
@recaptcha_enterprise_service_stub.call_rpc :list_keys, request, options: options do |response, operation|
|
@@ -476,6 +552,21 @@ module Google
|
|
476
552
|
#
|
477
553
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
478
554
|
#
|
555
|
+
# @example Basic example
|
556
|
+
# require "google/cloud/recaptcha_enterprise/v1beta1"
|
557
|
+
#
|
558
|
+
# # Create a client object. The client can be reused for multiple calls.
|
559
|
+
# client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new
|
560
|
+
#
|
561
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
562
|
+
# request = Google::Cloud::RecaptchaEnterprise::V1beta1::GetKeyRequest.new
|
563
|
+
#
|
564
|
+
# # Call the get_key method.
|
565
|
+
# result = client.get_key request
|
566
|
+
#
|
567
|
+
# # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::Key.
|
568
|
+
# p result
|
569
|
+
#
|
479
570
|
def get_key request, options = nil
|
480
571
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
481
572
|
|
@@ -493,16 +584,20 @@ module Google
|
|
493
584
|
gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION
|
494
585
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
495
586
|
|
496
|
-
header_params = {
|
497
|
-
|
498
|
-
|
587
|
+
header_params = {}
|
588
|
+
if request.name
|
589
|
+
header_params["name"] = request.name
|
590
|
+
end
|
591
|
+
|
499
592
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
500
593
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
501
594
|
|
502
595
|
options.apply_defaults timeout: @config.rpcs.get_key.timeout,
|
503
596
|
metadata: metadata,
|
504
597
|
retry_policy: @config.rpcs.get_key.retry_policy
|
505
|
-
|
598
|
+
|
599
|
+
options.apply_defaults timeout: @config.timeout,
|
600
|
+
metadata: @config.metadata,
|
506
601
|
retry_policy: @config.retry_policy
|
507
602
|
|
508
603
|
@recaptcha_enterprise_service_stub.call_rpc :get_key, request, options: options do |response, operation|
|
@@ -545,6 +640,21 @@ module Google
|
|
545
640
|
#
|
546
641
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
547
642
|
#
|
643
|
+
# @example Basic example
|
644
|
+
# require "google/cloud/recaptcha_enterprise/v1beta1"
|
645
|
+
#
|
646
|
+
# # Create a client object. The client can be reused for multiple calls.
|
647
|
+
# client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new
|
648
|
+
#
|
649
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
650
|
+
# request = Google::Cloud::RecaptchaEnterprise::V1beta1::UpdateKeyRequest.new
|
651
|
+
#
|
652
|
+
# # Call the update_key method.
|
653
|
+
# result = client.update_key request
|
654
|
+
#
|
655
|
+
# # The returned object is of type Google::Cloud::RecaptchaEnterprise::V1beta1::Key.
|
656
|
+
# p result
|
657
|
+
#
|
548
658
|
def update_key request, options = nil
|
549
659
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
550
660
|
|
@@ -562,16 +672,20 @@ module Google
|
|
562
672
|
gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION
|
563
673
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
564
674
|
|
565
|
-
header_params = {
|
566
|
-
|
567
|
-
|
675
|
+
header_params = {}
|
676
|
+
if request.key&.name
|
677
|
+
header_params["key.name"] = request.key.name
|
678
|
+
end
|
679
|
+
|
568
680
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
569
681
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
570
682
|
|
571
683
|
options.apply_defaults timeout: @config.rpcs.update_key.timeout,
|
572
684
|
metadata: metadata,
|
573
685
|
retry_policy: @config.rpcs.update_key.retry_policy
|
574
|
-
|
686
|
+
|
687
|
+
options.apply_defaults timeout: @config.timeout,
|
688
|
+
metadata: @config.metadata,
|
575
689
|
retry_policy: @config.retry_policy
|
576
690
|
|
577
691
|
@recaptcha_enterprise_service_stub.call_rpc :update_key, request, options: options do |response, operation|
|
@@ -612,6 +726,21 @@ module Google
|
|
612
726
|
#
|
613
727
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
614
728
|
#
|
729
|
+
# @example Basic example
|
730
|
+
# require "google/cloud/recaptcha_enterprise/v1beta1"
|
731
|
+
#
|
732
|
+
# # Create a client object. The client can be reused for multiple calls.
|
733
|
+
# client = Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new
|
734
|
+
#
|
735
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
736
|
+
# request = Google::Cloud::RecaptchaEnterprise::V1beta1::DeleteKeyRequest.new
|
737
|
+
#
|
738
|
+
# # Call the delete_key method.
|
739
|
+
# result = client.delete_key request
|
740
|
+
#
|
741
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
742
|
+
# p result
|
743
|
+
#
|
615
744
|
def delete_key request, options = nil
|
616
745
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
617
746
|
|
@@ -629,16 +758,20 @@ module Google
|
|
629
758
|
gapic_version: ::Google::Cloud::RecaptchaEnterprise::V1beta1::VERSION
|
630
759
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
631
760
|
|
632
|
-
header_params = {
|
633
|
-
|
634
|
-
|
761
|
+
header_params = {}
|
762
|
+
if request.name
|
763
|
+
header_params["name"] = request.name
|
764
|
+
end
|
765
|
+
|
635
766
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
636
767
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
637
768
|
|
638
769
|
options.apply_defaults timeout: @config.rpcs.delete_key.timeout,
|
639
770
|
metadata: metadata,
|
640
771
|
retry_policy: @config.rpcs.delete_key.retry_policy
|
641
|
-
|
772
|
+
|
773
|
+
options.apply_defaults timeout: @config.timeout,
|
774
|
+
metadata: @config.metadata,
|
642
775
|
retry_policy: @config.retry_policy
|
643
776
|
|
644
777
|
@recaptcha_enterprise_service_stub.call_rpc :delete_key, request, options: options do |response, operation|
|
@@ -662,22 +795,21 @@ module Google
|
|
662
795
|
# Configuration can be applied globally to all clients, or to a single client
|
663
796
|
# on construction.
|
664
797
|
#
|
665
|
-
#
|
666
|
-
#
|
667
|
-
#
|
668
|
-
# to 20 seconds,
|
669
|
-
#
|
670
|
-
#
|
671
|
-
#
|
672
|
-
#
|
673
|
-
#
|
674
|
-
#
|
675
|
-
#
|
676
|
-
#
|
677
|
-
#
|
678
|
-
#
|
679
|
-
#
|
680
|
-
# end
|
798
|
+
# @example
|
799
|
+
#
|
800
|
+
# # Modify the global config, setting the timeout for
|
801
|
+
# # create_assessment to 20 seconds,
|
802
|
+
# # and all remaining timeouts to 10 seconds.
|
803
|
+
# ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.configure do |config|
|
804
|
+
# config.timeout = 10.0
|
805
|
+
# config.rpcs.create_assessment.timeout = 20.0
|
806
|
+
# end
|
807
|
+
#
|
808
|
+
# # Apply the above configuration only to a new client.
|
809
|
+
# client = ::Google::Cloud::RecaptchaEnterprise::V1beta1::RecaptchaEnterpriseService::Client.new do |config|
|
810
|
+
# config.timeout = 10.0
|
811
|
+
# config.rpcs.create_assessment.timeout = 20.0
|
812
|
+
# end
|
681
813
|
#
|
682
814
|
# @!attribute [rw] endpoint
|
683
815
|
# The hostname or hostname:port of the service endpoint.
|
@@ -1,8 +1,6 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto
|
3
3
|
|
4
|
-
require 'google/protobuf'
|
5
|
-
|
6
4
|
require 'google/api/annotations_pb'
|
7
5
|
require 'google/api/client_pb'
|
8
6
|
require 'google/api/field_behavior_pb'
|
@@ -10,6 +8,8 @@ require 'google/api/resource_pb'
|
|
10
8
|
require 'google/protobuf/empty_pb'
|
11
9
|
require 'google/protobuf/field_mask_pb'
|
12
10
|
require 'google/protobuf/timestamp_pb'
|
11
|
+
require 'google/protobuf'
|
12
|
+
|
13
13
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
14
14
|
add_file("google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto", :syntax => :proto3) do
|
15
15
|
add_message "google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest" do
|
@@ -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
|
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
|
@@ -33,11 +33,7 @@ module Google
|
|
33
33
|
# // For Kubernetes resources, the format is {api group}/{kind}.
|
34
34
|
# option (google.api.resource) = {
|
35
35
|
# type: "pubsub.googleapis.com/Topic"
|
36
|
-
#
|
37
|
-
# pattern: "projects/{project}/topics/{topic}"
|
38
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
39
|
-
# parent_name_extractor: "projects/{project}"
|
40
|
-
# }
|
36
|
+
# pattern: "projects/{project}/topics/{topic}"
|
41
37
|
# };
|
42
38
|
# }
|
43
39
|
#
|
@@ -45,10 +41,7 @@ module Google
|
|
45
41
|
#
|
46
42
|
# resources:
|
47
43
|
# - type: "pubsub.googleapis.com/Topic"
|
48
|
-
#
|
49
|
-
# - pattern: "projects/{project}/topics/{topic}"
|
50
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
51
|
-
# parent_name_extractor: "projects/{project}"
|
44
|
+
# pattern: "projects/{project}/topics/{topic}"
|
52
45
|
#
|
53
46
|
# Sometimes, resources have multiple patterns, typically because they can
|
54
47
|
# live under multiple parents.
|
@@ -58,26 +51,10 @@ module Google
|
|
58
51
|
# message LogEntry {
|
59
52
|
# option (google.api.resource) = {
|
60
53
|
# type: "logging.googleapis.com/LogEntry"
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
# }
|
66
|
-
# name_descriptor: {
|
67
|
-
# pattern: "folders/{folder}/logs/{log}"
|
68
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Folder"
|
69
|
-
# parent_name_extractor: "folders/{folder}"
|
70
|
-
# }
|
71
|
-
# name_descriptor: {
|
72
|
-
# pattern: "organizations/{organization}/logs/{log}"
|
73
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Organization"
|
74
|
-
# parent_name_extractor: "organizations/{organization}"
|
75
|
-
# }
|
76
|
-
# name_descriptor: {
|
77
|
-
# pattern: "billingAccounts/{billing_account}/logs/{log}"
|
78
|
-
# parent_type: "billing.googleapis.com/BillingAccount"
|
79
|
-
# parent_name_extractor: "billingAccounts/{billing_account}"
|
80
|
-
# }
|
54
|
+
# pattern: "projects/{project}/logs/{log}"
|
55
|
+
# pattern: "folders/{folder}/logs/{log}"
|
56
|
+
# pattern: "organizations/{organization}/logs/{log}"
|
57
|
+
# pattern: "billingAccounts/{billing_account}/logs/{log}"
|
81
58
|
# };
|
82
59
|
# }
|
83
60
|
#
|
@@ -85,48 +62,10 @@ module Google
|
|
85
62
|
#
|
86
63
|
# resources:
|
87
64
|
# - type: 'logging.googleapis.com/LogEntry'
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
# - pattern: "folders/{folder}/logs/{log}"
|
93
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Folder"
|
94
|
-
# parent_name_extractor: "folders/{folder}"
|
95
|
-
# - pattern: "organizations/{organization}/logs/{log}"
|
96
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Organization"
|
97
|
-
# parent_name_extractor: "organizations/{organization}"
|
98
|
-
# - pattern: "billingAccounts/{billing_account}/logs/{log}"
|
99
|
-
# parent_type: "billing.googleapis.com/BillingAccount"
|
100
|
-
# parent_name_extractor: "billingAccounts/{billing_account}"
|
101
|
-
#
|
102
|
-
# For flexible resources, the resource name doesn't contain parent names, but
|
103
|
-
# the resource itself has parents for policy evaluation.
|
104
|
-
#
|
105
|
-
# Example:
|
106
|
-
#
|
107
|
-
# message Shelf {
|
108
|
-
# option (google.api.resource) = {
|
109
|
-
# type: "library.googleapis.com/Shelf"
|
110
|
-
# name_descriptor: {
|
111
|
-
# pattern: "shelves/{shelf}"
|
112
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
113
|
-
# }
|
114
|
-
# name_descriptor: {
|
115
|
-
# pattern: "shelves/{shelf}"
|
116
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Folder"
|
117
|
-
# }
|
118
|
-
# };
|
119
|
-
# }
|
120
|
-
#
|
121
|
-
# The ResourceDescriptor Yaml config will look like:
|
122
|
-
#
|
123
|
-
# resources:
|
124
|
-
# - type: 'library.googleapis.com/Shelf'
|
125
|
-
# name_descriptor:
|
126
|
-
# - pattern: "shelves/{shelf}"
|
127
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Project"
|
128
|
-
# - pattern: "shelves/{shelf}"
|
129
|
-
# parent_type: "cloudresourcemanager.googleapis.com/Folder"
|
65
|
+
# pattern: "projects/{project}/logs/{log}"
|
66
|
+
# pattern: "folders/{folder}/logs/{log}"
|
67
|
+
# pattern: "organizations/{organization}/logs/{log}"
|
68
|
+
# pattern: "billingAccounts/{billing_account}/logs/{log}"
|
130
69
|
# @!attribute [rw] type
|
131
70
|
# @return [::String]
|
132
71
|
# The resource type. It must be in the format of
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-recaptcha_enterprise-v1beta1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.7'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 2.a
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '0.
|
29
|
+
version: '0.7'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.a
|
@@ -204,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
204
204
|
- !ruby/object:Gem::Version
|
205
205
|
version: '0'
|
206
206
|
requirements: []
|
207
|
-
rubygems_version: 3.
|
207
|
+
rubygems_version: 3.3.4
|
208
208
|
signing_key:
|
209
209
|
specification_version: 4
|
210
210
|
summary: API Client library for the reCAPTCHA Enterprise V1beta1 API
|