v1.d.ts
47.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
/// <reference types="node" />
import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosPromise, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
import { Readable } from 'stream';
export declare namespace recaptchaenterprise_v1 {
export interface Options extends GlobalOptions {
version: 'v1';
}
interface StandardParameters {
/**
* Auth client or API Key for the request
*/
auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient | BaseExternalAccountClient | GoogleAuth;
/**
* V1 error format.
*/
'$.xgafv'?: string;
/**
* OAuth access token.
*/
access_token?: string;
/**
* Data format for response.
*/
alt?: string;
/**
* JSONP
*/
callback?: string;
/**
* Selector specifying which fields to include in a partial response.
*/
fields?: string;
/**
* API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
*/
key?: string;
/**
* OAuth 2.0 token for the current user.
*/
oauth_token?: string;
/**
* Returns response with indentations and line breaks.
*/
prettyPrint?: boolean;
/**
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
*/
quotaUser?: string;
/**
* Legacy upload protocol for media (e.g. "media", "multipart").
*/
uploadType?: string;
/**
* Upload protocol for media (e.g. "raw", "multipart").
*/
upload_protocol?: string;
}
/**
* reCAPTCHA Enterprise API
*
*
*
* @example
* ```js
* const {google} = require('googleapis');
* const recaptchaenterprise = google.recaptchaenterprise('v1');
* ```
*/
export class Recaptchaenterprise {
context: APIRequestContext;
projects: Resource$Projects;
constructor(options: GlobalOptions, google?: GoogleConfigurable);
}
/**
* Settings specific to keys that can be used by Android apps.
*/
export interface Schema$GoogleCloudRecaptchaenterpriseV1AndroidKeySettings {
/**
* Android package names of apps allowed to use the key. Example: 'com.companyname.appname'
*/
allowedPackageNames?: string[] | null;
}
/**
* The request message to annotate an Assessment.
*/
export interface Schema$GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentRequest {
/**
* Optional. The annotation that will be assigned to the Event. This field can be left empty to provide reasons that apply to an event without concluding whether the event is legitimate or fraudulent.
*/
annotation?: string | null;
/**
* Optional. Optional reasons for the annotation that will be assigned to the Event.
*/
reasons?: string[] | null;
}
/**
* Empty response for AnnotateAssessment.
*/
export interface Schema$GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentResponse {
}
/**
* A recaptcha assessment resource.
*/
export interface Schema$GoogleCloudRecaptchaenterpriseV1Assessment {
/**
* The event being assessed.
*/
event?: Schema$GoogleCloudRecaptchaenterpriseV1Event;
/**
* Output only. The resource name for the Assessment in the format "projects/{project\}/assessments/{assessment\}".
*/
name?: string | null;
/**
* Output only. The risk analysis result for the event being assessed.
*/
riskAnalysis?: Schema$GoogleCloudRecaptchaenterpriseV1RiskAnalysis;
/**
* Output only. Properties of the provided event token.
*/
tokenProperties?: Schema$GoogleCloudRecaptchaenterpriseV1TokenProperties;
}
/**
* Metrics related to challenges.
*/
export interface Schema$GoogleCloudRecaptchaenterpriseV1ChallengeMetrics {
/**
* Count of submitted challenge solutions that were incorrect or otherwise deemed suspicious such that a subsequent challenge was triggered.
*/
failedCount?: string | null;
/**
* Count of nocaptchas (successful verification without a challenge) issued.
*/
nocaptchaCount?: string | null;
/**
* Count of reCAPTCHA checkboxes or badges rendered. This is mostly equivalent to a count of pageloads for pages that include reCAPTCHA.
*/
pageloadCount?: string | null;
/**
* Count of nocaptchas (successful verification without a challenge) plus submitted challenge solutions that were correct and resulted in verification.
*/
passedCount?: string | null;
}
export interface Schema$GoogleCloudRecaptchaenterpriseV1Event {
/**
* Optional. The expected action for this type of event. This should be the same action provided at token generation time on client-side platforms already integrated with recaptcha enterprise.
*/
expectedAction?: string | null;
/**
* Optional. The site key that was used to invoke reCAPTCHA on your site and generate the token.
*/
siteKey?: string | null;
/**
* Optional. The user response token provided by the reCAPTCHA client-side integration on your site.
*/
token?: string | null;
/**
* Optional. The user agent present in the request from the user's device related to this event.
*/
userAgent?: string | null;
/**
* Optional. The IP address in the request from the user's device related to this event.
*/
userIpAddress?: string | null;
}
/**
* Settings specific to keys that can be used by iOS apps.
*/
export interface Schema$GoogleCloudRecaptchaenterpriseV1IOSKeySettings {
/**
* iOS bundle ids of apps allowed to use the key. Example: 'com.companyname.productname.appname'
*/
allowedBundleIds?: string[] | null;
}
/**
* A key used to identify and configure applications (web and/or mobile) that use reCAPTCHA Enterprise.
*/
export interface Schema$GoogleCloudRecaptchaenterpriseV1Key {
/**
* Settings for keys that can be used by Android apps.
*/
androidSettings?: Schema$GoogleCloudRecaptchaenterpriseV1AndroidKeySettings;
/**
* The timestamp corresponding to the creation of this Key.
*/
createTime?: string | null;
/**
* Human-readable display name of this key. Modifiable by user.
*/
displayName?: string | null;
/**
* Settings for keys that can be used by iOS apps.
*/
iosSettings?: Schema$GoogleCloudRecaptchaenterpriseV1IOSKeySettings;
/**
* See Creating and managing labels.
*/
labels?: {
[key: string]: string;
} | null;
/**
* The resource name for the Key in the format "projects/{project\}/keys/{key\}".
*/
name?: string | null;
/**
* Options for user acceptance testing.
*/
testingOptions?: Schema$GoogleCloudRecaptchaenterpriseV1TestingOptions;
/**
* Settings for keys that can be used by websites.
*/
webSettings?: Schema$GoogleCloudRecaptchaenterpriseV1WebKeySettings;
}
/**
* Response to request to list keys in a project.
*/
export interface Schema$GoogleCloudRecaptchaenterpriseV1ListKeysResponse {
/**
* Key details.
*/
keys?: Schema$GoogleCloudRecaptchaenterpriseV1Key[];
/**
* Token to retrieve the next page of results. It is set to empty if no keys remain in results.
*/
nextPageToken?: string | null;
}
/**
* Metrics for a single Key.
*/
export interface Schema$GoogleCloudRecaptchaenterpriseV1Metrics {
/**
* Metrics will be continuous and in order by dates, and in the granularity of day. Only challenge-based keys (CHECKBOX, INVISIBLE), will have challenge-based data.
*/
challengeMetrics?: Schema$GoogleCloudRecaptchaenterpriseV1ChallengeMetrics[];
/**
* Metrics will be continuous and in order by dates, and in the granularity of day. All Key types should have score-based data.
*/
scoreMetrics?: Schema$GoogleCloudRecaptchaenterpriseV1ScoreMetrics[];
/**
* Inclusive start time aligned to a day (UTC).
*/
startTime?: string | null;
}
/**
* The migrate key request message.
*/
export interface Schema$GoogleCloudRecaptchaenterpriseV1MigrateKeyRequest {
}
/**
* Risk analysis result for an event.
*/
export interface Schema$GoogleCloudRecaptchaenterpriseV1RiskAnalysis {
/**
* Reasons contributing to the risk analysis verdict.
*/
reasons?: string[] | null;
/**
* Legitimate event score from 0.0 to 1.0. (1.0 means very likely legitimate traffic while 0.0 means very likely non-legitimate traffic).
*/
score?: number | null;
}
/**
* Score distribution.
*/
export interface Schema$GoogleCloudRecaptchaenterpriseV1ScoreDistribution {
/**
* Map key is score value multiplied by 100. The scores are discrete values between [0, 1]. The maximum number of buckets is on order of a few dozen, but typically much lower (ie. 10).
*/
scoreBuckets?: {
[key: string]: string;
} | null;
}
/**
* Metrics related to scoring.
*/
export interface Schema$GoogleCloudRecaptchaenterpriseV1ScoreMetrics {
/**
* Action-based metrics. The map key is the action name which specified by the site owners at time of the "execute" client-side call. Populated only for SCORE keys.
*/
actionMetrics?: {
[key: string]: Schema$GoogleCloudRecaptchaenterpriseV1ScoreDistribution;
} | null;
/**
* Aggregated score metrics for all traffic.
*/
overallMetrics?: Schema$GoogleCloudRecaptchaenterpriseV1ScoreDistribution;
}
/**
* Options for user acceptance testing.
*/
export interface Schema$GoogleCloudRecaptchaenterpriseV1TestingOptions {
/**
* For challenge-based keys only (CHECKBOX, INVISIBLE), all challenge requests for this site will return nocaptcha if NOCAPTCHA, or an unsolvable challenge if CHALLENGE.
*/
testingChallenge?: string | null;
/**
* All assessments for this Key will return this score. Must be between 0 (likely not legitimate) and 1 (likely legitimate) inclusive.
*/
testingScore?: number | null;
}
export interface Schema$GoogleCloudRecaptchaenterpriseV1TokenProperties {
/**
* Action name provided at token generation.
*/
action?: string | null;
/**
* The timestamp corresponding to the generation of the token.
*/
createTime?: string | null;
/**
* The hostname of the page on which the token was generated.
*/
hostname?: string | null;
/**
* Reason associated with the response when valid = false.
*/
invalidReason?: string | null;
/**
* Whether the provided user response token is valid. When valid = false, the reason could be specified in invalid_reason or it could also be due to a user failing to solve a challenge or a sitekey mismatch (i.e the sitekey used to generate the token was different than the one specified in the assessment).
*/
valid?: boolean | null;
}
/**
* Settings specific to keys that can be used by websites.
*/
export interface Schema$GoogleCloudRecaptchaenterpriseV1WebKeySettings {
/**
* If set to true, it means allowed_domains will not be enforced.
*/
allowAllDomains?: boolean | null;
/**
* Required. Whether this key can be used on AMP (Accelerated Mobile Pages) websites. This can only be set for the SCORE integration type.
*/
allowAmpTraffic?: boolean | null;
/**
* Domains or subdomains of websites allowed to use the key. All subdomains of an allowed domain are automatically allowed. A valid domain requires a host and must not include any path, port, query or fragment. Examples: 'example.com' or 'subdomain.example.com'
*/
allowedDomains?: string[] | null;
/**
* Settings for the frequency and difficulty at which this key triggers captcha challenges. This should only be specified for IntegrationTypes CHECKBOX and INVISIBLE.
*/
challengeSecurityPreference?: string | null;
/**
* Required. Describes how this key is integrated with the website.
*/
integrationType?: string | null;
}
/**
* A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); \} The JSON representation for `Empty` is empty JSON object `{\}`.
*/
export interface Schema$GoogleProtobufEmpty {
}
export class Resource$Projects {
context: APIRequestContext;
assessments: Resource$Projects$Assessments;
keys: Resource$Projects$Keys;
constructor(context: APIRequestContext);
}
export class Resource$Projects$Assessments {
context: APIRequestContext;
constructor(context: APIRequestContext);
/**
* Annotates a previously created Assessment to provide additional information on whether the event turned out to be authentic or fraudulent.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/recaptchaenterprise.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const recaptchaenterprise = google.recaptchaenterprise('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await recaptchaenterprise.projects.assessments.annotate({
* // Required. The resource name of the Assessment, in the format "projects/{project\}/assessments/{assessment\}".
* name: 'projects/my-project/assessments/my-assessment',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "annotation": "my_annotation",
* // "reasons": []
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {}
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
annotate(params: Params$Resource$Projects$Assessments$Annotate, options: StreamMethodOptions): GaxiosPromise<Readable>;
annotate(params?: Params$Resource$Projects$Assessments$Annotate, options?: MethodOptions): GaxiosPromise<Schema$GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentResponse>;
annotate(params: Params$Resource$Projects$Assessments$Annotate, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
annotate(params: Params$Resource$Projects$Assessments$Annotate, options: MethodOptions | BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentResponse>, callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentResponse>): void;
annotate(params: Params$Resource$Projects$Assessments$Annotate, callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentResponse>): void;
annotate(callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentResponse>): void;
/**
* Creates an Assessment of the likelihood an event is legitimate.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/recaptchaenterprise.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const recaptchaenterprise = google.recaptchaenterprise('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await recaptchaenterprise.projects.assessments.create({
* // Required. The name of the project in which the assessment will be created, in the format "projects/{project\}".
* parent: 'projects/my-project',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "event": {},
* // "name": "my_name",
* // "riskAnalysis": {},
* // "tokenProperties": {}
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "event": {},
* // "name": "my_name",
* // "riskAnalysis": {},
* // "tokenProperties": {}
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
create(params: Params$Resource$Projects$Assessments$Create, options: StreamMethodOptions): GaxiosPromise<Readable>;
create(params?: Params$Resource$Projects$Assessments$Create, options?: MethodOptions): GaxiosPromise<Schema$GoogleCloudRecaptchaenterpriseV1Assessment>;
create(params: Params$Resource$Projects$Assessments$Create, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
create(params: Params$Resource$Projects$Assessments$Create, options: MethodOptions | BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Assessment>, callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Assessment>): void;
create(params: Params$Resource$Projects$Assessments$Create, callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Assessment>): void;
create(callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Assessment>): void;
}
export interface Params$Resource$Projects$Assessments$Annotate extends StandardParameters {
/**
* Required. The resource name of the Assessment, in the format "projects/{project\}/assessments/{assessment\}".
*/
name?: string;
/**
* Request body metadata
*/
requestBody?: Schema$GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentRequest;
}
export interface Params$Resource$Projects$Assessments$Create extends StandardParameters {
/**
* Required. The name of the project in which the assessment will be created, in the format "projects/{project\}".
*/
parent?: string;
/**
* Request body metadata
*/
requestBody?: Schema$GoogleCloudRecaptchaenterpriseV1Assessment;
}
export class Resource$Projects$Keys {
context: APIRequestContext;
constructor(context: APIRequestContext);
/**
* Creates a new reCAPTCHA Enterprise key.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/recaptchaenterprise.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const recaptchaenterprise = google.recaptchaenterprise('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await recaptchaenterprise.projects.keys.create({
* // Required. The name of the project in which the key will be created, in the format "projects/{project\}".
* parent: 'projects/my-project',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "androidSettings": {},
* // "createTime": "my_createTime",
* // "displayName": "my_displayName",
* // "iosSettings": {},
* // "labels": {},
* // "name": "my_name",
* // "testingOptions": {},
* // "webSettings": {}
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "androidSettings": {},
* // "createTime": "my_createTime",
* // "displayName": "my_displayName",
* // "iosSettings": {},
* // "labels": {},
* // "name": "my_name",
* // "testingOptions": {},
* // "webSettings": {}
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
create(params: Params$Resource$Projects$Keys$Create, options: StreamMethodOptions): GaxiosPromise<Readable>;
create(params?: Params$Resource$Projects$Keys$Create, options?: MethodOptions): GaxiosPromise<Schema$GoogleCloudRecaptchaenterpriseV1Key>;
create(params: Params$Resource$Projects$Keys$Create, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
create(params: Params$Resource$Projects$Keys$Create, options: MethodOptions | BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Key>, callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Key>): void;
create(params: Params$Resource$Projects$Keys$Create, callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Key>): void;
create(callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Key>): void;
/**
* Deletes the specified key.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/recaptchaenterprise.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const recaptchaenterprise = google.recaptchaenterprise('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await recaptchaenterprise.projects.keys.delete({
* // Required. The name of the key to be deleted, in the format "projects/{project\}/keys/{key\}".
* name: 'projects/my-project/keys/my-key',
* });
* console.log(res.data);
*
* // Example response
* // {}
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
delete(params: Params$Resource$Projects$Keys$Delete, options: StreamMethodOptions): GaxiosPromise<Readable>;
delete(params?: Params$Resource$Projects$Keys$Delete, options?: MethodOptions): GaxiosPromise<Schema$GoogleProtobufEmpty>;
delete(params: Params$Resource$Projects$Keys$Delete, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
delete(params: Params$Resource$Projects$Keys$Delete, options: MethodOptions | BodyResponseCallback<Schema$GoogleProtobufEmpty>, callback: BodyResponseCallback<Schema$GoogleProtobufEmpty>): void;
delete(params: Params$Resource$Projects$Keys$Delete, callback: BodyResponseCallback<Schema$GoogleProtobufEmpty>): void;
delete(callback: BodyResponseCallback<Schema$GoogleProtobufEmpty>): void;
/**
* Returns the specified key.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/recaptchaenterprise.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const recaptchaenterprise = google.recaptchaenterprise('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await recaptchaenterprise.projects.keys.get({
* // Required. The name of the requested key, in the format "projects/{project\}/keys/{key\}".
* name: 'projects/my-project/keys/my-key',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "androidSettings": {},
* // "createTime": "my_createTime",
* // "displayName": "my_displayName",
* // "iosSettings": {},
* // "labels": {},
* // "name": "my_name",
* // "testingOptions": {},
* // "webSettings": {}
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
get(params: Params$Resource$Projects$Keys$Get, options: StreamMethodOptions): GaxiosPromise<Readable>;
get(params?: Params$Resource$Projects$Keys$Get, options?: MethodOptions): GaxiosPromise<Schema$GoogleCloudRecaptchaenterpriseV1Key>;
get(params: Params$Resource$Projects$Keys$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
get(params: Params$Resource$Projects$Keys$Get, options: MethodOptions | BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Key>, callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Key>): void;
get(params: Params$Resource$Projects$Keys$Get, callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Key>): void;
get(callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Key>): void;
/**
* Get some aggregated metrics for a Key. This data can be used to build dashboards.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/recaptchaenterprise.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const recaptchaenterprise = google.recaptchaenterprise('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await recaptchaenterprise.projects.keys.getMetrics({
* // Required. The name of the requested metrics, in the format "projects/{project\}/keys/{key\}/metrics".
* name: 'projects/my-project/keys/my-key/metrics',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "challengeMetrics": [],
* // "scoreMetrics": [],
* // "startTime": "my_startTime"
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
getMetrics(params: Params$Resource$Projects$Keys$Getmetrics, options: StreamMethodOptions): GaxiosPromise<Readable>;
getMetrics(params?: Params$Resource$Projects$Keys$Getmetrics, options?: MethodOptions): GaxiosPromise<Schema$GoogleCloudRecaptchaenterpriseV1Metrics>;
getMetrics(params: Params$Resource$Projects$Keys$Getmetrics, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
getMetrics(params: Params$Resource$Projects$Keys$Getmetrics, options: MethodOptions | BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Metrics>, callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Metrics>): void;
getMetrics(params: Params$Resource$Projects$Keys$Getmetrics, callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Metrics>): void;
getMetrics(callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Metrics>): void;
/**
* Returns the list of all keys that belong to a project.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/recaptchaenterprise.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const recaptchaenterprise = google.recaptchaenterprise('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await recaptchaenterprise.projects.keys.list({
* // Optional. The maximum number of keys to return. Default is 10. Max limit is 1000.
* pageSize: 'placeholder-value',
* // Optional. The next_page_token value returned from a previous. ListKeysRequest, if any.
* pageToken: 'placeholder-value',
* // Required. The name of the project that contains the keys that will be listed, in the format "projects/{project\}".
* parent: 'projects/my-project',
* });
* console.log(res.data);
*
* // Example response
* // {
* // "keys": [],
* // "nextPageToken": "my_nextPageToken"
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
list(params: Params$Resource$Projects$Keys$List, options: StreamMethodOptions): GaxiosPromise<Readable>;
list(params?: Params$Resource$Projects$Keys$List, options?: MethodOptions): GaxiosPromise<Schema$GoogleCloudRecaptchaenterpriseV1ListKeysResponse>;
list(params: Params$Resource$Projects$Keys$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
list(params: Params$Resource$Projects$Keys$List, options: MethodOptions | BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1ListKeysResponse>, callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1ListKeysResponse>): void;
list(params: Params$Resource$Projects$Keys$List, callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1ListKeysResponse>): void;
list(callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1ListKeysResponse>): void;
/**
* Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. Once a key is migrated, it can be used from either product. SiteVerify requests are billed as CreateAssessment calls. You must be authenticated as one of the current owners of the reCAPTCHA Site Key, and your user must have the reCAPTCHA Enterprise Admin IAM role in the destination project.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/recaptchaenterprise.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const recaptchaenterprise = google.recaptchaenterprise('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await recaptchaenterprise.projects.keys.migrate({
* // Required. The name of the key to be migrated, in the format "projects/{project\}/keys/{key\}".
* name: 'projects/my-project/keys/my-key',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {}
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "androidSettings": {},
* // "createTime": "my_createTime",
* // "displayName": "my_displayName",
* // "iosSettings": {},
* // "labels": {},
* // "name": "my_name",
* // "testingOptions": {},
* // "webSettings": {}
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
migrate(params: Params$Resource$Projects$Keys$Migrate, options: StreamMethodOptions): GaxiosPromise<Readable>;
migrate(params?: Params$Resource$Projects$Keys$Migrate, options?: MethodOptions): GaxiosPromise<Schema$GoogleCloudRecaptchaenterpriseV1Key>;
migrate(params: Params$Resource$Projects$Keys$Migrate, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
migrate(params: Params$Resource$Projects$Keys$Migrate, options: MethodOptions | BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Key>, callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Key>): void;
migrate(params: Params$Resource$Projects$Keys$Migrate, callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Key>): void;
migrate(callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Key>): void;
/**
* Updates the specified key.
* @example
* ```js
* // Before running the sample:
* // - Enable the API at:
* // https://console.developers.google.com/apis/api/recaptchaenterprise.googleapis.com
* // - Login into gcloud by running:
* // `$ gcloud auth application-default login`
* // - Install the npm module by running:
* // `$ npm install googleapis`
*
* const {google} = require('googleapis');
* const recaptchaenterprise = google.recaptchaenterprise('v1');
*
* async function main() {
* const auth = new google.auth.GoogleAuth({
* // Scopes can be specified either as an array or as a single, space-delimited string.
* scopes: ['https://www.googleapis.com/auth/cloud-platform'],
* });
*
* // Acquire an auth client, and bind it to all future calls
* const authClient = await auth.getClient();
* google.options({auth: authClient});
*
* // Do the magic
* const res = await recaptchaenterprise.projects.keys.patch({
* // The resource name for the Key in the format "projects/{project\}/keys/{key\}".
* name: 'projects/my-project/keys/my-key',
* // Optional. The mask to control which fields of the key get updated. If the mask is not present, all fields will be updated.
* updateMask: 'placeholder-value',
*
* // Request body metadata
* requestBody: {
* // request body parameters
* // {
* // "androidSettings": {},
* // "createTime": "my_createTime",
* // "displayName": "my_displayName",
* // "iosSettings": {},
* // "labels": {},
* // "name": "my_name",
* // "testingOptions": {},
* // "webSettings": {}
* // }
* },
* });
* console.log(res.data);
*
* // Example response
* // {
* // "androidSettings": {},
* // "createTime": "my_createTime",
* // "displayName": "my_displayName",
* // "iosSettings": {},
* // "labels": {},
* // "name": "my_name",
* // "testingOptions": {},
* // "webSettings": {}
* // }
* }
*
* main().catch(e => {
* console.error(e);
* throw e;
* });
*
* ```
*
* @param params - Parameters for request
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
* @param callback - Optional callback that handles the response.
* @returns A promise if used with async/await, or void if used with a callback.
*/
patch(params: Params$Resource$Projects$Keys$Patch, options: StreamMethodOptions): GaxiosPromise<Readable>;
patch(params?: Params$Resource$Projects$Keys$Patch, options?: MethodOptions): GaxiosPromise<Schema$GoogleCloudRecaptchaenterpriseV1Key>;
patch(params: Params$Resource$Projects$Keys$Patch, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
patch(params: Params$Resource$Projects$Keys$Patch, options: MethodOptions | BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Key>, callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Key>): void;
patch(params: Params$Resource$Projects$Keys$Patch, callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Key>): void;
patch(callback: BodyResponseCallback<Schema$GoogleCloudRecaptchaenterpriseV1Key>): void;
}
export interface Params$Resource$Projects$Keys$Create extends StandardParameters {
/**
* Required. The name of the project in which the key will be created, in the format "projects/{project\}".
*/
parent?: string;
/**
* Request body metadata
*/
requestBody?: Schema$GoogleCloudRecaptchaenterpriseV1Key;
}
export interface Params$Resource$Projects$Keys$Delete extends StandardParameters {
/**
* Required. The name of the key to be deleted, in the format "projects/{project\}/keys/{key\}".
*/
name?: string;
}
export interface Params$Resource$Projects$Keys$Get extends StandardParameters {
/**
* Required. The name of the requested key, in the format "projects/{project\}/keys/{key\}".
*/
name?: string;
}
export interface Params$Resource$Projects$Keys$Getmetrics extends StandardParameters {
/**
* Required. The name of the requested metrics, in the format "projects/{project\}/keys/{key\}/metrics".
*/
name?: string;
}
export interface Params$Resource$Projects$Keys$List extends StandardParameters {
/**
* Optional. The maximum number of keys to return. Default is 10. Max limit is 1000.
*/
pageSize?: number;
/**
* Optional. The next_page_token value returned from a previous. ListKeysRequest, if any.
*/
pageToken?: string;
/**
* Required. The name of the project that contains the keys that will be listed, in the format "projects/{project\}".
*/
parent?: string;
}
export interface Params$Resource$Projects$Keys$Migrate extends StandardParameters {
/**
* Required. The name of the key to be migrated, in the format "projects/{project\}/keys/{key\}".
*/
name?: string;
/**
* Request body metadata
*/
requestBody?: Schema$GoogleCloudRecaptchaenterpriseV1MigrateKeyRequest;
}
export interface Params$Resource$Projects$Keys$Patch extends StandardParameters {
/**
* The resource name for the Key in the format "projects/{project\}/keys/{key\}".
*/
name?: string;
/**
* Optional. The mask to control which fields of the key get updated. If the mask is not present, all fields will be updated.
*/
updateMask?: string;
/**
* Request body metadata
*/
requestBody?: Schema$GoogleCloudRecaptchaenterpriseV1Key;
}
export {};
}