-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
recaptchaenterprise-gen.go
3256 lines (2953 loc) · 126 KB
/
recaptchaenterprise-gen.go
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
// Copyright 2022 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package recaptchaenterprise provides access to the reCAPTCHA Enterprise API.
//
// For product documentation, see: https://cloud.google.com/recaptcha-enterprise/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/recaptchaenterprise/v1"
// ...
// ctx := context.Background()
// recaptchaenterpriseService, err := recaptchaenterprise.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// recaptchaenterpriseService, err := recaptchaenterprise.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// recaptchaenterpriseService, err := recaptchaenterprise.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package recaptchaenterprise // import "google.golang.org/api/recaptchaenterprise/v1"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
internal "google.golang.org/api/internal"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
internaloption "google.golang.org/api/option/internaloption"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = internaloption.WithDefaultEndpoint
const apiId = "recaptchaenterprise:v1"
const apiName = "recaptchaenterprise"
const apiVersion = "v1"
const basePath = "https://recaptchaenterprise.googleapis.com/"
const mtlsBasePath = "https://recaptchaenterprise.mtls.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// See, edit, configure, and delete your Google Cloud data and see the
// email address for your Google Account.
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := internaloption.WithDefaultScopes(
"https://www.googleapis.com/auth/cloud-platform",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Projects = NewProjectsService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Projects *ProjectsService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewProjectsService(s *Service) *ProjectsService {
rs := &ProjectsService{s: s}
rs.Assessments = NewProjectsAssessmentsService(s)
rs.Keys = NewProjectsKeysService(s)
rs.Relatedaccountgroupmemberships = NewProjectsRelatedaccountgroupmembershipsService(s)
rs.Relatedaccountgroups = NewProjectsRelatedaccountgroupsService(s)
return rs
}
type ProjectsService struct {
s *Service
Assessments *ProjectsAssessmentsService
Keys *ProjectsKeysService
Relatedaccountgroupmemberships *ProjectsRelatedaccountgroupmembershipsService
Relatedaccountgroups *ProjectsRelatedaccountgroupsService
}
func NewProjectsAssessmentsService(s *Service) *ProjectsAssessmentsService {
rs := &ProjectsAssessmentsService{s: s}
return rs
}
type ProjectsAssessmentsService struct {
s *Service
}
func NewProjectsKeysService(s *Service) *ProjectsKeysService {
rs := &ProjectsKeysService{s: s}
return rs
}
type ProjectsKeysService struct {
s *Service
}
func NewProjectsRelatedaccountgroupmembershipsService(s *Service) *ProjectsRelatedaccountgroupmembershipsService {
rs := &ProjectsRelatedaccountgroupmembershipsService{s: s}
return rs
}
type ProjectsRelatedaccountgroupmembershipsService struct {
s *Service
}
func NewProjectsRelatedaccountgroupsService(s *Service) *ProjectsRelatedaccountgroupsService {
rs := &ProjectsRelatedaccountgroupsService{s: s}
rs.Memberships = NewProjectsRelatedaccountgroupsMembershipsService(s)
return rs
}
type ProjectsRelatedaccountgroupsService struct {
s *Service
Memberships *ProjectsRelatedaccountgroupsMembershipsService
}
func NewProjectsRelatedaccountgroupsMembershipsService(s *Service) *ProjectsRelatedaccountgroupsMembershipsService {
rs := &ProjectsRelatedaccountgroupsMembershipsService{s: s}
return rs
}
type ProjectsRelatedaccountgroupsMembershipsService struct {
s *Service
}
// GoogleCloudRecaptchaenterpriseV1AccountDefenderAssessment: Account
// Defender risk assessment.
type GoogleCloudRecaptchaenterpriseV1AccountDefenderAssessment struct {
// Labels: Labels for this request.
//
// Possible values:
// "ACCOUNT_DEFENDER_LABEL_UNSPECIFIED" - Default unspecified type.
// "PROFILE_MATCH" - The request matches a known good profile for the
// user.
// "SUSPICIOUS_LOGIN_ACTIVITY" - The request is potentially a
// suspicious login event and should be further verified either via
// multi-factor authentication or another system.
// "SUSPICIOUS_ACCOUNT_CREATION" - The request matched a profile that
// previously had suspicious account creation behavior. This could mean
// this is a fake account.
// "RELATED_ACCOUNTS_NUMBER_HIGH" - The account in the request has a
// high number of related accounts. It does not necessarily imply that
// the account is bad but could require investigating.
Labels []string `json:"labels,omitempty"`
// ForceSendFields is a list of field names (e.g. "Labels") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Labels") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudRecaptchaenterpriseV1AccountDefenderAssessment) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudRecaptchaenterpriseV1AccountDefenderAssessment
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudRecaptchaenterpriseV1AndroidKeySettings: Settings specific
// to keys that can be used by Android apps.
type GoogleCloudRecaptchaenterpriseV1AndroidKeySettings struct {
// AllowAllPackageNames: If set to true, allowed_package_names are not
// enforced.
AllowAllPackageNames bool `json:"allowAllPackageNames,omitempty"`
// AllowedPackageNames: Android package names of apps allowed to use the
// key. Example: 'com.companyname.appname'
AllowedPackageNames []string `json:"allowedPackageNames,omitempty"`
// ForceSendFields is a list of field names (e.g.
// "AllowAllPackageNames") to unconditionally include in API requests.
// By default, fields with empty or default values are omitted from API
// requests. However, any non-pointer, non-interface field appearing in
// ForceSendFields will be sent to the server regardless of whether the
// field is empty or not. This may be used to include empty fields in
// Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AllowAllPackageNames") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudRecaptchaenterpriseV1AndroidKeySettings) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudRecaptchaenterpriseV1AndroidKeySettings
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentRequest: The
// request message to annotate an Assessment.
type GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentRequest struct {
// Annotation: 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.
//
// Possible values:
// "ANNOTATION_UNSPECIFIED" - Default unspecified type.
// "LEGITIMATE" - Provides information that the event turned out to be
// legitimate.
// "FRAUDULENT" - Provides information that the event turned out to be
// fraudulent.
// "PASSWORD_CORRECT" - Provides information that the event was
// related to a login event in which the user typed the correct
// password. Deprecated, prefer indicating CORRECT_PASSWORD through the
// reasons field instead.
// "PASSWORD_INCORRECT" - Provides information that the event was
// related to a login event in which the user typed the incorrect
// password. Deprecated, prefer indicating INCORRECT_PASSWORD through
// the reasons field instead.
Annotation string `json:"annotation,omitempty"`
// HashedAccountId: Optional. Optional unique stable hashed user
// identifier to apply to the assessment. This is an alternative to
// setting the hashed_account_id in CreateAssessment, for example when
// the account identifier is not yet known in the initial request. It is
// recommended that the identifier is hashed using hmac-sha256 with
// stable secret.
HashedAccountId string `json:"hashedAccountId,omitempty"`
// Reasons: Optional. Optional reasons for the annotation that will be
// assigned to the Event.
//
// Possible values:
// "REASON_UNSPECIFIED" - Default unspecified reason.
// "CHARGEBACK" - Indicates a chargeback issued for the transaction
// with no other details. When possible, specify the type by using
// CHARGEBACK_FRAUD or CHARGEBACK_DISPUTE instead.
// "CHARGEBACK_FRAUD" - Indicates a chargeback related to an alleged
// unauthorized transaction from the cardholder's perspective (for
// example, the card number was stolen).
// "CHARGEBACK_DISPUTE" - Indicates a chargeback related to the
// cardholder having provided their card details but allegedly not being
// satisfied with the purchase (for example, misrepresentation,
// attempted cancellation).
// "PAYMENT_HEURISTICS" - Indicates the transaction associated with
// the assessment is suspected of being fraudulent based on the payment
// method, billing details, shipping address or other transaction
// information.
// "INITIATED_TWO_FACTOR" - Indicates that the user was served a 2FA
// challenge. An old assessment with `ENUM_VALUES.INITIATED_TWO_FACTOR`
// reason that has not been overwritten with `PASSED_TWO_FACTOR` is
// treated as an abandoned 2FA flow. This is equivalent to
// `FAILED_TWO_FACTOR`.
// "PASSED_TWO_FACTOR" - Indicates that the user passed a 2FA
// challenge.
// "FAILED_TWO_FACTOR" - Indicates that the user failed a 2FA
// challenge.
// "CORRECT_PASSWORD" - Indicates the user provided the correct
// password.
// "INCORRECT_PASSWORD" - Indicates the user provided an incorrect
// password.
Reasons []string `json:"reasons,omitempty"`
// ForceSendFields is a list of field names (e.g. "Annotation") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Annotation") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentRequest) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentRequest
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentResponse: Empty
// response for AnnotateAssessment.
type GoogleCloudRecaptchaenterpriseV1AnnotateAssessmentResponse struct {
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
}
// GoogleCloudRecaptchaenterpriseV1Assessment: A recaptcha assessment
// resource.
type GoogleCloudRecaptchaenterpriseV1Assessment struct {
// AccountDefenderAssessment: Assessment returned by Account Defender
// when a hashed_account_id is provided.
AccountDefenderAssessment *GoogleCloudRecaptchaenterpriseV1AccountDefenderAssessment `json:"accountDefenderAssessment,omitempty"`
// Event: The event being assessed.
Event *GoogleCloudRecaptchaenterpriseV1Event `json:"event,omitempty"`
// Name: Output only. The resource name for the Assessment in the format
// "projects/{project}/assessments/{assessment}".
Name string `json:"name,omitempty"`
// RiskAnalysis: Output only. The risk analysis result for the event
// being assessed.
RiskAnalysis *GoogleCloudRecaptchaenterpriseV1RiskAnalysis `json:"riskAnalysis,omitempty"`
// TokenProperties: Output only. Properties of the provided event token.
TokenProperties *GoogleCloudRecaptchaenterpriseV1TokenProperties `json:"tokenProperties,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g.
// "AccountDefenderAssessment") to unconditionally include in API
// requests. By default, fields with empty or default values are omitted
// from API requests. However, any non-pointer, non-interface field
// appearing in ForceSendFields will be sent to the server regardless of
// whether the field is empty or not. This may be used to include empty
// fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g.
// "AccountDefenderAssessment") to include in API requests with the JSON
// null value. By default, fields with empty values are omitted from API
// requests. However, any field with an empty value appearing in
// NullFields will be sent to the server as null. It is an error if a
// field in this list has a non-empty value. This may be used to include
// null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudRecaptchaenterpriseV1Assessment) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudRecaptchaenterpriseV1Assessment
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudRecaptchaenterpriseV1ChallengeMetrics: Metrics related to
// challenges.
type GoogleCloudRecaptchaenterpriseV1ChallengeMetrics struct {
// FailedCount: Count of submitted challenge solutions that were
// incorrect or otherwise deemed suspicious such that a subsequent
// challenge was triggered.
FailedCount int64 `json:"failedCount,omitempty,string"`
// NocaptchaCount: Count of nocaptchas (successful verification without
// a challenge) issued.
NocaptchaCount int64 `json:"nocaptchaCount,omitempty,string"`
// PageloadCount: Count of reCAPTCHA checkboxes or badges rendered. This
// is mostly equivalent to a count of pageloads for pages that include
// reCAPTCHA.
PageloadCount int64 `json:"pageloadCount,omitempty,string"`
// PassedCount: Count of nocaptchas (successful verification without a
// challenge) plus submitted challenge solutions that were correct and
// resulted in verification.
PassedCount int64 `json:"passedCount,omitempty,string"`
// ForceSendFields is a list of field names (e.g. "FailedCount") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "FailedCount") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudRecaptchaenterpriseV1ChallengeMetrics) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudRecaptchaenterpriseV1ChallengeMetrics
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type GoogleCloudRecaptchaenterpriseV1Event struct {
// ExpectedAction: 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 `json:"expectedAction,omitempty"`
// HashedAccountId: Optional. Optional unique stable hashed user
// identifier for the request. The identifier should ideally be hashed
// using sha256 with stable secret.
HashedAccountId string `json:"hashedAccountId,omitempty"`
// SiteKey: Optional. The site key that was used to invoke reCAPTCHA on
// your site and generate the token.
SiteKey string `json:"siteKey,omitempty"`
// Token: Optional. The user response token provided by the reCAPTCHA
// client-side integration on your site.
Token string `json:"token,omitempty"`
// UserAgent: Optional. The user agent present in the request from the
// user's device related to this event.
UserAgent string `json:"userAgent,omitempty"`
// UserIpAddress: Optional. The IP address in the request from the
// user's device related to this event.
UserIpAddress string `json:"userIpAddress,omitempty"`
// ForceSendFields is a list of field names (e.g. "ExpectedAction") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ExpectedAction") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudRecaptchaenterpriseV1Event) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudRecaptchaenterpriseV1Event
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudRecaptchaenterpriseV1IOSKeySettings: Settings specific to
// keys that can be used by iOS apps.
type GoogleCloudRecaptchaenterpriseV1IOSKeySettings struct {
// AllowAllBundleIds: If set to true, allowed_bundle_ids are not
// enforced.
AllowAllBundleIds bool `json:"allowAllBundleIds,omitempty"`
// AllowedBundleIds: iOS bundle ids of apps allowed to use the key.
// Example: 'com.companyname.productname.appname'
AllowedBundleIds []string `json:"allowedBundleIds,omitempty"`
// ForceSendFields is a list of field names (e.g. "AllowAllBundleIds")
// to unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AllowAllBundleIds") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudRecaptchaenterpriseV1IOSKeySettings) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudRecaptchaenterpriseV1IOSKeySettings
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudRecaptchaenterpriseV1Key: A key used to identify and
// configure applications (web and/or mobile) that use reCAPTCHA
// Enterprise.
type GoogleCloudRecaptchaenterpriseV1Key struct {
// AndroidSettings: Settings for keys that can be used by Android apps.
AndroidSettings *GoogleCloudRecaptchaenterpriseV1AndroidKeySettings `json:"androidSettings,omitempty"`
// CreateTime: The timestamp corresponding to the creation of this Key.
CreateTime string `json:"createTime,omitempty"`
// DisplayName: Human-readable display name of this key. Modifiable by
// user.
DisplayName string `json:"displayName,omitempty"`
// IosSettings: Settings for keys that can be used by iOS apps.
IosSettings *GoogleCloudRecaptchaenterpriseV1IOSKeySettings `json:"iosSettings,omitempty"`
// Labels: See Creating and managing labels.
Labels map[string]string `json:"labels,omitempty"`
// Name: The resource name for the Key in the format
// "projects/{project}/keys/{key}".
Name string `json:"name,omitempty"`
// TestingOptions: Options for user acceptance testing.
TestingOptions *GoogleCloudRecaptchaenterpriseV1TestingOptions `json:"testingOptions,omitempty"`
// WafSettings: Settings for WAF
WafSettings *GoogleCloudRecaptchaenterpriseV1WafSettings `json:"wafSettings,omitempty"`
// WebSettings: Settings for keys that can be used by websites.
WebSettings *GoogleCloudRecaptchaenterpriseV1WebKeySettings `json:"webSettings,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "AndroidSettings") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "AndroidSettings") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudRecaptchaenterpriseV1Key) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudRecaptchaenterpriseV1Key
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudRecaptchaenterpriseV1ListKeysResponse: Response to request
// to list keys in a project.
type GoogleCloudRecaptchaenterpriseV1ListKeysResponse struct {
// Keys: Key details.
Keys []*GoogleCloudRecaptchaenterpriseV1Key `json:"keys,omitempty"`
// NextPageToken: Token to retrieve the next page of results. It is set
// to empty if no keys remain in results.
NextPageToken string `json:"nextPageToken,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "Keys") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Keys") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudRecaptchaenterpriseV1ListKeysResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudRecaptchaenterpriseV1ListKeysResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudRecaptchaenterpriseV1ListRelatedAccountGroupMembershipsResp
// onse: The response to a `ListRelatedAccountGroupMemberships` call.
type GoogleCloudRecaptchaenterpriseV1ListRelatedAccountGroupMembershipsResponse struct {
// NextPageToken: A token, which can be sent as `page_token` to retrieve
// the next page. If this field is omitted, there are no subsequent
// pages.
NextPageToken string `json:"nextPageToken,omitempty"`
// RelatedAccountGroupMemberships: The memberships listed by the query.
RelatedAccountGroupMemberships []*GoogleCloudRecaptchaenterpriseV1RelatedAccountGroupMembership `json:"relatedAccountGroupMemberships,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "NextPageToken") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "NextPageToken") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudRecaptchaenterpriseV1ListRelatedAccountGroupMembershipsResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudRecaptchaenterpriseV1ListRelatedAccountGroupMembershipsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudRecaptchaenterpriseV1ListRelatedAccountGroupsResponse: The
// response to a `ListRelatedAccountGroups` call.
type GoogleCloudRecaptchaenterpriseV1ListRelatedAccountGroupsResponse struct {
// NextPageToken: A token, which can be sent as `page_token` to retrieve
// the next page. If this field is omitted, there are no subsequent
// pages.
NextPageToken string `json:"nextPageToken,omitempty"`
// RelatedAccountGroups: The groups of related accounts listed by the
// query.
RelatedAccountGroups []*GoogleCloudRecaptchaenterpriseV1RelatedAccountGroup `json:"relatedAccountGroups,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "NextPageToken") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "NextPageToken") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudRecaptchaenterpriseV1ListRelatedAccountGroupsResponse) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudRecaptchaenterpriseV1ListRelatedAccountGroupsResponse
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudRecaptchaenterpriseV1Metrics: Metrics for a single Key.
type GoogleCloudRecaptchaenterpriseV1Metrics struct {
// ChallengeMetrics: 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 []*GoogleCloudRecaptchaenterpriseV1ChallengeMetrics `json:"challengeMetrics,omitempty"`
// Name: Output only. The name of the metrics, in the format
// "projects/{project}/keys/{key}/metrics".
Name string `json:"name,omitempty"`
// ScoreMetrics: Metrics will be continuous and in order by dates, and
// in the granularity of day. All Key types should have score-based
// data.
ScoreMetrics []*GoogleCloudRecaptchaenterpriseV1ScoreMetrics `json:"scoreMetrics,omitempty"`
// StartTime: Inclusive start time aligned to a day (UTC).
StartTime string `json:"startTime,omitempty"`
// ServerResponse contains the HTTP response code and headers from the
// server.
googleapi.ServerResponse `json:"-"`
// ForceSendFields is a list of field names (e.g. "ChallengeMetrics") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ChallengeMetrics") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudRecaptchaenterpriseV1Metrics) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudRecaptchaenterpriseV1Metrics
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudRecaptchaenterpriseV1MigrateKeyRequest: The migrate key
// request message.
type GoogleCloudRecaptchaenterpriseV1MigrateKeyRequest struct {
}
// GoogleCloudRecaptchaenterpriseV1RelatedAccountGroup: A group of
// related accounts.
type GoogleCloudRecaptchaenterpriseV1RelatedAccountGroup struct {
// Name: Required. The resource name for the related account group in
// the format
// `projects/{project}/relatedaccountgroups/{related_account_group}`.
Name string `json:"name,omitempty"`
// ForceSendFields is a list of field names (e.g. "Name") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Name") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudRecaptchaenterpriseV1RelatedAccountGroup) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudRecaptchaenterpriseV1RelatedAccountGroup
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudRecaptchaenterpriseV1RelatedAccountGroupMembership: A
// membership in a group of related accounts.
type GoogleCloudRecaptchaenterpriseV1RelatedAccountGroupMembership struct {
// HashedAccountId: The unique stable hashed user identifier of the
// member. The identifier corresponds to a `hashed_account_id` provided
// in a previous CreateAssessment or AnnotateAssessment call.
HashedAccountId string `json:"hashedAccountId,omitempty"`
// Name: Required. The resource name for this membership in the format
// `projects/{project}/relatedaccountgroups/{relatedaccountgroup}/members
// hips/{membership}`.
Name string `json:"name,omitempty"`
// ForceSendFields is a list of field names (e.g. "HashedAccountId") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "HashedAccountId") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudRecaptchaenterpriseV1RelatedAccountGroupMembership) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudRecaptchaenterpriseV1RelatedAccountGroupMembership
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudRecaptchaenterpriseV1RiskAnalysis: Risk analysis result
// for an event.
type GoogleCloudRecaptchaenterpriseV1RiskAnalysis struct {
// Reasons: Reasons contributing to the risk analysis verdict.
//
// Possible values:
// "CLASSIFICATION_REASON_UNSPECIFIED" - Default unspecified type.
// "AUTOMATION" - Interactions matched the behavior of an automated
// agent.
// "UNEXPECTED_ENVIRONMENT" - The event originated from an
// illegitimate environment.
// "TOO_MUCH_TRAFFIC" - Traffic volume from the event source is higher
// than normal.
// "UNEXPECTED_USAGE_PATTERNS" - Interactions with the site were
// significantly different than expected patterns.
// "LOW_CONFIDENCE_SCORE" - Too little traffic has been received from
// this site thus far to generate quality risk analysis.
Reasons []string `json:"reasons,omitempty"`
// Score: 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 float64 `json:"score,omitempty"`
// ForceSendFields is a list of field names (e.g. "Reasons") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Reasons") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudRecaptchaenterpriseV1RiskAnalysis) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudRecaptchaenterpriseV1RiskAnalysis
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
func (s *GoogleCloudRecaptchaenterpriseV1RiskAnalysis) UnmarshalJSON(data []byte) error {
type NoMethod GoogleCloudRecaptchaenterpriseV1RiskAnalysis
var s1 struct {
Score gensupport.JSONFloat64 `json:"score"`
*NoMethod
}
s1.NoMethod = (*NoMethod)(s)
if err := json.Unmarshal(data, &s1); err != nil {
return err
}
s.Score = float64(s1.Score)
return nil
}
// GoogleCloudRecaptchaenterpriseV1ScoreDistribution: Score
// distribution.
type GoogleCloudRecaptchaenterpriseV1ScoreDistribution struct {
// ScoreBuckets: 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 map[string]string `json:"scoreBuckets,omitempty"`
// ForceSendFields is a list of field names (e.g. "ScoreBuckets") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ScoreBuckets") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudRecaptchaenterpriseV1ScoreDistribution) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudRecaptchaenterpriseV1ScoreDistribution
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudRecaptchaenterpriseV1ScoreMetrics: Metrics related to
// scoring.
type GoogleCloudRecaptchaenterpriseV1ScoreMetrics struct {
// ActionMetrics: 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 map[string]GoogleCloudRecaptchaenterpriseV1ScoreDistribution `json:"actionMetrics,omitempty"`
// OverallMetrics: Aggregated score metrics for all traffic.
OverallMetrics *GoogleCloudRecaptchaenterpriseV1ScoreDistribution `json:"overallMetrics,omitempty"`
// ForceSendFields is a list of field names (e.g. "ActionMetrics") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ActionMetrics") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *GoogleCloudRecaptchaenterpriseV1ScoreMetrics) MarshalJSON() ([]byte, error) {
type NoMethod GoogleCloudRecaptchaenterpriseV1ScoreMetrics
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// GoogleCloudRecaptchaenterpriseV1SearchRelatedAccountGroupMembershipsRe
// quest: The request message to search related account group
// memberships.
type GoogleCloudRecaptchaenterpriseV1SearchRelatedAccountGroupMembershipsRequest struct {
// HashedAccountId: Optional. The unique stable hashed user identifier
// we should search connections to. The identifier should correspond to
// a `hashed_account_id` provided in a previous CreateAssessment or
// AnnotateAssessment call.
HashedAccountId string `json:"hashedAccountId,omitempty"`
// PageSize: Optional. The maximum number of groups to return. The
// service may return fewer than this value. If unspecified, at most 50
// groups will be returned. The maximum value is 1000; values above 1000
// will be coerced to 1000.