Skip to content

Commit dd84904

Browse files
feat: [recaptchaenterprise] add reCAPTCHA Enterprise Fraud Prevention API (#9241)
* feat: add reCAPTCHA Enterprise Fraud Prevention API This cl adds API features for Fraud Prevention including the FraudPreventionAssessment. PiperOrigin-RevId: 517166403 Source-Link: googleapis/googleapis@5947146 Source-Link: https://github.com/googleapis/googleapis-gen/commit/85b29f6a0328468b377531542633490c24f411d6 Copy-Tag: eyJwIjoiamF2YS1yZWNhcHRjaGFlbnRlcnByaXNlLy5Pd2xCb3QueWFtbCIsImgiOiI4NWIyOWY2YTAzMjg0NjhiMzc3NTMxNTQyNjMzNDkwYzI0ZjQxMWQ2In0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 8ea4ea3 commit dd84904

File tree

24 files changed

+16686
-381
lines changed

24 files changed

+16686
-381
lines changed

java-recaptchaenterprise/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ The client application making API calls must be granted [authorization scopes][a
5252
You will need a [Google Cloud Platform Console][developer-console] project with the reCAPTCHA Enterprise [API enabled][enable-api].
5353

5454
[Follow these instructions][create-project] to get your project set up. You will also need to set up the local development environment by
55-
[installing the Google Cloud SDK][cloud-sdk] and running the following commands in command line:
55+
[installing the Google Cloud Command Line Interface][cloud-cli] and running the following commands in command line:
5656
`gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`.
5757

5858
### Installation and setup
@@ -173,14 +173,14 @@ Java is a registered trademark of Oracle and/or its affiliates.
173173
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
174174
[stability-image]: https://img.shields.io/badge/stability-stable-green
175175
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-recaptchaenterprise.svg
176-
[maven-version-link]: https://search.maven.org/search?q=g:com.google.cloud%20AND%20a:google-cloud-recaptchaenterprise&core=gav
176+
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-recaptchaenterprise/3.9.0
177177
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
178178
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
179179
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
180180
[iam-policy]: https://cloud.google.com/iam/docs/overview#cloud-iam-policy
181181
[developer-console]: https://console.developers.google.com/
182182
[create-project]: https://cloud.google.com/resource-manager/docs/creating-managing-projects
183-
[cloud-sdk]: https://cloud.google.com/sdk/
183+
[cloud-cli]: https://cloud.google.com/cli
184184
[troubleshooting]: https://github.com/googleapis/google-cloud-common/blob/main/troubleshooting/readme.md#troubleshooting
185185
[contributing]: https://github.com/googleapis/google-cloud-java/blob/main/CONTRIBUTING.md
186186
[code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct

java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Client.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ public final AnnotateAssessmentResponse annotateAssessment(
407407
* .setName(AssessmentName.of("[PROJECT]", "[ASSESSMENT]").toString())
408408
* .addAllReasons(new ArrayList<AnnotateAssessmentRequest.Reason>())
409409
* .setHashedAccountId(ByteString.EMPTY)
410+
* .setTransactionEvent(TransactionEvent.newBuilder().build())
410411
* .build();
411412
* AnnotateAssessmentResponse response =
412413
* recaptchaEnterpriseServiceV1Beta1Client.annotateAssessment(request);
@@ -440,6 +441,7 @@ public final AnnotateAssessmentResponse annotateAssessment(AnnotateAssessmentReq
440441
* .setName(AssessmentName.of("[PROJECT]", "[ASSESSMENT]").toString())
441442
* .addAllReasons(new ArrayList<AnnotateAssessmentRequest.Reason>())
442443
* .setHashedAccountId(ByteString.EMPTY)
444+
* .setTransactionEvent(TransactionEvent.newBuilder().build())
443445
* .build();
444446
* ApiFuture<AnnotateAssessmentResponse> future =
445447
* recaptchaEnterpriseServiceV1Beta1Client.annotateAssessmentCallable().futureCall(request);

java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1ClientHttpJsonTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import com.google.recaptchaenterprise.v1beta1.Assessment;
3333
import com.google.recaptchaenterprise.v1beta1.AssessmentName;
3434
import com.google.recaptchaenterprise.v1beta1.Event;
35+
import com.google.recaptchaenterprise.v1beta1.FraudPreventionAssessment;
3536
import com.google.recaptchaenterprise.v1beta1.PasswordLeakVerification;
3637
import com.google.recaptchaenterprise.v1beta1.ProjectName;
3738
import com.google.recaptchaenterprise.v1beta1.TokenProperties;
@@ -92,6 +93,7 @@ public void createAssessmentTest() throws Exception {
9293
.addAllReasons(new ArrayList<Assessment.ClassificationReason>())
9394
.setPasswordLeakVerification(PasswordLeakVerification.newBuilder().build())
9495
.setAccountDefenderAssessment(AccountDefenderAssessment.newBuilder().build())
96+
.setFraudPreventionAssessment(FraudPreventionAssessment.newBuilder().build())
9597
.build();
9698
mockService.addResponse(expectedResponse);
9799

@@ -144,6 +146,7 @@ public void createAssessmentTest2() throws Exception {
144146
.addAllReasons(new ArrayList<Assessment.ClassificationReason>())
145147
.setPasswordLeakVerification(PasswordLeakVerification.newBuilder().build())
146148
.setAccountDefenderAssessment(AccountDefenderAssessment.newBuilder().build())
149+
.setFraudPreventionAssessment(FraudPreventionAssessment.newBuilder().build())
147150
.build();
148151
mockService.addResponse(expectedResponse);
149152

java-recaptchaenterprise/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1ClientTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import com.google.recaptchaenterprise.v1beta1.AssessmentName;
3232
import com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest;
3333
import com.google.recaptchaenterprise.v1beta1.Event;
34+
import com.google.recaptchaenterprise.v1beta1.FraudPreventionAssessment;
3435
import com.google.recaptchaenterprise.v1beta1.PasswordLeakVerification;
3536
import com.google.recaptchaenterprise.v1beta1.ProjectName;
3637
import com.google.recaptchaenterprise.v1beta1.TokenProperties;
@@ -98,6 +99,7 @@ public void createAssessmentTest() throws Exception {
9899
.addAllReasons(new ArrayList<Assessment.ClassificationReason>())
99100
.setPasswordLeakVerification(PasswordLeakVerification.newBuilder().build())
100101
.setAccountDefenderAssessment(AccountDefenderAssessment.newBuilder().build())
102+
.setFraudPreventionAssessment(FraudPreventionAssessment.newBuilder().build())
101103
.build();
102104
mockRecaptchaEnterpriseServiceV1Beta1.addResponse(expectedResponse);
103105

@@ -145,6 +147,7 @@ public void createAssessmentTest2() throws Exception {
145147
.addAllReasons(new ArrayList<Assessment.ClassificationReason>())
146148
.setPasswordLeakVerification(PasswordLeakVerification.newBuilder().build())
147149
.setAccountDefenderAssessment(AccountDefenderAssessment.newBuilder().build())
150+
.setFraudPreventionAssessment(FraudPreventionAssessment.newBuilder().build())
148151
.build();
149152
mockRecaptchaEnterpriseServiceV1Beta1.addResponse(expectedResponse);
150153

java-recaptchaenterprise/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AccountDefenderAssessment.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
*
2323
*
2424
* <pre>
25-
* Account Defender risk assessment.
25+
* Account defender risk assessment.
2626
* </pre>
2727
*
2828
* Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment}
@@ -71,7 +71,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
7171
*
7272
*
7373
* <pre>
74-
* Labels returned by Account Defender for this request.
74+
* Labels returned by account defender for this request.
7575
* </pre>
7676
*
7777
* Protobuf enum {@code
@@ -584,7 +584,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
584584
*
585585
*
586586
* <pre>
587-
* Account Defender risk assessment.
587+
* Account defender risk assessment.
588588
* </pre>
589589
*
590590
* Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.AccountDefenderAssessment}

0 commit comments

Comments
 (0)