From d2422d6592341fbd585eed7d655f67696db233f7 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Fri, 26 Apr 2019 12:04:21 -0700 Subject: [PATCH 1/3] Add reCAPTCHA Enterprise client --- .../pom.xml | 53 + ...RecaptchaEnterpriseServiceV1Beta1Grpc.java | 511 +++++ google-api-grpc/pom.xml | 12 + .../pom.xml | 36 + .../v1beta1/AnnotateAssessmentRequest.java | 919 +++++++++ .../AnnotateAssessmentRequestOrBuilder.java | 58 + .../v1beta1/AnnotateAssessmentResponse.java | 445 ++++ .../AnnotateAssessmentResponseOrBuilder.java | 9 + .../v1beta1/Assessment.java | 1823 +++++++++++++++++ .../v1beta1/AssessmentName.java | 180 ++ .../v1beta1/AssessmentOrBuilder.java | 170 ++ .../v1beta1/CreateAssessmentRequest.java | 880 ++++++++ .../CreateAssessmentRequestOrBuilder.java | 64 + .../recaptchaenterprise/v1beta1/Event.java | 755 +++++++ .../v1beta1/EventOrBuilder.java | 56 + .../v1beta1/ProjectName.java | 160 ++ .../v1beta1/RecaptchaEnterpriseProto.java | 174 ++ .../v1beta1/TokenProperties.java | 1481 +++++++++++++ .../v1beta1/TokenPropertiesOrBuilder.java | 119 ++ .../v1beta1/recaptchaenterprise.proto | 183 ++ google-cloud-bom/pom.xml | 15 + .../README.md | 100 + .../google-cloud-recaptchaenterprise/pom.xml | 113 + ...captchaEnterpriseServiceV1Beta1Client.java | 404 ++++ ...ptchaEnterpriseServiceV1Beta1Settings.java | 196 ++ .../v1beta1/package-info.java | 39 + ...terpriseServiceV1Beta1CallableFactory.java | 116 ++ ...RecaptchaEnterpriseServiceV1Beta1Stub.java | 199 ++ ...RecaptchaEnterpriseServiceV1Beta1Stub.java | 48 + ...aEnterpriseServiceV1Beta1StubSettings.java | 300 +++ ...MockRecaptchaEnterpriseServiceV1Beta1.java | 57 + ...RecaptchaEnterpriseServiceV1Beta1Impl.java | 94 + ...chaEnterpriseServiceV1Beta1ClientTest.java | 167 ++ .../google-cloud-recaptchaenterprise/synth.py | 41 + google-cloud-clients/pom.xml | 3 +- versions.txt | 3 + 36 files changed, 9982 insertions(+), 1 deletion(-) create mode 100644 google-api-grpc/grpc-google-cloud-recaptchaenterprise-v1beta1/pom.xml create mode 100644 google-api-grpc/grpc-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Grpc.java create mode 100644 google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/pom.xml create mode 100644 google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AnnotateAssessmentRequest.java create mode 100644 google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AnnotateAssessmentRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AnnotateAssessmentResponse.java create mode 100644 google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AnnotateAssessmentResponseOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/Assessment.java create mode 100644 google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AssessmentName.java create mode 100644 google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AssessmentOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/CreateAssessmentRequest.java create mode 100644 google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/CreateAssessmentRequestOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/Event.java create mode 100644 google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/EventOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/ProjectName.java create mode 100644 google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/RecaptchaEnterpriseProto.java create mode 100644 google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/TokenProperties.java create mode 100644 google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/TokenPropertiesOrBuilder.java create mode 100644 google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/proto/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto create mode 100644 google-cloud-clients/google-cloud-recaptchaenterprise/README.md create mode 100644 google-cloud-clients/google-cloud-recaptchaenterprise/pom.xml create mode 100644 google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Client.java create mode 100644 google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Settings.java create mode 100644 google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/package-info.java create mode 100644 google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/GrpcRecaptchaEnterpriseServiceV1Beta1CallableFactory.java create mode 100644 google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/GrpcRecaptchaEnterpriseServiceV1Beta1Stub.java create mode 100644 google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/RecaptchaEnterpriseServiceV1Beta1Stub.java create mode 100644 google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/RecaptchaEnterpriseServiceV1Beta1StubSettings.java create mode 100644 google-cloud-clients/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1beta1/MockRecaptchaEnterpriseServiceV1Beta1.java create mode 100644 google-cloud-clients/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1beta1/MockRecaptchaEnterpriseServiceV1Beta1Impl.java create mode 100644 google-cloud-clients/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1ClientTest.java create mode 100644 google-cloud-clients/google-cloud-recaptchaenterprise/synth.py diff --git a/google-api-grpc/grpc-google-cloud-recaptchaenterprise-v1beta1/pom.xml b/google-api-grpc/grpc-google-cloud-recaptchaenterprise-v1beta1/pom.xml new file mode 100644 index 000000000000..9e16b66f2a44 --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-recaptchaenterprise-v1beta1/pom.xml @@ -0,0 +1,53 @@ + + 4.0.0 + grpc-google-cloud-recaptchaenterprise-v1beta1 + 0.0.1-SNAPSHOT + grpc-google-cloud-recaptchaenterprise-v1beta1 + GRPC library for grpc-google-cloud-recaptchaenterprise-v1beta1 + + com.google.api.grpc + google-api-grpc + 0.0.1-SNAPSHOT + + + + io.grpc + grpc-stub + compile + + + io.grpc + grpc-protobuf + compile + + + com.google.api.grpc + proto-google-cloud-recaptchaenterprise-v1beta1 + compile + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.0 + + protected + true + none + true + + + ${project.javadoc.protobufBaseURL} + ../../../../proto-google-cloud-recaptchaenterprise-v1beta1/target/site/apidocs/ + + + + + + + \ No newline at end of file diff --git a/google-api-grpc/grpc-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Grpc.java b/google-api-grpc/grpc-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Grpc.java new file mode 100644 index 000000000000..8a779d9dbaee --- /dev/null +++ b/google-api-grpc/grpc-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Grpc.java @@ -0,0 +1,511 @@ +package com.google.recaptchaenterprise.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + * + * + *
+ * Service to determine the likelihood an event is legitimate.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.10.0)", + comments = "Source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto") +public final class RecaptchaEnterpriseServiceV1Beta1Grpc { + + private RecaptchaEnterpriseServiceV1Beta1Grpc() {} + + public static final String SERVICE_NAME = + "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1"; + + // Static method descriptors that strictly reflect the proto. + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateAssessmentMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest, + com.google.recaptchaenterprise.v1beta1.Assessment> + METHOD_CREATE_ASSESSMENT = getCreateAssessmentMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest, + com.google.recaptchaenterprise.v1beta1.Assessment> + getCreateAssessmentMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest, + com.google.recaptchaenterprise.v1beta1.Assessment> + getCreateAssessmentMethod() { + return getCreateAssessmentMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest, + com.google.recaptchaenterprise.v1beta1.Assessment> + getCreateAssessmentMethodHelper() { + io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest, + com.google.recaptchaenterprise.v1beta1.Assessment> + getCreateAssessmentMethod; + if ((getCreateAssessmentMethod = + RecaptchaEnterpriseServiceV1Beta1Grpc.getCreateAssessmentMethod) + == null) { + synchronized (RecaptchaEnterpriseServiceV1Beta1Grpc.class) { + if ((getCreateAssessmentMethod = + RecaptchaEnterpriseServiceV1Beta1Grpc.getCreateAssessmentMethod) + == null) { + RecaptchaEnterpriseServiceV1Beta1Grpc.getCreateAssessmentMethod = + getCreateAssessmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1", + "CreateAssessment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.recaptchaenterprise.v1beta1.Assessment + .getDefaultInstance())) + .setSchemaDescriptor( + new RecaptchaEnterpriseServiceV1Beta1MethodDescriptorSupplier( + "CreateAssessment")) + .build(); + } + } + } + return getCreateAssessmentMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getAnnotateAssessmentMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest, + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse> + METHOD_ANNOTATE_ASSESSMENT = getAnnotateAssessmentMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest, + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse> + getAnnotateAssessmentMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest, + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse> + getAnnotateAssessmentMethod() { + return getAnnotateAssessmentMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest, + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse> + getAnnotateAssessmentMethodHelper() { + io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest, + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse> + getAnnotateAssessmentMethod; + if ((getAnnotateAssessmentMethod = + RecaptchaEnterpriseServiceV1Beta1Grpc.getAnnotateAssessmentMethod) + == null) { + synchronized (RecaptchaEnterpriseServiceV1Beta1Grpc.class) { + if ((getAnnotateAssessmentMethod = + RecaptchaEnterpriseServiceV1Beta1Grpc.getAnnotateAssessmentMethod) + == null) { + RecaptchaEnterpriseServiceV1Beta1Grpc.getAnnotateAssessmentMethod = + getAnnotateAssessmentMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1", + "AnnotateAssessment")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new RecaptchaEnterpriseServiceV1Beta1MethodDescriptorSupplier( + "AnnotateAssessment")) + .build(); + } + } + } + return getAnnotateAssessmentMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static RecaptchaEnterpriseServiceV1Beta1Stub newStub(io.grpc.Channel channel) { + return new RecaptchaEnterpriseServiceV1Beta1Stub(channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static RecaptchaEnterpriseServiceV1Beta1BlockingStub newBlockingStub( + io.grpc.Channel channel) { + return new RecaptchaEnterpriseServiceV1Beta1BlockingStub(channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static RecaptchaEnterpriseServiceV1Beta1FutureStub newFutureStub(io.grpc.Channel channel) { + return new RecaptchaEnterpriseServiceV1Beta1FutureStub(channel); + } + + /** + * + * + *
+   * Service to determine the likelihood an event is legitimate.
+   * 
+ */ + public abstract static class RecaptchaEnterpriseServiceV1Beta1ImplBase + implements io.grpc.BindableService { + + /** + * + * + *
+     * Creates an Assessment of the likelihood an event is legitimate.
+     * 
+ */ + public void createAssessment( + com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getCreateAssessmentMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Annotates a previously created Assessment to provide additional information
+     * on whether the event turned out to be authentic or fradulent.
+     * 
+ */ + public void annotateAssessment( + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest request, + io.grpc.stub.StreamObserver< + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse> + responseObserver) { + asyncUnimplementedUnaryCall(getAnnotateAssessmentMethodHelper(), responseObserver); + } + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getCreateAssessmentMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest, + com.google.recaptchaenterprise.v1beta1.Assessment>( + this, METHODID_CREATE_ASSESSMENT))) + .addMethod( + getAnnotateAssessmentMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest, + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse>( + this, METHODID_ANNOTATE_ASSESSMENT))) + .build(); + } + } + + /** + * + * + *
+   * Service to determine the likelihood an event is legitimate.
+   * 
+ */ + public static final class RecaptchaEnterpriseServiceV1Beta1Stub + extends io.grpc.stub.AbstractStub { + private RecaptchaEnterpriseServiceV1Beta1Stub(io.grpc.Channel channel) { + super(channel); + } + + private RecaptchaEnterpriseServiceV1Beta1Stub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RecaptchaEnterpriseServiceV1Beta1Stub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RecaptchaEnterpriseServiceV1Beta1Stub(channel, callOptions); + } + + /** + * + * + *
+     * Creates an Assessment of the likelihood an event is legitimate.
+     * 
+ */ + public void createAssessment( + com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateAssessmentMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Annotates a previously created Assessment to provide additional information
+     * on whether the event turned out to be authentic or fradulent.
+     * 
+ */ + public void annotateAssessment( + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest request, + io.grpc.stub.StreamObserver< + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse> + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getAnnotateAssessmentMethodHelper(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * + * + *
+   * Service to determine the likelihood an event is legitimate.
+   * 
+ */ + public static final class RecaptchaEnterpriseServiceV1Beta1BlockingStub + extends io.grpc.stub.AbstractStub { + private RecaptchaEnterpriseServiceV1Beta1BlockingStub(io.grpc.Channel channel) { + super(channel); + } + + private RecaptchaEnterpriseServiceV1Beta1BlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RecaptchaEnterpriseServiceV1Beta1BlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RecaptchaEnterpriseServiceV1Beta1BlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates an Assessment of the likelihood an event is legitimate.
+     * 
+ */ + public com.google.recaptchaenterprise.v1beta1.Assessment createAssessment( + com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest request) { + return blockingUnaryCall( + getChannel(), getCreateAssessmentMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Annotates a previously created Assessment to provide additional information
+     * on whether the event turned out to be authentic or fradulent.
+     * 
+ */ + public com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse annotateAssessment( + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest request) { + return blockingUnaryCall( + getChannel(), getAnnotateAssessmentMethodHelper(), getCallOptions(), request); + } + } + + /** + * + * + *
+   * Service to determine the likelihood an event is legitimate.
+   * 
+ */ + public static final class RecaptchaEnterpriseServiceV1Beta1FutureStub + extends io.grpc.stub.AbstractStub { + private RecaptchaEnterpriseServiceV1Beta1FutureStub(io.grpc.Channel channel) { + super(channel); + } + + private RecaptchaEnterpriseServiceV1Beta1FutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RecaptchaEnterpriseServiceV1Beta1FutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RecaptchaEnterpriseServiceV1Beta1FutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Creates an Assessment of the likelihood an event is legitimate.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.recaptchaenterprise.v1beta1.Assessment> + createAssessment(com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateAssessmentMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Annotates a previously created Assessment to provide additional information
+     * on whether the event turned out to be authentic or fradulent.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse> + annotateAssessment( + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest request) { + return futureUnaryCall( + getChannel().newCall(getAnnotateAssessmentMethodHelper(), getCallOptions()), request); + } + } + + private static final int METHODID_CREATE_ASSESSMENT = 0; + private static final int METHODID_ANNOTATE_ASSESSMENT = 1; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final RecaptchaEnterpriseServiceV1Beta1ImplBase serviceImpl; + private final int methodId; + + MethodHandlers(RecaptchaEnterpriseServiceV1Beta1ImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_CREATE_ASSESSMENT: + serviceImpl.createAssessment( + (com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_ANNOTATE_ASSESSMENT: + serviceImpl.annotateAssessment( + (com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest) request, + (io.grpc.stub.StreamObserver< + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse>) + responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private abstract static class RecaptchaEnterpriseServiceV1Beta1BaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + RecaptchaEnterpriseServiceV1Beta1BaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("RecaptchaEnterpriseServiceV1Beta1"); + } + } + + private static final class RecaptchaEnterpriseServiceV1Beta1FileDescriptorSupplier + extends RecaptchaEnterpriseServiceV1Beta1BaseDescriptorSupplier { + RecaptchaEnterpriseServiceV1Beta1FileDescriptorSupplier() {} + } + + private static final class RecaptchaEnterpriseServiceV1Beta1MethodDescriptorSupplier + extends RecaptchaEnterpriseServiceV1Beta1BaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + RecaptchaEnterpriseServiceV1Beta1MethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (RecaptchaEnterpriseServiceV1Beta1Grpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor( + new RecaptchaEnterpriseServiceV1Beta1FileDescriptorSupplier()) + .addMethod(getCreateAssessmentMethodHelper()) + .addMethod(getAnnotateAssessmentMethodHelper()) + .build(); + } + } + } + return result; + } +} diff --git a/google-api-grpc/pom.xml b/google-api-grpc/pom.xml index 7fd2084f6dd7..b2404b3bacaa 100644 --- a/google-api-grpc/pom.xml +++ b/google-api-grpc/pom.xml @@ -775,6 +775,16 @@ grpc-google-cloud-webrisk-v1beta1 0.4.1-alpha-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-recaptchaenterprise-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-recaptchaenterprise-v1beta1 + 0.0.1-SNAPSHOT + @@ -808,6 +818,7 @@ grpc-google-cloud-monitoring-v3 grpc-google-cloud-os-login-v1 grpc-google-cloud-pubsub-v1 + grpc-google-cloud-recaptchaenterprise-v1beta1 grpc-google-cloud-redis-v1beta1 grpc-google-cloud-redis-v1 grpc-google-cloud-scheduler-v1beta1 @@ -873,6 +884,7 @@ proto-google-cloud-monitoring-v3 proto-google-cloud-os-login-v1 proto-google-cloud-pubsub-v1 + proto-google-cloud-recaptchaenterprise-v1beta1 proto-google-cloud-redis-v1beta1 proto-google-cloud-redis-v1 proto-google-cloud-scheduler-v1beta1 diff --git a/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/pom.xml b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/pom.xml new file mode 100644 index 000000000000..d29658b4cdc9 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/pom.xml @@ -0,0 +1,36 @@ + + 4.0.0 + proto-google-cloud-recaptchaenterprise-v1beta1 + 0.0.1-SNAPSHOT + proto-google-cloud-recaptchaenterprise-v1beta1 + PROTO library for proto-google-cloud-recaptchaenterprise-v1beta1 + + com.google.api.grpc + google-api-grpc + 0.0.1-SNAPSHOT + + + + com.google.protobuf + protobuf-java + compile + + + com.google.api + api-common + compile + + + com.google.api.grpc + proto-google-common-protos + compile + + + com.google.api.grpc + proto-google-iam-v1 + compile + + + \ No newline at end of file diff --git a/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AnnotateAssessmentRequest.java b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AnnotateAssessmentRequest.java new file mode 100644 index 000000000000..359fbfa467e5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AnnotateAssessmentRequest.java @@ -0,0 +1,919 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +/** + * + * + *
+ * The request message to annotate an Assessment.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest} + */ +public final class AnnotateAssessmentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest) + AnnotateAssessmentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use AnnotateAssessmentRequest.newBuilder() to construct. + private AnnotateAssessmentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AnnotateAssessmentRequest() { + name_ = ""; + annotation_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AnnotateAssessmentRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 16: + { + int rawValue = input.readEnum(); + + annotation_ = rawValue; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_AnnotateAssessmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_AnnotateAssessmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.class, + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Builder.class); + } + + /** + * + * + *
+   * Enum that reprensents the types of annotations.
+   * 
+ * + * Protobuf enum {@code + * google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation} + */ + public enum Annotation implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default unspecified type.
+     * 
+ * + * ANNOTATION_UNSPECIFIED = 0; + */ + ANNOTATION_UNSPECIFIED(0), + /** + * + * + *
+     * Provides information that the event turned out to be legitimate.
+     * 
+ * + * LEGITIMATE = 1; + */ + LEGITIMATE(1), + /** + * + * + *
+     * Provides information that the event turned out to be fraudulent.
+     * 
+ * + * FRAUDULENT = 2; + */ + FRAUDULENT(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default unspecified type.
+     * 
+ * + * ANNOTATION_UNSPECIFIED = 0; + */ + public static final int ANNOTATION_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Provides information that the event turned out to be legitimate.
+     * 
+ * + * LEGITIMATE = 1; + */ + public static final int LEGITIMATE_VALUE = 1; + /** + * + * + *
+     * Provides information that the event turned out to be fraudulent.
+     * 
+ * + * FRAUDULENT = 2; + */ + public static final int FRAUDULENT_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static Annotation valueOf(int value) { + return forNumber(value); + } + + public static Annotation forNumber(int value) { + switch (value) { + case 0: + return ANNOTATION_UNSPECIFIED; + case 1: + return LEGITIMATE; + case 2: + return FRAUDULENT; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Annotation findValueByNumber(int number) { + return Annotation.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final Annotation[] VALUES = values(); + + public static Annotation valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Annotation(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation) + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The resource name of the Assessment, in the format
+   * "projects/{project_number}/assessments/{assessment_id}".
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The resource name of the Assessment, in the format
+   * "projects/{project_number}/assessments/{assessment_id}".
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ANNOTATION_FIELD_NUMBER = 2; + private int annotation_; + /** + * + * + *
+   * The annotation that will be assigned to the Event.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2; + * + */ + public int getAnnotationValue() { + return annotation_; + } + /** + * + * + *
+   * The annotation that will be assigned to the Event.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2; + * + */ + public com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation + getAnnotation() { + @SuppressWarnings("deprecation") + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation result = + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation.valueOf( + annotation_); + return result == null + ? com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (annotation_ + != com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation + .ANNOTATION_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, annotation_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (annotation_ + != com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation + .ANNOTATION_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, annotation_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest other = + (com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest) obj; + + if (!getName().equals(other.getName())) return false; + if (annotation_ != other.annotation_) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + ANNOTATION_FIELD_NUMBER; + hash = (53 * hash) + annotation_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The request message to annotate an Assessment.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest) + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_AnnotateAssessmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_AnnotateAssessmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.class, + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + annotation_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_AnnotateAssessmentRequest_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest + getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest build() { + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest buildPartial() { + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest result = + new com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest(this); + result.name_ = name_; + result.annotation_ = annotation_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest) { + return mergeFrom((com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest other) { + if (other + == com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.annotation_ != 0) { + setAnnotationValue(other.getAnnotationValue()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The resource name of the Assessment, in the format
+     * "projects/{project_number}/assessments/{assessment_id}".
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Assessment, in the format
+     * "projects/{project_number}/assessments/{assessment_id}".
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The resource name of the Assessment, in the format
+     * "projects/{project_number}/assessments/{assessment_id}".
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Assessment, in the format
+     * "projects/{project_number}/assessments/{assessment_id}".
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The resource name of the Assessment, in the format
+     * "projects/{project_number}/assessments/{assessment_id}".
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private int annotation_ = 0; + /** + * + * + *
+     * The annotation that will be assigned to the Event.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2; + * + */ + public int getAnnotationValue() { + return annotation_; + } + /** + * + * + *
+     * The annotation that will be assigned to the Event.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2; + * + */ + public Builder setAnnotationValue(int value) { + annotation_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The annotation that will be assigned to the Event.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2; + * + */ + public com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation + getAnnotation() { + @SuppressWarnings("deprecation") + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation result = + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation.valueOf( + annotation_); + return result == null + ? com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * The annotation that will be assigned to the Event.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2; + * + */ + public Builder setAnnotation( + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation value) { + if (value == null) { + throw new NullPointerException(); + } + + annotation_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * The annotation that will be assigned to the Event.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2; + * + */ + public Builder clearAnnotation() { + + annotation_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest) + private static final com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest(); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AnnotateAssessmentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AnnotateAssessmentRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AnnotateAssessmentRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AnnotateAssessmentRequestOrBuilder.java new file mode 100644 index 000000000000..319f60339ccf --- /dev/null +++ b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AnnotateAssessmentRequestOrBuilder.java @@ -0,0 +1,58 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +public interface AnnotateAssessmentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the Assessment, in the format
+   * "projects/{project_number}/assessments/{assessment_id}".
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The resource name of the Assessment, in the format
+   * "projects/{project_number}/assessments/{assessment_id}".
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The annotation that will be assigned to the Event.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2; + * + */ + int getAnnotationValue(); + /** + * + * + *
+   * The annotation that will be assigned to the Event.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation annotation = 2; + * + */ + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest.Annotation getAnnotation(); +} diff --git a/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AnnotateAssessmentResponse.java b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AnnotateAssessmentResponse.java new file mode 100644 index 000000000000..0dcf90dd90e6 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AnnotateAssessmentResponse.java @@ -0,0 +1,445 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +/** + * + * + *
+ * Empty response for AnnotateAssessment.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse} + */ +public final class AnnotateAssessmentResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse) + AnnotateAssessmentResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use AnnotateAssessmentResponse.newBuilder() to construct. + private AnnotateAssessmentResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AnnotateAssessmentResponse() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AnnotateAssessmentResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_AnnotateAssessmentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_AnnotateAssessmentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse.class, + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse.Builder.class); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse other = + (com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse) obj; + + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Empty response for AnnotateAssessment.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse) + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_AnnotateAssessmentResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_AnnotateAssessmentResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse.class, + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse.Builder.class); + } + + // Construct using + // com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_AnnotateAssessmentResponse_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse build() { + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse buildPartial() { + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse result = + new com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse(this); + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse) { + return mergeFrom((com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse other) { + if (other + == com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse.getDefaultInstance()) + return this; + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse) + private static final com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse(); + } + + public static com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AnnotateAssessmentResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AnnotateAssessmentResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AnnotateAssessmentResponseOrBuilder.java b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AnnotateAssessmentResponseOrBuilder.java new file mode 100644 index 000000000000..70566040ebdb --- /dev/null +++ b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AnnotateAssessmentResponseOrBuilder.java @@ -0,0 +1,9 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +public interface AnnotateAssessmentResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse) + com.google.protobuf.MessageOrBuilder {} diff --git a/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/Assessment.java b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/Assessment.java new file mode 100644 index 000000000000..e36be5f67859 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/Assessment.java @@ -0,0 +1,1823 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +/** + * + * + *
+ * A recaptcha assessment resource.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.Assessment} + */ +public final class Assessment extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1beta1.Assessment) + AssessmentOrBuilder { + private static final long serialVersionUID = 0L; + // Use Assessment.newBuilder() to construct. + private Assessment(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Assessment() { + name_ = ""; + reasons_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Assessment( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: + { + com.google.recaptchaenterprise.v1beta1.Event.Builder subBuilder = null; + if (event_ != null) { + subBuilder = event_.toBuilder(); + } + event_ = + input.readMessage( + com.google.recaptchaenterprise.v1beta1.Event.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(event_); + event_ = subBuilder.buildPartial(); + } + + break; + } + case 29: + { + score_ = input.readFloat(); + break; + } + case 34: + { + com.google.recaptchaenterprise.v1beta1.TokenProperties.Builder subBuilder = null; + if (tokenProperties_ != null) { + subBuilder = tokenProperties_.toBuilder(); + } + tokenProperties_ = + input.readMessage( + com.google.recaptchaenterprise.v1beta1.TokenProperties.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(tokenProperties_); + tokenProperties_ = subBuilder.buildPartial(); + } + + break; + } + case 40: + { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000010) != 0)) { + reasons_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + reasons_.add(rawValue); + break; + } + case 42: + { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int rawValue = input.readEnum(); + if (!((mutable_bitField0_ & 0x00000010) != 0)) { + reasons_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000010; + } + reasons_.add(rawValue); + } + input.popLimit(oldLimit); + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000010) != 0)) { + reasons_ = java.util.Collections.unmodifiableList(reasons_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_Assessment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_Assessment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.Assessment.class, + com.google.recaptchaenterprise.v1beta1.Assessment.Builder.class); + } + + /** + * + * + *
+   * LINT.IfChange(classification_reason)
+   * Reasons contributing to the risk analysis verdict.
+   * 
+ * + * Protobuf enum {@code google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason} + */ + public enum ClassificationReason implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default unspecified type.
+     * 
+ * + * CLASSIFICATION_REASON_UNSPECIFIED = 0; + */ + CLASSIFICATION_REASON_UNSPECIFIED(0), + /** + * + * + *
+     * The event appeared to be automated.
+     * 
+ * + * AUTOMATION = 1; + */ + AUTOMATION(1), + /** + * + * + *
+     * The event was not made from the proper context on the real site.
+     * 
+ * + * UNEXPECTED_ENVIRONMENT = 2; + */ + UNEXPECTED_ENVIRONMENT(2), + /** + * + * + *
+     * Browsing behavior leading up to the event was generated was out of the
+     * ordinary.
+     * 
+ * + * UNEXPECTED_USAGE_PATTERNS = 4; + */ + UNEXPECTED_USAGE_PATTERNS(4), + /** + * + * + *
+     * Too little traffic has been received from this site thus far to generate
+     * quality risk analysis.
+     * 
+ * + * PROVISIONAL_RISK_ANALYSIS = 5; + */ + PROVISIONAL_RISK_ANALYSIS(5), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default unspecified type.
+     * 
+ * + * CLASSIFICATION_REASON_UNSPECIFIED = 0; + */ + public static final int CLASSIFICATION_REASON_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * The event appeared to be automated.
+     * 
+ * + * AUTOMATION = 1; + */ + public static final int AUTOMATION_VALUE = 1; + /** + * + * + *
+     * The event was not made from the proper context on the real site.
+     * 
+ * + * UNEXPECTED_ENVIRONMENT = 2; + */ + public static final int UNEXPECTED_ENVIRONMENT_VALUE = 2; + /** + * + * + *
+     * Browsing behavior leading up to the event was generated was out of the
+     * ordinary.
+     * 
+ * + * UNEXPECTED_USAGE_PATTERNS = 4; + */ + public static final int UNEXPECTED_USAGE_PATTERNS_VALUE = 4; + /** + * + * + *
+     * Too little traffic has been received from this site thus far to generate
+     * quality risk analysis.
+     * 
+ * + * PROVISIONAL_RISK_ANALYSIS = 5; + */ + public static final int PROVISIONAL_RISK_ANALYSIS_VALUE = 5; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static ClassificationReason valueOf(int value) { + return forNumber(value); + } + + public static ClassificationReason forNumber(int value) { + switch (value) { + case 0: + return CLASSIFICATION_REASON_UNSPECIFIED; + case 1: + return AUTOMATION; + case 2: + return UNEXPECTED_ENVIRONMENT; + case 4: + return UNEXPECTED_USAGE_PATTERNS; + case 5: + return PROVISIONAL_RISK_ANALYSIS; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ClassificationReason findValueByNumber(int number) { + return ClassificationReason.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.Assessment.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ClassificationReason[] VALUES = values(); + + public static ClassificationReason valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ClassificationReason(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason) + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Output only. The resource name for the Assessment in the format
+   * "projects/{project_number}/assessments/{assessment_id}".
+   * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The resource name for the Assessment in the format
+   * "projects/{project_number}/assessments/{assessment_id}".
+   * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EVENT_FIELD_NUMBER = 2; + private com.google.recaptchaenterprise.v1beta1.Event event_; + /** + * + * + *
+   * The event being assessed.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Event event = 2; + */ + public boolean hasEvent() { + return event_ != null; + } + /** + * + * + *
+   * The event being assessed.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Event event = 2; + */ + public com.google.recaptchaenterprise.v1beta1.Event getEvent() { + return event_ == null + ? com.google.recaptchaenterprise.v1beta1.Event.getDefaultInstance() + : event_; + } + /** + * + * + *
+   * The event being assessed.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Event event = 2; + */ + public com.google.recaptchaenterprise.v1beta1.EventOrBuilder getEventOrBuilder() { + return getEvent(); + } + + public static final int SCORE_FIELD_NUMBER = 3; + private float score_; + /** + * + * + *
+   * Output only. 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).
+   * 
+ * + * float score = 3; + */ + public float getScore() { + return score_; + } + + public static final int TOKEN_PROPERTIES_FIELD_NUMBER = 4; + private com.google.recaptchaenterprise.v1beta1.TokenProperties tokenProperties_; + /** + * + * + *
+   * Output only. Properties of the provided event token.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties token_properties = 4; + */ + public boolean hasTokenProperties() { + return tokenProperties_ != null; + } + /** + * + * + *
+   * Output only. Properties of the provided event token.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties token_properties = 4; + */ + public com.google.recaptchaenterprise.v1beta1.TokenProperties getTokenProperties() { + return tokenProperties_ == null + ? com.google.recaptchaenterprise.v1beta1.TokenProperties.getDefaultInstance() + : tokenProperties_; + } + /** + * + * + *
+   * Output only. Properties of the provided event token.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties token_properties = 4; + */ + public com.google.recaptchaenterprise.v1beta1.TokenPropertiesOrBuilder + getTokenPropertiesOrBuilder() { + return getTokenProperties(); + } + + public static final int REASONS_FIELD_NUMBER = 5; + private java.util.List reasons_; + private static final com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, com.google.recaptchaenterprise.v1beta1.Assessment.ClassificationReason> + reasons_converter_ = + new com.google.protobuf.Internal.ListAdapter.Converter< + java.lang.Integer, + com.google.recaptchaenterprise.v1beta1.Assessment.ClassificationReason>() { + public com.google.recaptchaenterprise.v1beta1.Assessment.ClassificationReason convert( + java.lang.Integer from) { + @SuppressWarnings("deprecation") + com.google.recaptchaenterprise.v1beta1.Assessment.ClassificationReason result = + com.google.recaptchaenterprise.v1beta1.Assessment.ClassificationReason.valueOf( + from); + return result == null + ? com.google.recaptchaenterprise.v1beta1.Assessment.ClassificationReason + .UNRECOGNIZED + : result; + } + }; + /** + * + * + *
+   * Output only. Reasons contributing to the risk analysis verdict.
+   * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + public java.util.List + getReasonsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, com.google.recaptchaenterprise.v1beta1.Assessment.ClassificationReason>( + reasons_, reasons_converter_); + } + /** + * + * + *
+   * Output only. Reasons contributing to the risk analysis verdict.
+   * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + public int getReasonsCount() { + return reasons_.size(); + } + /** + * + * + *
+   * Output only. Reasons contributing to the risk analysis verdict.
+   * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + public com.google.recaptchaenterprise.v1beta1.Assessment.ClassificationReason getReasons( + int index) { + return reasons_converter_.convert(reasons_.get(index)); + } + /** + * + * + *
+   * Output only. Reasons contributing to the risk analysis verdict.
+   * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + public java.util.List getReasonsValueList() { + return reasons_; + } + /** + * + * + *
+   * Output only. Reasons contributing to the risk analysis verdict.
+   * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + public int getReasonsValue(int index) { + return reasons_.get(index); + } + + private int reasonsMemoizedSerializedSize; + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + getSerializedSize(); + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (event_ != null) { + output.writeMessage(2, getEvent()); + } + if (score_ != 0F) { + output.writeFloat(3, score_); + } + if (tokenProperties_ != null) { + output.writeMessage(4, getTokenProperties()); + } + if (getReasonsList().size() > 0) { + output.writeUInt32NoTag(42); + output.writeUInt32NoTag(reasonsMemoizedSerializedSize); + } + for (int i = 0; i < reasons_.size(); i++) { + output.writeEnumNoTag(reasons_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (event_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getEvent()); + } + if (score_ != 0F) { + size += com.google.protobuf.CodedOutputStream.computeFloatSize(3, score_); + } + if (tokenProperties_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, getTokenProperties()); + } + { + int dataSize = 0; + for (int i = 0; i < reasons_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(reasons_.get(i)); + } + size += dataSize; + if (!getReasonsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); + } + reasonsMemoizedSerializedSize = dataSize; + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.recaptchaenterprise.v1beta1.Assessment)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1beta1.Assessment other = + (com.google.recaptchaenterprise.v1beta1.Assessment) obj; + + if (!getName().equals(other.getName())) return false; + if (hasEvent() != other.hasEvent()) return false; + if (hasEvent()) { + if (!getEvent().equals(other.getEvent())) return false; + } + if (java.lang.Float.floatToIntBits(getScore()) + != java.lang.Float.floatToIntBits(other.getScore())) return false; + if (hasTokenProperties() != other.hasTokenProperties()) return false; + if (hasTokenProperties()) { + if (!getTokenProperties().equals(other.getTokenProperties())) return false; + } + if (!reasons_.equals(other.reasons_)) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasEvent()) { + hash = (37 * hash) + EVENT_FIELD_NUMBER; + hash = (53 * hash) + getEvent().hashCode(); + } + hash = (37 * hash) + SCORE_FIELD_NUMBER; + hash = (53 * hash) + java.lang.Float.floatToIntBits(getScore()); + if (hasTokenProperties()) { + hash = (37 * hash) + TOKEN_PROPERTIES_FIELD_NUMBER; + hash = (53 * hash) + getTokenProperties().hashCode(); + } + if (getReasonsCount() > 0) { + hash = (37 * hash) + REASONS_FIELD_NUMBER; + hash = (53 * hash) + reasons_.hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1beta1.Assessment parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.Assessment parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.Assessment parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.Assessment parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.Assessment parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.Assessment parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.Assessment parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.Assessment parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.Assessment parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.Assessment parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.Assessment parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.Assessment parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.recaptchaenterprise.v1beta1.Assessment prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A recaptcha assessment resource.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.Assessment} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1beta1.Assessment) + com.google.recaptchaenterprise.v1beta1.AssessmentOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_Assessment_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_Assessment_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.Assessment.class, + com.google.recaptchaenterprise.v1beta1.Assessment.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1beta1.Assessment.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + if (eventBuilder_ == null) { + event_ = null; + } else { + event_ = null; + eventBuilder_ = null; + } + score_ = 0F; + + if (tokenPropertiesBuilder_ == null) { + tokenProperties_ = null; + } else { + tokenProperties_ = null; + tokenPropertiesBuilder_ = null; + } + reasons_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_Assessment_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.Assessment getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1beta1.Assessment.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.Assessment build() { + com.google.recaptchaenterprise.v1beta1.Assessment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.Assessment buildPartial() { + com.google.recaptchaenterprise.v1beta1.Assessment result = + new com.google.recaptchaenterprise.v1beta1.Assessment(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.name_ = name_; + if (eventBuilder_ == null) { + result.event_ = event_; + } else { + result.event_ = eventBuilder_.build(); + } + result.score_ = score_; + if (tokenPropertiesBuilder_ == null) { + result.tokenProperties_ = tokenProperties_; + } else { + result.tokenProperties_ = tokenPropertiesBuilder_.build(); + } + if (((bitField0_ & 0x00000010) != 0)) { + reasons_ = java.util.Collections.unmodifiableList(reasons_); + bitField0_ = (bitField0_ & ~0x00000010); + } + result.reasons_ = reasons_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.recaptchaenterprise.v1beta1.Assessment) { + return mergeFrom((com.google.recaptchaenterprise.v1beta1.Assessment) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1beta1.Assessment other) { + if (other == com.google.recaptchaenterprise.v1beta1.Assessment.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasEvent()) { + mergeEvent(other.getEvent()); + } + if (other.getScore() != 0F) { + setScore(other.getScore()); + } + if (other.hasTokenProperties()) { + mergeTokenProperties(other.getTokenProperties()); + } + if (!other.reasons_.isEmpty()) { + if (reasons_.isEmpty()) { + reasons_ = other.reasons_; + bitField0_ = (bitField0_ & ~0x00000010); + } else { + ensureReasonsIsMutable(); + reasons_.addAll(other.reasons_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.recaptchaenterprise.v1beta1.Assessment parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.recaptchaenterprise.v1beta1.Assessment) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Output only. The resource name for the Assessment in the format
+     * "projects/{project_number}/assessments/{assessment_id}".
+     * 
+ * + * string name = 1; + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The resource name for the Assessment in the format
+     * "projects/{project_number}/assessments/{assessment_id}".
+     * 
+ * + * string name = 1; + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The resource name for the Assessment in the format
+     * "projects/{project_number}/assessments/{assessment_id}".
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name for the Assessment in the format
+     * "projects/{project_number}/assessments/{assessment_id}".
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The resource name for the Assessment in the format
+     * "projects/{project_number}/assessments/{assessment_id}".
+     * 
+ * + * string name = 1; + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.recaptchaenterprise.v1beta1.Event event_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.Event, + com.google.recaptchaenterprise.v1beta1.Event.Builder, + com.google.recaptchaenterprise.v1beta1.EventOrBuilder> + eventBuilder_; + /** + * + * + *
+     * The event being assessed.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Event event = 2; + */ + public boolean hasEvent() { + return eventBuilder_ != null || event_ != null; + } + /** + * + * + *
+     * The event being assessed.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Event event = 2; + */ + public com.google.recaptchaenterprise.v1beta1.Event getEvent() { + if (eventBuilder_ == null) { + return event_ == null + ? com.google.recaptchaenterprise.v1beta1.Event.getDefaultInstance() + : event_; + } else { + return eventBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The event being assessed.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Event event = 2; + */ + public Builder setEvent(com.google.recaptchaenterprise.v1beta1.Event value) { + if (eventBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + event_ = value; + onChanged(); + } else { + eventBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The event being assessed.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Event event = 2; + */ + public Builder setEvent(com.google.recaptchaenterprise.v1beta1.Event.Builder builderForValue) { + if (eventBuilder_ == null) { + event_ = builderForValue.build(); + onChanged(); + } else { + eventBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The event being assessed.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Event event = 2; + */ + public Builder mergeEvent(com.google.recaptchaenterprise.v1beta1.Event value) { + if (eventBuilder_ == null) { + if (event_ != null) { + event_ = + com.google.recaptchaenterprise.v1beta1.Event.newBuilder(event_) + .mergeFrom(value) + .buildPartial(); + } else { + event_ = value; + } + onChanged(); + } else { + eventBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The event being assessed.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Event event = 2; + */ + public Builder clearEvent() { + if (eventBuilder_ == null) { + event_ = null; + onChanged(); + } else { + event_ = null; + eventBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The event being assessed.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Event event = 2; + */ + public com.google.recaptchaenterprise.v1beta1.Event.Builder getEventBuilder() { + + onChanged(); + return getEventFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The event being assessed.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Event event = 2; + */ + public com.google.recaptchaenterprise.v1beta1.EventOrBuilder getEventOrBuilder() { + if (eventBuilder_ != null) { + return eventBuilder_.getMessageOrBuilder(); + } else { + return event_ == null + ? com.google.recaptchaenterprise.v1beta1.Event.getDefaultInstance() + : event_; + } + } + /** + * + * + *
+     * The event being assessed.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Event event = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.Event, + com.google.recaptchaenterprise.v1beta1.Event.Builder, + com.google.recaptchaenterprise.v1beta1.EventOrBuilder> + getEventFieldBuilder() { + if (eventBuilder_ == null) { + eventBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.Event, + com.google.recaptchaenterprise.v1beta1.Event.Builder, + com.google.recaptchaenterprise.v1beta1.EventOrBuilder>( + getEvent(), getParentForChildren(), isClean()); + event_ = null; + } + return eventBuilder_; + } + + private float score_; + /** + * + * + *
+     * Output only. 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).
+     * 
+ * + * float score = 3; + */ + public float getScore() { + return score_; + } + /** + * + * + *
+     * Output only. 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).
+     * 
+ * + * float score = 3; + */ + public Builder setScore(float value) { + + score_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. 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).
+     * 
+ * + * float score = 3; + */ + public Builder clearScore() { + + score_ = 0F; + onChanged(); + return this; + } + + private com.google.recaptchaenterprise.v1beta1.TokenProperties tokenProperties_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.TokenProperties, + com.google.recaptchaenterprise.v1beta1.TokenProperties.Builder, + com.google.recaptchaenterprise.v1beta1.TokenPropertiesOrBuilder> + tokenPropertiesBuilder_; + /** + * + * + *
+     * Output only. Properties of the provided event token.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties token_properties = 4; + */ + public boolean hasTokenProperties() { + return tokenPropertiesBuilder_ != null || tokenProperties_ != null; + } + /** + * + * + *
+     * Output only. Properties of the provided event token.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties token_properties = 4; + */ + public com.google.recaptchaenterprise.v1beta1.TokenProperties getTokenProperties() { + if (tokenPropertiesBuilder_ == null) { + return tokenProperties_ == null + ? com.google.recaptchaenterprise.v1beta1.TokenProperties.getDefaultInstance() + : tokenProperties_; + } else { + return tokenPropertiesBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Properties of the provided event token.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties token_properties = 4; + */ + public Builder setTokenProperties( + com.google.recaptchaenterprise.v1beta1.TokenProperties value) { + if (tokenPropertiesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + tokenProperties_ = value; + onChanged(); + } else { + tokenPropertiesBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Properties of the provided event token.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties token_properties = 4; + */ + public Builder setTokenProperties( + com.google.recaptchaenterprise.v1beta1.TokenProperties.Builder builderForValue) { + if (tokenPropertiesBuilder_ == null) { + tokenProperties_ = builderForValue.build(); + onChanged(); + } else { + tokenPropertiesBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. Properties of the provided event token.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties token_properties = 4; + */ + public Builder mergeTokenProperties( + com.google.recaptchaenterprise.v1beta1.TokenProperties value) { + if (tokenPropertiesBuilder_ == null) { + if (tokenProperties_ != null) { + tokenProperties_ = + com.google.recaptchaenterprise.v1beta1.TokenProperties.newBuilder(tokenProperties_) + .mergeFrom(value) + .buildPartial(); + } else { + tokenProperties_ = value; + } + onChanged(); + } else { + tokenPropertiesBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. Properties of the provided event token.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties token_properties = 4; + */ + public Builder clearTokenProperties() { + if (tokenPropertiesBuilder_ == null) { + tokenProperties_ = null; + onChanged(); + } else { + tokenProperties_ = null; + tokenPropertiesBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. Properties of the provided event token.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties token_properties = 4; + */ + public com.google.recaptchaenterprise.v1beta1.TokenProperties.Builder + getTokenPropertiesBuilder() { + + onChanged(); + return getTokenPropertiesFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Properties of the provided event token.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties token_properties = 4; + */ + public com.google.recaptchaenterprise.v1beta1.TokenPropertiesOrBuilder + getTokenPropertiesOrBuilder() { + if (tokenPropertiesBuilder_ != null) { + return tokenPropertiesBuilder_.getMessageOrBuilder(); + } else { + return tokenProperties_ == null + ? com.google.recaptchaenterprise.v1beta1.TokenProperties.getDefaultInstance() + : tokenProperties_; + } + } + /** + * + * + *
+     * Output only. Properties of the provided event token.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties token_properties = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.TokenProperties, + com.google.recaptchaenterprise.v1beta1.TokenProperties.Builder, + com.google.recaptchaenterprise.v1beta1.TokenPropertiesOrBuilder> + getTokenPropertiesFieldBuilder() { + if (tokenPropertiesBuilder_ == null) { + tokenPropertiesBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.TokenProperties, + com.google.recaptchaenterprise.v1beta1.TokenProperties.Builder, + com.google.recaptchaenterprise.v1beta1.TokenPropertiesOrBuilder>( + getTokenProperties(), getParentForChildren(), isClean()); + tokenProperties_ = null; + } + return tokenPropertiesBuilder_; + } + + private java.util.List reasons_ = java.util.Collections.emptyList(); + + private void ensureReasonsIsMutable() { + if (!((bitField0_ & 0x00000010) != 0)) { + reasons_ = new java.util.ArrayList(reasons_); + bitField0_ |= 0x00000010; + } + } + /** + * + * + *
+     * Output only. Reasons contributing to the risk analysis verdict.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + public java.util.List + getReasonsList() { + return new com.google.protobuf.Internal.ListAdapter< + java.lang.Integer, + com.google.recaptchaenterprise.v1beta1.Assessment.ClassificationReason>( + reasons_, reasons_converter_); + } + /** + * + * + *
+     * Output only. Reasons contributing to the risk analysis verdict.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + public int getReasonsCount() { + return reasons_.size(); + } + /** + * + * + *
+     * Output only. Reasons contributing to the risk analysis verdict.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + public com.google.recaptchaenterprise.v1beta1.Assessment.ClassificationReason getReasons( + int index) { + return reasons_converter_.convert(reasons_.get(index)); + } + /** + * + * + *
+     * Output only. Reasons contributing to the risk analysis verdict.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + public Builder setReasons( + int index, com.google.recaptchaenterprise.v1beta1.Assessment.ClassificationReason value) { + if (value == null) { + throw new NullPointerException(); + } + ensureReasonsIsMutable(); + reasons_.set(index, value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reasons contributing to the risk analysis verdict.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + public Builder addReasons( + com.google.recaptchaenterprise.v1beta1.Assessment.ClassificationReason value) { + if (value == null) { + throw new NullPointerException(); + } + ensureReasonsIsMutable(); + reasons_.add(value.getNumber()); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reasons contributing to the risk analysis verdict.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + public Builder addAllReasons( + java.lang.Iterable< + ? extends com.google.recaptchaenterprise.v1beta1.Assessment.ClassificationReason> + values) { + ensureReasonsIsMutable(); + for (com.google.recaptchaenterprise.v1beta1.Assessment.ClassificationReason value : values) { + reasons_.add(value.getNumber()); + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reasons contributing to the risk analysis verdict.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + public Builder clearReasons() { + reasons_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reasons contributing to the risk analysis verdict.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + public java.util.List getReasonsValueList() { + return java.util.Collections.unmodifiableList(reasons_); + } + /** + * + * + *
+     * Output only. Reasons contributing to the risk analysis verdict.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + public int getReasonsValue(int index) { + return reasons_.get(index); + } + /** + * + * + *
+     * Output only. Reasons contributing to the risk analysis verdict.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + public Builder setReasonsValue(int index, int value) { + ensureReasonsIsMutable(); + reasons_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reasons contributing to the risk analysis verdict.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + public Builder addReasonsValue(int value) { + ensureReasonsIsMutable(); + reasons_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reasons contributing to the risk analysis verdict.
+     * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + public Builder addAllReasonsValue(java.lang.Iterable values) { + ensureReasonsIsMutable(); + for (int value : values) { + reasons_.add(value); + } + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.recaptchaenterprise.v1beta1.Assessment) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1beta1.Assessment) + private static final com.google.recaptchaenterprise.v1beta1.Assessment DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1beta1.Assessment(); + } + + public static com.google.recaptchaenterprise.v1beta1.Assessment getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Assessment parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Assessment(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.Assessment getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AssessmentName.java b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AssessmentName.java new file mode 100644 index 000000000000..04e5194ce69c --- /dev/null +++ b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AssessmentName.java @@ -0,0 +1,180 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.recaptchaenterprise.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class AssessmentName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/assessments/{assessment}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String assessment; + + public String getProject() { + return project; + } + + public String getAssessment() { + return assessment; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private AssessmentName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + assessment = Preconditions.checkNotNull(builder.getAssessment()); + } + + public static AssessmentName of(String project, String assessment) { + return newBuilder().setProject(project).setAssessment(assessment).build(); + } + + public static String format(String project, String assessment) { + return newBuilder().setProject(project).setAssessment(assessment).build().toString(); + } + + public static AssessmentName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "AssessmentName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("assessment")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (AssessmentName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldMapBuilder.put("assessment", assessment); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "assessment", assessment); + } + + /** Builder for AssessmentName. */ + public static class Builder { + + private String project; + private String assessment; + + public String getProject() { + return project; + } + + public String getAssessment() { + return assessment; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setAssessment(String assessment) { + this.assessment = assessment; + return this; + } + + private Builder() {} + + private Builder(AssessmentName assessmentName) { + project = assessmentName.project; + assessment = assessmentName.assessment; + } + + public AssessmentName build() { + return new AssessmentName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof AssessmentName) { + AssessmentName that = (AssessmentName) o; + return (this.project.equals(that.project)) && (this.assessment.equals(that.assessment)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= assessment.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AssessmentOrBuilder.java b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AssessmentOrBuilder.java new file mode 100644 index 000000000000..d897fe542fd8 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AssessmentOrBuilder.java @@ -0,0 +1,170 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +public interface AssessmentOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1beta1.Assessment) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The resource name for the Assessment in the format
+   * "projects/{project_number}/assessments/{assessment_id}".
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * Output only. The resource name for the Assessment in the format
+   * "projects/{project_number}/assessments/{assessment_id}".
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * The event being assessed.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Event event = 2; + */ + boolean hasEvent(); + /** + * + * + *
+   * The event being assessed.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Event event = 2; + */ + com.google.recaptchaenterprise.v1beta1.Event getEvent(); + /** + * + * + *
+   * The event being assessed.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Event event = 2; + */ + com.google.recaptchaenterprise.v1beta1.EventOrBuilder getEventOrBuilder(); + + /** + * + * + *
+   * Output only. 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).
+   * 
+ * + * float score = 3; + */ + float getScore(); + + /** + * + * + *
+   * Output only. Properties of the provided event token.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties token_properties = 4; + */ + boolean hasTokenProperties(); + /** + * + * + *
+   * Output only. Properties of the provided event token.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties token_properties = 4; + */ + com.google.recaptchaenterprise.v1beta1.TokenProperties getTokenProperties(); + /** + * + * + *
+   * Output only. Properties of the provided event token.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties token_properties = 4; + */ + com.google.recaptchaenterprise.v1beta1.TokenPropertiesOrBuilder getTokenPropertiesOrBuilder(); + + /** + * + * + *
+   * Output only. Reasons contributing to the risk analysis verdict.
+   * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + java.util.List + getReasonsList(); + /** + * + * + *
+   * Output only. Reasons contributing to the risk analysis verdict.
+   * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + int getReasonsCount(); + /** + * + * + *
+   * Output only. Reasons contributing to the risk analysis verdict.
+   * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + com.google.recaptchaenterprise.v1beta1.Assessment.ClassificationReason getReasons(int index); + /** + * + * + *
+   * Output only. Reasons contributing to the risk analysis verdict.
+   * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + java.util.List getReasonsValueList(); + /** + * + * + *
+   * Output only. Reasons contributing to the risk analysis verdict.
+   * 
+ * + * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Assessment.ClassificationReason reasons = 5; + * + */ + int getReasonsValue(int index); +} diff --git a/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/CreateAssessmentRequest.java b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/CreateAssessmentRequest.java new file mode 100644 index 000000000000..c89e530f494e --- /dev/null +++ b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/CreateAssessmentRequest.java @@ -0,0 +1,880 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +/** + * + * + *
+ * The create assessment request message.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest} + */ +public final class CreateAssessmentRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest) + CreateAssessmentRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateAssessmentRequest.newBuilder() to construct. + private CreateAssessmentRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateAssessmentRequest() { + parent_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateAssessmentRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + parent_ = s; + break; + } + case 18: + { + com.google.recaptchaenterprise.v1beta1.Assessment.Builder subBuilder = null; + if (assessment_ != null) { + subBuilder = assessment_.toBuilder(); + } + assessment_ = + input.readMessage( + com.google.recaptchaenterprise.v1beta1.Assessment.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(assessment_); + assessment_ = subBuilder.buildPartial(); + } + + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_CreateAssessmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_CreateAssessmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest.class, + com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The name of the project in which the assessment will be created,
+   * in the format "projects/{project_number}".
+   * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the project in which the assessment will be created,
+   * in the format "projects/{project_number}".
+   * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ASSESSMENT_FIELD_NUMBER = 2; + private com.google.recaptchaenterprise.v1beta1.Assessment assessment_; + /** + * + * + *
+   * The asessment details.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Assessment assessment = 2; + */ + public boolean hasAssessment() { + return assessment_ != null; + } + /** + * + * + *
+   * The asessment details.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Assessment assessment = 2; + */ + public com.google.recaptchaenterprise.v1beta1.Assessment getAssessment() { + return assessment_ == null + ? com.google.recaptchaenterprise.v1beta1.Assessment.getDefaultInstance() + : assessment_; + } + /** + * + * + *
+   * The asessment details.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Assessment assessment = 2; + */ + public com.google.recaptchaenterprise.v1beta1.AssessmentOrBuilder getAssessmentOrBuilder() { + return getAssessment(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (assessment_ != null) { + output.writeMessage(2, getAssessment()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getParentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (assessment_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getAssessment()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest other = + (com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasAssessment() != other.hasAssessment()) return false; + if (hasAssessment()) { + if (!getAssessment().equals(other.getAssessment())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + if (hasAssessment()) { + hash = (37 * hash) + ASSESSMENT_FIELD_NUMBER; + hash = (53 * hash) + getAssessment().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * The create assessment request message.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest) + com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_CreateAssessmentRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_CreateAssessmentRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest.class, + com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + parent_ = ""; + + if (assessmentBuilder_ == null) { + assessment_ = null; + } else { + assessment_ = null; + assessmentBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_CreateAssessmentRequest_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest + getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest build() { + com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest buildPartial() { + com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest result = + new com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest(this); + result.parent_ = parent_; + if (assessmentBuilder_ == null) { + result.assessment_ = assessment_; + } else { + result.assessment_ = assessmentBuilder_.build(); + } + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest) { + return mergeFrom((com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest other) { + if (other + == com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasAssessment()) { + mergeAssessment(other.getAssessment()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest) + e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the project in which the assessment will be created,
+     * in the format "projects/{project_number}".
+     * 
+ * + * string parent = 1; + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the project in which the assessment will be created,
+     * in the format "projects/{project_number}".
+     * 
+ * + * string parent = 1; + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the project in which the assessment will be created,
+     * in the format "projects/{project_number}".
+     * 
+ * + * string parent = 1; + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the project in which the assessment will be created,
+     * in the format "projects/{project_number}".
+     * 
+ * + * string parent = 1; + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the project in which the assessment will be created,
+     * in the format "projects/{project_number}".
+     * 
+ * + * string parent = 1; + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private com.google.recaptchaenterprise.v1beta1.Assessment assessment_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.Assessment, + com.google.recaptchaenterprise.v1beta1.Assessment.Builder, + com.google.recaptchaenterprise.v1beta1.AssessmentOrBuilder> + assessmentBuilder_; + /** + * + * + *
+     * The asessment details.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Assessment assessment = 2; + */ + public boolean hasAssessment() { + return assessmentBuilder_ != null || assessment_ != null; + } + /** + * + * + *
+     * The asessment details.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Assessment assessment = 2; + */ + public com.google.recaptchaenterprise.v1beta1.Assessment getAssessment() { + if (assessmentBuilder_ == null) { + return assessment_ == null + ? com.google.recaptchaenterprise.v1beta1.Assessment.getDefaultInstance() + : assessment_; + } else { + return assessmentBuilder_.getMessage(); + } + } + /** + * + * + *
+     * The asessment details.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Assessment assessment = 2; + */ + public Builder setAssessment(com.google.recaptchaenterprise.v1beta1.Assessment value) { + if (assessmentBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + assessment_ = value; + onChanged(); + } else { + assessmentBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * The asessment details.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Assessment assessment = 2; + */ + public Builder setAssessment( + com.google.recaptchaenterprise.v1beta1.Assessment.Builder builderForValue) { + if (assessmentBuilder_ == null) { + assessment_ = builderForValue.build(); + onChanged(); + } else { + assessmentBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * The asessment details.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Assessment assessment = 2; + */ + public Builder mergeAssessment(com.google.recaptchaenterprise.v1beta1.Assessment value) { + if (assessmentBuilder_ == null) { + if (assessment_ != null) { + assessment_ = + com.google.recaptchaenterprise.v1beta1.Assessment.newBuilder(assessment_) + .mergeFrom(value) + .buildPartial(); + } else { + assessment_ = value; + } + onChanged(); + } else { + assessmentBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * The asessment details.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Assessment assessment = 2; + */ + public Builder clearAssessment() { + if (assessmentBuilder_ == null) { + assessment_ = null; + onChanged(); + } else { + assessment_ = null; + assessmentBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * The asessment details.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Assessment assessment = 2; + */ + public com.google.recaptchaenterprise.v1beta1.Assessment.Builder getAssessmentBuilder() { + + onChanged(); + return getAssessmentFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * The asessment details.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Assessment assessment = 2; + */ + public com.google.recaptchaenterprise.v1beta1.AssessmentOrBuilder getAssessmentOrBuilder() { + if (assessmentBuilder_ != null) { + return assessmentBuilder_.getMessageOrBuilder(); + } else { + return assessment_ == null + ? com.google.recaptchaenterprise.v1beta1.Assessment.getDefaultInstance() + : assessment_; + } + } + /** + * + * + *
+     * The asessment details.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Assessment assessment = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.Assessment, + com.google.recaptchaenterprise.v1beta1.Assessment.Builder, + com.google.recaptchaenterprise.v1beta1.AssessmentOrBuilder> + getAssessmentFieldBuilder() { + if (assessmentBuilder_ == null) { + assessmentBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.Assessment, + com.google.recaptchaenterprise.v1beta1.Assessment.Builder, + com.google.recaptchaenterprise.v1beta1.AssessmentOrBuilder>( + getAssessment(), getParentForChildren(), isClean()); + assessment_ = null; + } + return assessmentBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest) + private static final com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest(); + } + + public static com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateAssessmentRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateAssessmentRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/CreateAssessmentRequestOrBuilder.java b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/CreateAssessmentRequestOrBuilder.java new file mode 100644 index 000000000000..a7e4b8dc575f --- /dev/null +++ b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/CreateAssessmentRequestOrBuilder.java @@ -0,0 +1,64 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +public interface CreateAssessmentRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1beta1.CreateAssessmentRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the project in which the assessment will be created,
+   * in the format "projects/{project_number}".
+   * 
+ * + * string parent = 1; + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the project in which the assessment will be created,
+   * in the format "projects/{project_number}".
+   * 
+ * + * string parent = 1; + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The asessment details.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Assessment assessment = 2; + */ + boolean hasAssessment(); + /** + * + * + *
+   * The asessment details.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Assessment assessment = 2; + */ + com.google.recaptchaenterprise.v1beta1.Assessment getAssessment(); + /** + * + * + *
+   * The asessment details.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.Assessment assessment = 2; + */ + com.google.recaptchaenterprise.v1beta1.AssessmentOrBuilder getAssessmentOrBuilder(); +} diff --git a/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/Event.java b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/Event.java new file mode 100644 index 000000000000..e8d2750c2a19 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/Event.java @@ -0,0 +1,755 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +/** Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.Event} */ +public final class Event extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1beta1.Event) + EventOrBuilder { + private static final long serialVersionUID = 0L; + // Use Event.newBuilder() to construct. + private Event(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Event() { + token_ = ""; + siteKey_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Event( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + + token_ = s; + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + siteKey_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_Event_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_Event_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.Event.class, + com.google.recaptchaenterprise.v1beta1.Event.Builder.class); + } + + public static final int TOKEN_FIELD_NUMBER = 1; + private volatile java.lang.Object token_; + /** + * + * + *
+   * The user response token provided by the reCAPTCHA client-side integration
+   * on your site.
+   * 
+ * + * string token = 1; + */ + public java.lang.String getToken() { + java.lang.Object ref = token_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + token_ = s; + return s; + } + } + /** + * + * + *
+   * The user response token provided by the reCAPTCHA client-side integration
+   * on your site.
+   * 
+ * + * string token = 1; + */ + public com.google.protobuf.ByteString getTokenBytes() { + java.lang.Object ref = token_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + token_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SITE_KEY_FIELD_NUMBER = 2; + private volatile java.lang.Object siteKey_; + /** + * + * + *
+   * The site key that was used to invoke reCAPTCHA on your site and generate
+   * the token.
+   * 
+ * + * string site_key = 2; + */ + public java.lang.String getSiteKey() { + java.lang.Object ref = siteKey_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + siteKey_ = s; + return s; + } + } + /** + * + * + *
+   * The site key that was used to invoke reCAPTCHA on your site and generate
+   * the token.
+   * 
+ * + * string site_key = 2; + */ + public com.google.protobuf.ByteString getSiteKeyBytes() { + java.lang.Object ref = siteKey_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + siteKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!getTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, token_); + } + if (!getSiteKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, siteKey_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, token_); + } + if (!getSiteKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, siteKey_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.recaptchaenterprise.v1beta1.Event)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1beta1.Event other = + (com.google.recaptchaenterprise.v1beta1.Event) obj; + + if (!getToken().equals(other.getToken())) return false; + if (!getSiteKey().equals(other.getSiteKey())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getToken().hashCode(); + hash = (37 * hash) + SITE_KEY_FIELD_NUMBER; + hash = (53 * hash) + getSiteKey().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1beta1.Event parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.Event parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.Event parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.Event parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.Event parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.Event parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.Event parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.Event parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.Event parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.Event parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.Event parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.Event parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.recaptchaenterprise.v1beta1.Event prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.Event} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1beta1.Event) + com.google.recaptchaenterprise.v1beta1.EventOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_Event_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_Event_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.Event.class, + com.google.recaptchaenterprise.v1beta1.Event.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1beta1.Event.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + token_ = ""; + + siteKey_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_Event_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.Event getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1beta1.Event.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.Event build() { + com.google.recaptchaenterprise.v1beta1.Event result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.Event buildPartial() { + com.google.recaptchaenterprise.v1beta1.Event result = + new com.google.recaptchaenterprise.v1beta1.Event(this); + result.token_ = token_; + result.siteKey_ = siteKey_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.recaptchaenterprise.v1beta1.Event) { + return mergeFrom((com.google.recaptchaenterprise.v1beta1.Event) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1beta1.Event other) { + if (other == com.google.recaptchaenterprise.v1beta1.Event.getDefaultInstance()) return this; + if (!other.getToken().isEmpty()) { + token_ = other.token_; + onChanged(); + } + if (!other.getSiteKey().isEmpty()) { + siteKey_ = other.siteKey_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.recaptchaenterprise.v1beta1.Event parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.recaptchaenterprise.v1beta1.Event) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object token_ = ""; + /** + * + * + *
+     * The user response token provided by the reCAPTCHA client-side integration
+     * on your site.
+     * 
+ * + * string token = 1; + */ + public java.lang.String getToken() { + java.lang.Object ref = token_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + token_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The user response token provided by the reCAPTCHA client-side integration
+     * on your site.
+     * 
+ * + * string token = 1; + */ + public com.google.protobuf.ByteString getTokenBytes() { + java.lang.Object ref = token_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + token_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The user response token provided by the reCAPTCHA client-side integration
+     * on your site.
+     * 
+ * + * string token = 1; + */ + public Builder setToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + token_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The user response token provided by the reCAPTCHA client-side integration
+     * on your site.
+     * 
+ * + * string token = 1; + */ + public Builder clearToken() { + + token_ = getDefaultInstance().getToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * The user response token provided by the reCAPTCHA client-side integration
+     * on your site.
+     * 
+ * + * string token = 1; + */ + public Builder setTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + token_ = value; + onChanged(); + return this; + } + + private java.lang.Object siteKey_ = ""; + /** + * + * + *
+     * The site key that was used to invoke reCAPTCHA on your site and generate
+     * the token.
+     * 
+ * + * string site_key = 2; + */ + public java.lang.String getSiteKey() { + java.lang.Object ref = siteKey_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + siteKey_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * The site key that was used to invoke reCAPTCHA on your site and generate
+     * the token.
+     * 
+ * + * string site_key = 2; + */ + public com.google.protobuf.ByteString getSiteKeyBytes() { + java.lang.Object ref = siteKey_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + siteKey_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * The site key that was used to invoke reCAPTCHA on your site and generate
+     * the token.
+     * 
+ * + * string site_key = 2; + */ + public Builder setSiteKey(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + siteKey_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The site key that was used to invoke reCAPTCHA on your site and generate
+     * the token.
+     * 
+ * + * string site_key = 2; + */ + public Builder clearSiteKey() { + + siteKey_ = getDefaultInstance().getSiteKey(); + onChanged(); + return this; + } + /** + * + * + *
+     * The site key that was used to invoke reCAPTCHA on your site and generate
+     * the token.
+     * 
+ * + * string site_key = 2; + */ + public Builder setSiteKeyBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + siteKey_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.recaptchaenterprise.v1beta1.Event) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1beta1.Event) + private static final com.google.recaptchaenterprise.v1beta1.Event DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1beta1.Event(); + } + + public static com.google.recaptchaenterprise.v1beta1.Event getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Event parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Event(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.Event getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/EventOrBuilder.java b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/EventOrBuilder.java new file mode 100644 index 000000000000..0306686bf8fe --- /dev/null +++ b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/EventOrBuilder.java @@ -0,0 +1,56 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +public interface EventOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1beta1.Event) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The user response token provided by the reCAPTCHA client-side integration
+   * on your site.
+   * 
+ * + * string token = 1; + */ + java.lang.String getToken(); + /** + * + * + *
+   * The user response token provided by the reCAPTCHA client-side integration
+   * on your site.
+   * 
+ * + * string token = 1; + */ + com.google.protobuf.ByteString getTokenBytes(); + + /** + * + * + *
+   * The site key that was used to invoke reCAPTCHA on your site and generate
+   * the token.
+   * 
+ * + * string site_key = 2; + */ + java.lang.String getSiteKey(); + /** + * + * + *
+   * The site key that was used to invoke reCAPTCHA on your site and generate
+   * the token.
+   * 
+ * + * string site_key = 2; + */ + com.google.protobuf.ByteString getSiteKeyBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/ProjectName.java b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/ProjectName.java new file mode 100644 index 000000000000..9a6bb483ef88 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/ProjectName.java @@ -0,0 +1,160 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + */ + +package com.google.recaptchaenterprise.v1beta1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +@javax.annotation.Generated("by GAPIC protoc plugin") +public class ProjectName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}"); + + private volatile Map fieldValuesMap; + + private final String project; + + public String getProject() { + return project; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private ProjectName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + } + + public static ProjectName of(String project) { + return newBuilder().setProject(project).build(); + } + + public static String format(String project) { + return newBuilder().setProject(project).build().toString(); + } + + public static ProjectName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "ProjectName.parse: formattedString not in valid format"); + return of(matchMap.get("project")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList(values.size()); + for (ProjectName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PATH_TEMPLATE.matches(formattedString); + } + + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + fieldMapBuilder.put("project", project); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project); + } + + /** Builder for ProjectName. */ + public static class Builder { + + private String project; + + public String getProject() { + return project; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + private Builder() {} + + private Builder(ProjectName projectName) { + project = projectName.project; + } + + public ProjectName build() { + return new ProjectName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof ProjectName) { + ProjectName that = (ProjectName) o; + return (this.project.equals(that.project)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + return h; + } +} diff --git a/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/RecaptchaEnterpriseProto.java b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/RecaptchaEnterpriseProto.java new file mode 100644 index 000000000000..5bbd167663c7 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/RecaptchaEnterpriseProto.java @@ -0,0 +1,174 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +public final class RecaptchaEnterpriseProto { + private RecaptchaEnterpriseProto() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1beta1_CreateAssessmentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1beta1_CreateAssessmentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1beta1_AnnotateAssessmentRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1beta1_AnnotateAssessmentRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1beta1_AnnotateAssessmentResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1beta1_AnnotateAssessmentResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1beta1_Assessment_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1beta1_Assessment_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1beta1_Event_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1beta1_Event_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1beta1_TokenProperties_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1beta1_TokenProperties_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\nBgoogle/cloud/recaptchaenterprise/v1bet" + + "a1/recaptchaenterprise.proto\022(google.clo" + + "ud.recaptchaenterprise.v1beta1\032\034google/a" + + "pi/annotations.proto\032\037google/protobuf/ti" + + "mestamp.proto\"s\n\027CreateAssessmentRequest" + + "\022\016\n\006parent\030\001 \001(\t\022H\n\nassessment\030\002 \001(\01324.g" + + "oogle.cloud.recaptchaenterprise.v1beta1." + + "Assessment\"\327\001\n\031AnnotateAssessmentRequest" + + "\022\014\n\004name\030\001 \001(\t\022b\n\nannotation\030\002 \001(\0162N.goo" + + "gle.cloud.recaptchaenterprise.v1beta1.An" + + "notateAssessmentRequest.Annotation\"H\n\nAn" + + "notation\022\032\n\026ANNOTATION_UNSPECIFIED\020\000\022\016\n\n" + + "LEGITIMATE\020\001\022\016\n\nFRAUDULENT\020\002\"\034\n\032Annotate" + + "AssessmentResponse\"\304\003\n\nAssessment\022\014\n\004nam" + + "e\030\001 \001(\t\022>\n\005event\030\002 \001(\0132/.google.cloud.re" + + "captchaenterprise.v1beta1.Event\022\r\n\005score" + + "\030\003 \001(\002\022S\n\020token_properties\030\004 \001(\01329.googl" + + "e.cloud.recaptchaenterprise.v1beta1.Toke" + + "nProperties\022Z\n\007reasons\030\005 \003(\0162I.google.cl" + + "oud.recaptchaenterprise.v1beta1.Assessme" + + "nt.ClassificationReason\"\247\001\n\024Classificati" + + "onReason\022%\n!CLASSIFICATION_REASON_UNSPEC" + + "IFIED\020\000\022\016\n\nAUTOMATION\020\001\022\032\n\026UNEXPECTED_EN" + + "VIRONMENT\020\002\022\035\n\031UNEXPECTED_USAGE_PATTERNS" + + "\020\004\022\035\n\031PROVISIONAL_RISK_ANALYSIS\020\005\"(\n\005Eve" + + "nt\022\r\n\005token\030\001 \001(\t\022\020\n\010site_key\030\002 \001(\t\"\350\002\n\017" + + "TokenProperties\022\r\n\005valid\030\001 \001(\010\022_\n\016invali" + + "d_reason\030\002 \001(\0162G.google.cloud.recaptchae" + + "nterprise.v1beta1.TokenProperties.Invali" + + "dReason\022/\n\013create_time\030\003 \001(\0132\032.google.pr" + + "otobuf.Timestamp\022\020\n\010hostname\030\004 \001(\t\022\016\n\006ac" + + "tion\030\005 \001(\t\"\221\001\n\rInvalidReason\022\036\n\032INVALID_" + + "REASON_UNSPECIFIED\020\000\022\032\n\026UNKNOWN_INVALID_" + + "REASON\020\001\022\r\n\tMALFORMED\020\002\022\013\n\007EXPIRED\020\003\022\010\n\004" + + "DUPE\020\004\022\021\n\rSITE_MISMATCH\020\005\022\013\n\007MISSING\020\0062\317" + + "\003\n!RecaptchaEnterpriseServiceV1Beta1\022\311\001\n" + + "\020CreateAssessment\022A.google.cloud.recaptc" + + "haenterprise.v1beta1.CreateAssessmentReq" + + "uest\0324.google.cloud.recaptchaenterprise." + + "v1beta1.Assessment\"<\202\323\344\223\0026\"(/v1beta1/{pa" + + "rent=projects/*}/assessments:\nassessment" + + "\022\335\001\n\022AnnotateAssessment\022C.google.cloud.r" + + "ecaptchaenterprise.v1beta1.AnnotateAsses" + + "smentRequest\032D.google.cloud.recaptchaent" + + "erprise.v1beta1.AnnotateAssessmentRespon" + + "se\"<\202\323\344\223\0026\"1/v1beta1/{name=projects/*/as" + + "sessments/*}:annotate:\001*B\376\001\n&com.google." + + "recaptchaenterprise.v1beta1B\030RecaptchaEn" + + "terpriseProtoP\001Z[google.golang.org/genpr" + + "oto/googleapis/cloud/recaptchaenterprise" + + "/v1beta1;recaptchaenterprise\242\002\004GCRE\252\002(Go" + + "ogle.Cloud.RecaptchaEnterprise.V1Beta1\312\002" + + "(Google\\Cloud\\RecaptchaEnterprise\\V1beta" + + "1b\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.api.AnnotationsProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }, + assigner); + internal_static_google_cloud_recaptchaenterprise_v1beta1_CreateAssessmentRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_recaptchaenterprise_v1beta1_CreateAssessmentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1beta1_CreateAssessmentRequest_descriptor, + new java.lang.String[] { + "Parent", "Assessment", + }); + internal_static_google_cloud_recaptchaenterprise_v1beta1_AnnotateAssessmentRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_recaptchaenterprise_v1beta1_AnnotateAssessmentRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1beta1_AnnotateAssessmentRequest_descriptor, + new java.lang.String[] { + "Name", "Annotation", + }); + internal_static_google_cloud_recaptchaenterprise_v1beta1_AnnotateAssessmentResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_recaptchaenterprise_v1beta1_AnnotateAssessmentResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1beta1_AnnotateAssessmentResponse_descriptor, + new java.lang.String[] {}); + internal_static_google_cloud_recaptchaenterprise_v1beta1_Assessment_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_recaptchaenterprise_v1beta1_Assessment_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1beta1_Assessment_descriptor, + new java.lang.String[] { + "Name", "Event", "Score", "TokenProperties", "Reasons", + }); + internal_static_google_cloud_recaptchaenterprise_v1beta1_Event_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_recaptchaenterprise_v1beta1_Event_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1beta1_Event_descriptor, + new java.lang.String[] { + "Token", "SiteKey", + }); + internal_static_google_cloud_recaptchaenterprise_v1beta1_TokenProperties_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_recaptchaenterprise_v1beta1_TokenProperties_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1beta1_TokenProperties_descriptor, + new java.lang.String[] { + "Valid", "InvalidReason", "CreateTime", "Hostname", "Action", + }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(com.google.api.AnnotationsProto.http); + com.google.protobuf.Descriptors.FileDescriptor.internalUpdateFileDescriptor( + descriptor, registry); + com.google.api.AnnotationsProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/TokenProperties.java b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/TokenProperties.java new file mode 100644 index 000000000000..1947a70a06b5 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/TokenProperties.java @@ -0,0 +1,1481 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +/** Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.TokenProperties} */ +public final class TokenProperties extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1beta1.TokenProperties) + TokenPropertiesOrBuilder { + private static final long serialVersionUID = 0L; + // Use TokenProperties.newBuilder() to construct. + private TokenProperties(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private TokenProperties() { + invalidReason_ = 0; + hostname_ = ""; + action_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private TokenProperties( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + valid_ = input.readBool(); + break; + } + case 16: + { + int rawValue = input.readEnum(); + + invalidReason_ = rawValue; + break; + } + case 26: + { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (createTime_ != null) { + subBuilder = createTime_.toBuilder(); + } + createTime_ = + input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(createTime_); + createTime_ = subBuilder.buildPartial(); + } + + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + hostname_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + action_ = s; + break; + } + default: + { + if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_TokenProperties_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_TokenProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.TokenProperties.class, + com.google.recaptchaenterprise.v1beta1.TokenProperties.Builder.class); + } + + /** + * + * + *
+   * Enum that represents the types of invalid token reasons.
+   * 
+ * + * Protobuf enum {@code google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason} + */ + public enum InvalidReason implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default unspecified type.
+     * 
+ * + * INVALID_REASON_UNSPECIFIED = 0; + */ + INVALID_REASON_UNSPECIFIED(0), + /** + * + * + *
+     * If the failure reason was not accounted for.
+     * 
+ * + * UNKNOWN_INVALID_REASON = 1; + */ + UNKNOWN_INVALID_REASON(1), + /** + * + * + *
+     * The provided user verification token was malformed.
+     * 
+ * + * MALFORMED = 2; + */ + MALFORMED(2), + /** + * + * + *
+     * The user verification token had expired.
+     * 
+ * + * EXPIRED = 3; + */ + EXPIRED(3), + /** + * + * + *
+     * The user verification had already been seen.
+     * 
+ * + * DUPE = 4; + */ + DUPE(4), + /** + * + * + *
+     * The user verification token did not match the provided site secret.
+     * This may be a configuration error (e.g. development keys used in
+     * production) or end users trying to use verification tokens from other
+     * sites.
+     * 
+ * + * SITE_MISMATCH = 5; + */ + SITE_MISMATCH(5), + /** + * + * + *
+     * The user verification token was not present.  It is a required input.
+     * 
+ * + * MISSING = 6; + */ + MISSING(6), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default unspecified type.
+     * 
+ * + * INVALID_REASON_UNSPECIFIED = 0; + */ + public static final int INVALID_REASON_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * If the failure reason was not accounted for.
+     * 
+ * + * UNKNOWN_INVALID_REASON = 1; + */ + public static final int UNKNOWN_INVALID_REASON_VALUE = 1; + /** + * + * + *
+     * The provided user verification token was malformed.
+     * 
+ * + * MALFORMED = 2; + */ + public static final int MALFORMED_VALUE = 2; + /** + * + * + *
+     * The user verification token had expired.
+     * 
+ * + * EXPIRED = 3; + */ + public static final int EXPIRED_VALUE = 3; + /** + * + * + *
+     * The user verification had already been seen.
+     * 
+ * + * DUPE = 4; + */ + public static final int DUPE_VALUE = 4; + /** + * + * + *
+     * The user verification token did not match the provided site secret.
+     * This may be a configuration error (e.g. development keys used in
+     * production) or end users trying to use verification tokens from other
+     * sites.
+     * 
+ * + * SITE_MISMATCH = 5; + */ + public static final int SITE_MISMATCH_VALUE = 5; + /** + * + * + *
+     * The user verification token was not present.  It is a required input.
+     * 
+ * + * MISSING = 6; + */ + public static final int MISSING_VALUE = 6; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static InvalidReason valueOf(int value) { + return forNumber(value); + } + + public static InvalidReason forNumber(int value) { + switch (value) { + case 0: + return INVALID_REASON_UNSPECIFIED; + case 1: + return UNKNOWN_INVALID_REASON; + case 2: + return MALFORMED; + case 3: + return EXPIRED; + case 4: + return DUPE; + case 5: + return SITE_MISMATCH; + case 6: + return MISSING; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public InvalidReason findValueByNumber(int number) { + return InvalidReason.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.TokenProperties.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final InvalidReason[] VALUES = values(); + + public static InvalidReason valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private InvalidReason(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason) + } + + public static final int VALID_FIELD_NUMBER = 1; + private boolean valid_; + /** + * + * + *
+   * Output only. Whether the provided user response token is valid.
+   * 
+ * + * bool valid = 1; + */ + public boolean getValid() { + return valid_; + } + + public static final int INVALID_REASON_FIELD_NUMBER = 2; + private int invalidReason_; + /** + * + * + *
+   * Output only. Reason associated with the response when valid = false.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason invalid_reason = 2; + * + */ + public int getInvalidReasonValue() { + return invalidReason_; + } + /** + * + * + *
+   * Output only. Reason associated with the response when valid = false.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason invalid_reason = 2; + * + */ + public com.google.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason getInvalidReason() { + @SuppressWarnings("deprecation") + com.google.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason result = + com.google.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason.valueOf( + invalidReason_); + return result == null + ? com.google.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason.UNRECOGNIZED + : result; + } + + public static final int CREATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The timestamp corresponding to the generation of the token.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public boolean hasCreateTime() { + return createTime_ != null; + } + /** + * + * + *
+   * Output only. The timestamp corresponding to the generation of the token.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public com.google.protobuf.Timestamp getCreateTime() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + /** + * + * + *
+   * Output only. The timestamp corresponding to the generation of the token.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return getCreateTime(); + } + + public static final int HOSTNAME_FIELD_NUMBER = 4; + private volatile java.lang.Object hostname_; + /** + * + * + *
+   * Output only. The hostname of the page on which the token was generated.
+   * 
+ * + * string hostname = 4; + */ + public java.lang.String getHostname() { + java.lang.Object ref = hostname_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hostname_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The hostname of the page on which the token was generated.
+   * 
+ * + * string hostname = 4; + */ + public com.google.protobuf.ByteString getHostnameBytes() { + java.lang.Object ref = hostname_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hostname_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ACTION_FIELD_NUMBER = 5; + private volatile java.lang.Object action_; + /** + * + * + *
+   * Output only. Action name provided at token generation.
+   * 
+ * + * string action = 5; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Action name provided at token generation.
+   * 
+ * + * string action = 5; + */ + public com.google.protobuf.ByteString getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (valid_ != false) { + output.writeBool(1, valid_); + } + if (invalidReason_ + != com.google.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason + .INVALID_REASON_UNSPECIFIED + .getNumber()) { + output.writeEnum(2, invalidReason_); + } + if (createTime_ != null) { + output.writeMessage(3, getCreateTime()); + } + if (!getHostnameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, hostname_); + } + if (!getActionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, action_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (valid_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(1, valid_); + } + if (invalidReason_ + != com.google.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason + .INVALID_REASON_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, invalidReason_); + } + if (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + if (!getHostnameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, hostname_); + } + if (!getActionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, action_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.recaptchaenterprise.v1beta1.TokenProperties)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1beta1.TokenProperties other = + (com.google.recaptchaenterprise.v1beta1.TokenProperties) obj; + + if (getValid() != other.getValid()) return false; + if (invalidReason_ != other.invalidReason_) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (!getHostname().equals(other.getHostname())) return false; + if (!getAction().equals(other.getAction())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VALID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getValid()); + hash = (37 * hash) + INVALID_REASON_FIELD_NUMBER; + hash = (53 * hash) + invalidReason_; + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + HOSTNAME_FIELD_NUMBER; + hash = (53 * hash) + getHostname().hashCode(); + hash = (37 * hash) + ACTION_FIELD_NUMBER; + hash = (53 * hash) + getAction().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1beta1.TokenProperties parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.TokenProperties parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.TokenProperties parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.TokenProperties parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.TokenProperties parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.TokenProperties parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.TokenProperties parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.TokenProperties parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.TokenProperties parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.TokenProperties parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.TokenProperties parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.TokenProperties parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.recaptchaenterprise.v1beta1.TokenProperties prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.TokenProperties} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1beta1.TokenProperties) + com.google.recaptchaenterprise.v1beta1.TokenPropertiesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_TokenProperties_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_TokenProperties_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.TokenProperties.class, + com.google.recaptchaenterprise.v1beta1.TokenProperties.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1beta1.TokenProperties.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} + } + + @java.lang.Override + public Builder clear() { + super.clear(); + valid_ = false; + + invalidReason_ = 0; + + if (createTimeBuilder_ == null) { + createTime_ = null; + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + hostname_ = ""; + + action_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_TokenProperties_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.TokenProperties getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1beta1.TokenProperties.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.TokenProperties build() { + com.google.recaptchaenterprise.v1beta1.TokenProperties result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.TokenProperties buildPartial() { + com.google.recaptchaenterprise.v1beta1.TokenProperties result = + new com.google.recaptchaenterprise.v1beta1.TokenProperties(this); + result.valid_ = valid_; + result.invalidReason_ = invalidReason_; + if (createTimeBuilder_ == null) { + result.createTime_ = createTime_; + } else { + result.createTime_ = createTimeBuilder_.build(); + } + result.hostname_ = hostname_; + result.action_ = action_; + onBuilt(); + return result; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.recaptchaenterprise.v1beta1.TokenProperties) { + return mergeFrom((com.google.recaptchaenterprise.v1beta1.TokenProperties) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1beta1.TokenProperties other) { + if (other == com.google.recaptchaenterprise.v1beta1.TokenProperties.getDefaultInstance()) + return this; + if (other.getValid() != false) { + setValid(other.getValid()); + } + if (other.invalidReason_ != 0) { + setInvalidReasonValue(other.getInvalidReasonValue()); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (!other.getHostname().isEmpty()) { + hostname_ = other.hostname_; + onChanged(); + } + if (!other.getAction().isEmpty()) { + action_ = other.action_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.recaptchaenterprise.v1beta1.TokenProperties parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.recaptchaenterprise.v1beta1.TokenProperties) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean valid_; + /** + * + * + *
+     * Output only. Whether the provided user response token is valid.
+     * 
+ * + * bool valid = 1; + */ + public boolean getValid() { + return valid_; + } + /** + * + * + *
+     * Output only. Whether the provided user response token is valid.
+     * 
+ * + * bool valid = 1; + */ + public Builder setValid(boolean value) { + + valid_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Whether the provided user response token is valid.
+     * 
+ * + * bool valid = 1; + */ + public Builder clearValid() { + + valid_ = false; + onChanged(); + return this; + } + + private int invalidReason_ = 0; + /** + * + * + *
+     * Output only. Reason associated with the response when valid = false.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason invalid_reason = 2; + * + */ + public int getInvalidReasonValue() { + return invalidReason_; + } + /** + * + * + *
+     * Output only. Reason associated with the response when valid = false.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason invalid_reason = 2; + * + */ + public Builder setInvalidReasonValue(int value) { + invalidReason_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reason associated with the response when valid = false.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason invalid_reason = 2; + * + */ + public com.google.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason getInvalidReason() { + @SuppressWarnings("deprecation") + com.google.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason result = + com.google.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason.valueOf( + invalidReason_); + return result == null + ? com.google.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Reason associated with the response when valid = false.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason invalid_reason = 2; + * + */ + public Builder setInvalidReason( + com.google.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason value) { + if (value == null) { + throw new NullPointerException(); + } + + invalidReason_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Reason associated with the response when valid = false.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason invalid_reason = 2; + * + */ + public Builder clearInvalidReason() { + + invalidReason_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp createTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + createTimeBuilder_; + /** + * + * + *
+     * Output only. The timestamp corresponding to the generation of the token.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public boolean hasCreateTime() { + return createTimeBuilder_ != null || createTime_ != null; + } + /** + * + * + *
+     * Output only. The timestamp corresponding to the generation of the token.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public com.google.protobuf.Timestamp getCreateTime() { + if (createTimeBuilder_ == null) { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } else { + return createTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. The timestamp corresponding to the generation of the token.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + createTime_ = value; + onChanged(); + } else { + createTimeBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The timestamp corresponding to the generation of the token.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public Builder setCreateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (createTimeBuilder_ == null) { + createTime_ = builderForValue.build(); + onChanged(); + } else { + createTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Output only. The timestamp corresponding to the generation of the token.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public Builder mergeCreateTime(com.google.protobuf.Timestamp value) { + if (createTimeBuilder_ == null) { + if (createTime_ != null) { + createTime_ = + com.google.protobuf.Timestamp.newBuilder(createTime_).mergeFrom(value).buildPartial(); + } else { + createTime_ = value; + } + onChanged(); + } else { + createTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Output only. The timestamp corresponding to the generation of the token.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public Builder clearCreateTime() { + if (createTimeBuilder_ == null) { + createTime_ = null; + onChanged(); + } else { + createTime_ = null; + createTimeBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Output only. The timestamp corresponding to the generation of the token.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp corresponding to the generation of the token.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + if (createTimeBuilder_ != null) { + return createTimeBuilder_.getMessageOrBuilder(); + } else { + return createTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : createTime_; + } + } + /** + * + * + *
+     * Output only. The timestamp corresponding to the generation of the token.
+     * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private java.lang.Object hostname_ = ""; + /** + * + * + *
+     * Output only. The hostname of the page on which the token was generated.
+     * 
+ * + * string hostname = 4; + */ + public java.lang.String getHostname() { + java.lang.Object ref = hostname_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hostname_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The hostname of the page on which the token was generated.
+     * 
+ * + * string hostname = 4; + */ + public com.google.protobuf.ByteString getHostnameBytes() { + java.lang.Object ref = hostname_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + hostname_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The hostname of the page on which the token was generated.
+     * 
+ * + * string hostname = 4; + */ + public Builder setHostname(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + hostname_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The hostname of the page on which the token was generated.
+     * 
+ * + * string hostname = 4; + */ + public Builder clearHostname() { + + hostname_ = getDefaultInstance().getHostname(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The hostname of the page on which the token was generated.
+     * 
+ * + * string hostname = 4; + */ + public Builder setHostnameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + hostname_ = value; + onChanged(); + return this; + } + + private java.lang.Object action_ = ""; + /** + * + * + *
+     * Output only. Action name provided at token generation.
+     * 
+ * + * string action = 5; + */ + public java.lang.String getAction() { + java.lang.Object ref = action_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + action_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Action name provided at token generation.
+     * 
+ * + * string action = 5; + */ + public com.google.protobuf.ByteString getActionBytes() { + java.lang.Object ref = action_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + action_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Action name provided at token generation.
+     * 
+ * + * string action = 5; + */ + public Builder setAction(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + action_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Action name provided at token generation.
+     * 
+ * + * string action = 5; + */ + public Builder clearAction() { + + action_ = getDefaultInstance().getAction(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Action name provided at token generation.
+     * 
+ * + * string action = 5; + */ + public Builder setActionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + action_ = value; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.recaptchaenterprise.v1beta1.TokenProperties) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1beta1.TokenProperties) + private static final com.google.recaptchaenterprise.v1beta1.TokenProperties DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1beta1.TokenProperties(); + } + + public static com.google.recaptchaenterprise.v1beta1.TokenProperties getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TokenProperties parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TokenProperties(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.TokenProperties getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/TokenPropertiesOrBuilder.java b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/TokenPropertiesOrBuilder.java new file mode 100644 index 000000000000..87ffbc685451 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/TokenPropertiesOrBuilder.java @@ -0,0 +1,119 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +public interface TokenPropertiesOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1beta1.TokenProperties) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Whether the provided user response token is valid.
+   * 
+ * + * bool valid = 1; + */ + boolean getValid(); + + /** + * + * + *
+   * Output only. Reason associated with the response when valid = false.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason invalid_reason = 2; + * + */ + int getInvalidReasonValue(); + /** + * + * + *
+   * Output only. Reason associated with the response when valid = false.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason invalid_reason = 2; + * + */ + com.google.recaptchaenterprise.v1beta1.TokenProperties.InvalidReason getInvalidReason(); + + /** + * + * + *
+   * Output only. The timestamp corresponding to the generation of the token.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The timestamp corresponding to the generation of the token.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The timestamp corresponding to the generation of the token.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3; + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The hostname of the page on which the token was generated.
+   * 
+ * + * string hostname = 4; + */ + java.lang.String getHostname(); + /** + * + * + *
+   * Output only. The hostname of the page on which the token was generated.
+   * 
+ * + * string hostname = 4; + */ + com.google.protobuf.ByteString getHostnameBytes(); + + /** + * + * + *
+   * Output only. Action name provided at token generation.
+   * 
+ * + * string action = 5; + */ + java.lang.String getAction(); + /** + * + * + *
+   * Output only. Action name provided at token generation.
+   * 
+ * + * string action = 5; + */ + com.google.protobuf.ByteString getActionBytes(); +} diff --git a/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/proto/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/proto/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto new file mode 100644 index 000000000000..188f99f6f777 --- /dev/null +++ b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/proto/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto @@ -0,0 +1,183 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.recaptchaenterprise.v1beta1; + +import "google/api/annotations.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.RecaptchaEnterprise.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/recaptchaenterprise/v1beta1;recaptchaenterprise"; +option java_multiple_files = true; +option java_outer_classname = "RecaptchaEnterpriseProto"; +option java_package = "com.google.recaptchaenterprise.v1beta1"; +option objc_class_prefix = "GCRE"; +option php_namespace = "Google\\Cloud\\RecaptchaEnterprise\\V1beta1"; + + +// Service to determine the likelihood an event is legitimate. +service RecaptchaEnterpriseServiceV1Beta1 { + // Creates an Assessment of the likelihood an event is legitimate. + rpc CreateAssessment(CreateAssessmentRequest) returns (Assessment) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*}/assessments" + body: "assessment" + }; + } + + // Annotates a previously created Assessment to provide additional information + // on whether the event turned out to be authentic or fradulent. + rpc AnnotateAssessment(AnnotateAssessmentRequest) returns (AnnotateAssessmentResponse) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/assessments/*}:annotate" + body: "*" + }; + } +} + +// The create assessment request message. +message CreateAssessmentRequest { + // Required. The name of the project in which the assessment will be created, + // in the format "projects/{project_number}". + string parent = 1; + + // The asessment details. + Assessment assessment = 2; +} + +// The request message to annotate an Assessment. +message AnnotateAssessmentRequest { + // Enum that reprensents the types of annotations. + enum Annotation { + // Default unspecified type. + ANNOTATION_UNSPECIFIED = 0; + + // Provides information that the event turned out to be legitimate. + LEGITIMATE = 1; + + // Provides information that the event turned out to be fraudulent. + FRAUDULENT = 2; + } + + // Required. The resource name of the Assessment, in the format + // "projects/{project_number}/assessments/{assessment_id}". + string name = 1; + + // The annotation that will be assigned to the Event. + Annotation annotation = 2; +} + +// Empty response for AnnotateAssessment. +message AnnotateAssessmentResponse { + +} + +// A recaptcha assessment resource. +message Assessment { + // LINT.IfChange(classification_reason) + // Reasons contributing to the risk analysis verdict. + enum ClassificationReason { + // Default unspecified type. + CLASSIFICATION_REASON_UNSPECIFIED = 0; + + // The event appeared to be automated. + AUTOMATION = 1; + + // The event was not made from the proper context on the real site. + UNEXPECTED_ENVIRONMENT = 2; + + // Browsing behavior leading up to the event was generated was out of the + // ordinary. + UNEXPECTED_USAGE_PATTERNS = 4; + + // Too little traffic has been received from this site thus far to generate + // quality risk analysis. + PROVISIONAL_RISK_ANALYSIS = 5; + } + + // Output only. The resource name for the Assessment in the format + // "projects/{project_number}/assessments/{assessment_id}". + string name = 1; + + // The event being assessed. + Event event = 2; + + // Output only. 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). + float score = 3; + + // Output only. Properties of the provided event token. + TokenProperties token_properties = 4; + + // Output only. Reasons contributing to the risk analysis verdict. + repeated ClassificationReason reasons = 5; +} + +message Event { + // The user response token provided by the reCAPTCHA client-side integration + // on your site. + string token = 1; + + // The site key that was used to invoke reCAPTCHA on your site and generate + // the token. + string site_key = 2; +} + +message TokenProperties { + // Enum that represents the types of invalid token reasons. + enum InvalidReason { + // Default unspecified type. + INVALID_REASON_UNSPECIFIED = 0; + + // If the failure reason was not accounted for. + UNKNOWN_INVALID_REASON = 1; + + // The provided user verification token was malformed. + MALFORMED = 2; + + // The user verification token had expired. + EXPIRED = 3; + + // The user verification had already been seen. + DUPE = 4; + + // The user verification token did not match the provided site secret. + // This may be a configuration error (e.g. development keys used in + // production) or end users trying to use verification tokens from other + // sites. + SITE_MISMATCH = 5; + + // The user verification token was not present. It is a required input. + MISSING = 6; + } + + // Output only. Whether the provided user response token is valid. + bool valid = 1; + + // Output only. Reason associated with the response when valid = false. + InvalidReason invalid_reason = 2; + + // Output only. The timestamp corresponding to the generation of the token. + google.protobuf.Timestamp create_time = 3; + + // Output only. The hostname of the page on which the token was generated. + string hostname = 4; + + // Output only. Action name provided at token generation. + string action = 5; +} diff --git a/google-cloud-bom/pom.xml b/google-cloud-bom/pom.xml index 121eb5a08659..bd2e095768e9 100644 --- a/google-cloud-bom/pom.xml +++ b/google-cloud-bom/pom.xml @@ -1060,6 +1060,21 @@ google-cloud-webrisk 0.4.1-alpha-SNAPSHOT + + com.google.api.grpc + proto-google-cloud-recaptchaenterprise-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-recaptchaenterprise-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.cloud + google-cloud-recaptchaenterprise + 0.0.1-SNAPSHOT + diff --git a/google-cloud-clients/google-cloud-recaptchaenterprise/README.md b/google-cloud-clients/google-cloud-recaptchaenterprise/README.md new file mode 100644 index 000000000000..6f8961572d20 --- /dev/null +++ b/google-cloud-clients/google-cloud-recaptchaenterprise/README.md @@ -0,0 +1,100 @@ +Google Cloud Java Client for reCAPTCHA Enterprise +=================================================== + +Java idiomatic client for [reCAPTCHA Enterprise][product-overview]. + +[![Kokoro CI](http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/master.svg)](http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/master.html) +[![Maven](https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-recaptchaenterprise.svg)](https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-recaptchaenterprise.svg) +[![Codacy Badge](https://api.codacy.com/project/badge/grade/9da006ad7c3a4fe1abd142e77c003917)](https://www.codacy.com/app/mziccard/google-cloud-java) + +- [Product Documentation][product-docs] +- [Client Library Documentation][lib-docs] + +> Note: This client is a work-in-progress, and may occasionally +> make backwards-incompatible changes. + +Quickstart +---------- + +[//]: # ({x-version-update-start:google-cloud-recaptchaenterprise:released}) +If you are using Maven, add this to your pom.xml file +```xml + + com.google.cloud + google-cloud-recaptchaenterprise + 0.71.0-beta + +``` +If you are using Gradle, add this to your dependencies +```Groovy +compile 'com.google.cloud:google-cloud-recaptchaenterprise:0.71.0-beta' +``` +If you are using SBT, add this to your dependencies +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-recaptchaenterprise" % "0.71.0-beta" +``` +[//]: # ({x-version-update-end}) + +Authentication +-------------- + +See the [Authentication](https://github.com/googleapis/google-cloud-java#authentication) section in the base directory's README. + +About reCAPTCHA Enterprise +---------------------------- + +[reCAPTCHA Enterprise][product-overview] Help protect your website from fraudulent activity, spam, and abuse. + +See the [reCAPTCHA Enterprise client library docs][lib-docs] to learn how to use this reCAPTCHA Enterprise Client Library. + +Getting Started +--------------- +#### Prerequisites +You will need a [Google Developers Console](https://console.developers.google.com/) project with the reCAPTCHA Enterprise API enabled. [Follow these instructions](https://cloud.google.com/resource-manager/docs/creating-managing-projects) to get your project set up. You will also need to set up the local development environment by [installing the Google Cloud SDK](https://cloud.google.com/sdk/) and running the following commands in command line: `gcloud auth login` and `gcloud config set project [YOUR PROJECT ID]`. + +#### Installation and setup +You'll need to obtain the `google-cloud-recaptchaenterprise` library. See the [Quickstart](#quickstart) section to add `google-cloud-recaptchaenterprise` as a dependency in your code. + +Troubleshooting +--------------- + +To get help, follow the instructions in the [shared Troubleshooting document](https://github.com/googleapis/google-cloud-common/blob/master/troubleshooting/readme.md#troubleshooting). + +Transport +--------- +reCAPTCHA Enterprise uses gRPC for the transport layer. + +Java Versions +------------- + +Java 7 or above is required for using this client. + +Versioning +---------- + +This library follows [Semantic Versioning](http://semver.org/). + +It is currently in major version zero (``0.y.z``), which means that anything may change at any time and the public API should not be considered stable. + +Contributing +------------ + +Contributions to this library are always welcome and highly encouraged. + +See `google-cloud`'s [CONTRIBUTING] documentation and the [shared documentation](https://github.com/googleapis/google-cloud-common/blob/master/contributing/readme.md#how-to-contribute-to-gcloud) for more information on how to get started. + +Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See [Code of Conduct][code-of-conduct] for more information. + +License +------- + +Apache 2.0 - See [LICENSE] for more information. + + +[CONTRIBUTING]:https://github.com/googleapis/google-cloud-java/blob/master/CONTRIBUTING.md +[code-of-conduct]:https://github.com/googleapis/google-cloud-java/blob/master/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[LICENSE]: https://github.com/googleapis/google-cloud-java/blob/master/LICENSE +[cloud-platform]: https://cloud.google.com/ +[product-overview]: https://cloud.google.com/recaptcha-enterprise/ +[product-docs]: https://cloud.google.com/recaptcha-enterprise/docs/ +[lib-docs]: https://googleapis.github.io/google-cloud-java/google-cloud-clients/apidocs/index.html?com/google/cloud/recaptchaenterprise/v1beta1/package-summary.html \ No newline at end of file diff --git a/google-cloud-clients/google-cloud-recaptchaenterprise/pom.xml b/google-cloud-clients/google-cloud-recaptchaenterprise/pom.xml new file mode 100644 index 000000000000..9d0f71b9453d --- /dev/null +++ b/google-cloud-clients/google-cloud-recaptchaenterprise/pom.xml @@ -0,0 +1,113 @@ + + + 4.0.0 + google-cloud-recaptchaenterprise + 0.0.1-SNAPSHOT + jar + reCAPTCHA Enterprise + https://github.com/googleapis/google-cloud-java/tree/master/google-cloud-clients/google-cloud-recaptchaenterprise + + Help protect your website from fraudulent activity, spam, and abuse. + + + com.google.cloud + google-cloud-clients + 0.0.1-SNAPSHOT + + + google-cloud-recaptchaenterprise + + + + ${project.groupId} + google-cloud-core + + + ${project.groupId} + google-cloud-core-grpc + + + com.google.api.grpc + proto-google-cloud-recaptchaenterprise-v1beta1 + + + com.google.api.grpc + grpc-google-cloud-recaptchaenterprise-v1beta1 + + + io.grpc + grpc-netty-shaded + + + io.grpc + grpc-stub + + + io.grpc + grpc-auth + + + ${project.groupId} + google-cloud-core + test-jar + test + + + junit + junit + test + + + org.easymock + easymock + test + + + org.objenesis + objenesis + test + + + com.google.truth + truth + test + + + com.google.api.grpc + grpc-google-iam-v1 + test + + + com.google.api + gax-grpc + testlib + test + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.1.0 + + protected + true + none + true + + + ${project.javadoc.protobufBaseURL} + ../../../../../google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/target/site/apidocs/ + + + ${project.javadoc.protobufBaseURL} + ../../../../../google-api-grpc/grpc-google-cloud-recaptchaenterprise-v1beta1/target/site/apidocs/ + + + + + + + \ No newline at end of file diff --git a/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Client.java b/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Client.java new file mode 100644 index 000000000000..af4b06b1459e --- /dev/null +++ b/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Client.java @@ -0,0 +1,404 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.recaptchaenterprise.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.recaptchaenterprise.v1beta1.stub.RecaptchaEnterpriseServiceV1Beta1Stub; +import com.google.cloud.recaptchaenterprise.v1beta1.stub.RecaptchaEnterpriseServiceV1Beta1StubSettings; +import com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest; +import com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse; +import com.google.recaptchaenterprise.v1beta1.Assessment; +import com.google.recaptchaenterprise.v1beta1.AssessmentName; +import com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest; +import com.google.recaptchaenterprise.v1beta1.ProjectName; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND SERVICE +/** + * Service Description: Service to determine the likelihood an event is legitimate. + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

+ * 
+ * try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   Assessment assessment = Assessment.newBuilder().build();
+ *   Assessment response = recaptchaEnterpriseServiceV1Beta1Client.createAssessment(parent, assessment);
+ * }
+ * 
+ * 
+ * + *

Note: close() needs to be called on the recaptchaEnterpriseServiceV1Beta1Client object to + * clean up resources such as threads. In the example above, try-with-resources is used, which + * automatically calls close(). + * + *

The surface of this class includes several types of Java methods for each of the API's + * methods: + * + *

    + *
  1. A "flattened" method. With this type of method, the fields of the request type have been + * converted into function parameters. It may be the case that not all fields are available as + * parameters, and not every API method will have a flattened method entry point. + *
  2. A "request object" method. This type of method only takes one parameter, a request object, + * which must be constructed before the call. Not every API method will have a request object + * method. + *
  3. A "callable" method. This type of method takes no parameters and returns an immutable API + * callable object, which can be used to initiate calls to the service. + *
+ * + *

See the individual methods for example code. + * + *

Many parameters require resource names to be formatted in a particular way. To assist with + * these names, this class includes a format method for each type of name, and additionally a parse + * method to extract the individual identifiers contained within names that are returned. + * + *

This class can be customized by passing in a custom instance of + * RecaptchaEnterpriseServiceV1Beta1Settings to create(). For example: + * + *

To customize credentials: + * + *

+ * 
+ * RecaptchaEnterpriseServiceV1Beta1Settings recaptchaEnterpriseServiceV1Beta1Settings =
+ *     RecaptchaEnterpriseServiceV1Beta1Settings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client =
+ *     RecaptchaEnterpriseServiceV1Beta1Client.create(recaptchaEnterpriseServiceV1Beta1Settings);
+ * 
+ * 
+ * + * To customize the endpoint: + * + *
+ * 
+ * RecaptchaEnterpriseServiceV1Beta1Settings recaptchaEnterpriseServiceV1Beta1Settings =
+ *     RecaptchaEnterpriseServiceV1Beta1Settings.newBuilder().setEndpoint(myEndpoint).build();
+ * RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client =
+ *     RecaptchaEnterpriseServiceV1Beta1Client.create(recaptchaEnterpriseServiceV1Beta1Settings);
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class RecaptchaEnterpriseServiceV1Beta1Client implements BackgroundResource { + private final RecaptchaEnterpriseServiceV1Beta1Settings settings; + private final RecaptchaEnterpriseServiceV1Beta1Stub stub; + + /** Constructs an instance of RecaptchaEnterpriseServiceV1Beta1Client with default settings. */ + public static final RecaptchaEnterpriseServiceV1Beta1Client create() throws IOException { + return create(RecaptchaEnterpriseServiceV1Beta1Settings.newBuilder().build()); + } + + /** + * Constructs an instance of RecaptchaEnterpriseServiceV1Beta1Client, using the given settings. + * The channels are created based on the settings passed in, or defaults for any settings that are + * not set. + */ + public static final RecaptchaEnterpriseServiceV1Beta1Client create( + RecaptchaEnterpriseServiceV1Beta1Settings settings) throws IOException { + return new RecaptchaEnterpriseServiceV1Beta1Client(settings); + } + + /** + * Constructs an instance of RecaptchaEnterpriseServiceV1Beta1Client, using the given stub for + * making calls. This is for advanced usage - prefer to use + * RecaptchaEnterpriseServiceV1Beta1Settings}. + */ + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public static final RecaptchaEnterpriseServiceV1Beta1Client create( + RecaptchaEnterpriseServiceV1Beta1Stub stub) { + return new RecaptchaEnterpriseServiceV1Beta1Client(stub); + } + + /** + * Constructs an instance of RecaptchaEnterpriseServiceV1Beta1Client, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static factory + * methods should be preferred. + */ + protected RecaptchaEnterpriseServiceV1Beta1Client( + RecaptchaEnterpriseServiceV1Beta1Settings settings) throws IOException { + this.settings = settings; + this.stub = + ((RecaptchaEnterpriseServiceV1Beta1StubSettings) settings.getStubSettings()).createStub(); + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + protected RecaptchaEnterpriseServiceV1Beta1Client(RecaptchaEnterpriseServiceV1Beta1Stub stub) { + this.settings = null; + this.stub = stub; + } + + public final RecaptchaEnterpriseServiceV1Beta1Settings getSettings() { + return settings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RecaptchaEnterpriseServiceV1Beta1Stub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an Assessment of the likelihood an event is legitimate. + * + *

Sample code: + * + *


+   * try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Assessment assessment = Assessment.newBuilder().build();
+   *   Assessment response = recaptchaEnterpriseServiceV1Beta1Client.createAssessment(parent, assessment);
+   * }
+   * 
+ * + * @param parent Required. The name of the project in which the assessment will be created, in the + * format "projects/{project_number}". + * @param assessment The asessment details. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Assessment createAssessment(ProjectName parent, Assessment assessment) { + + CreateAssessmentRequest request = + CreateAssessmentRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setAssessment(assessment) + .build(); + return createAssessment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an Assessment of the likelihood an event is legitimate. + * + *

Sample code: + * + *


+   * try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Assessment assessment = Assessment.newBuilder().build();
+   *   Assessment response = recaptchaEnterpriseServiceV1Beta1Client.createAssessment(parent.toString(), assessment);
+   * }
+   * 
+ * + * @param parent Required. The name of the project in which the assessment will be created, in the + * format "projects/{project_number}". + * @param assessment The asessment details. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Assessment createAssessment(String parent, Assessment assessment) { + + CreateAssessmentRequest request = + CreateAssessmentRequest.newBuilder().setParent(parent).setAssessment(assessment).build(); + return createAssessment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an Assessment of the likelihood an event is legitimate. + * + *

Sample code: + * + *


+   * try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Assessment assessment = Assessment.newBuilder().build();
+   *   CreateAssessmentRequest request = CreateAssessmentRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setAssessment(assessment)
+   *     .build();
+   *   Assessment response = recaptchaEnterpriseServiceV1Beta1Client.createAssessment(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Assessment createAssessment(CreateAssessmentRequest request) { + return createAssessmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates an Assessment of the likelihood an event is legitimate. + * + *

Sample code: + * + *


+   * try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Assessment assessment = Assessment.newBuilder().build();
+   *   CreateAssessmentRequest request = CreateAssessmentRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setAssessment(assessment)
+   *     .build();
+   *   ApiFuture<Assessment> future = recaptchaEnterpriseServiceV1Beta1Client.createAssessmentCallable().futureCall(request);
+   *   // Do something
+   *   Assessment response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createAssessmentCallable() { + return stub.createAssessmentCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Annotates a previously created Assessment to provide additional information on whether the + * event turned out to be authentic or fradulent. + * + *

Sample code: + * + *


+   * try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
+   *   AssessmentName name = AssessmentName.of("[PROJECT]", "[ASSESSMENT]");
+   *   AnnotateAssessmentRequest.Annotation annotation = AnnotateAssessmentRequest.Annotation.ANNOTATION_UNSPECIFIED;
+   *   AnnotateAssessmentResponse response = recaptchaEnterpriseServiceV1Beta1Client.annotateAssessment(name, annotation);
+   * }
+   * 
+ * + * @param name Required. The resource name of the Assessment, in the format + * "projects/{project_number}/assessments/{assessment_id}". + * @param annotation The annotation that will be assigned to the Event. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AnnotateAssessmentResponse annotateAssessment( + AssessmentName name, AnnotateAssessmentRequest.Annotation annotation) { + + AnnotateAssessmentRequest request = + AnnotateAssessmentRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .setAnnotation(annotation) + .build(); + return annotateAssessment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Annotates a previously created Assessment to provide additional information on whether the + * event turned out to be authentic or fradulent. + * + *

Sample code: + * + *


+   * try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
+   *   AssessmentName name = AssessmentName.of("[PROJECT]", "[ASSESSMENT]");
+   *   AnnotateAssessmentRequest.Annotation annotation = AnnotateAssessmentRequest.Annotation.ANNOTATION_UNSPECIFIED;
+   *   AnnotateAssessmentResponse response = recaptchaEnterpriseServiceV1Beta1Client.annotateAssessment(name.toString(), annotation);
+   * }
+   * 
+ * + * @param name Required. The resource name of the Assessment, in the format + * "projects/{project_number}/assessments/{assessment_id}". + * @param annotation The annotation that will be assigned to the Event. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AnnotateAssessmentResponse annotateAssessment( + String name, AnnotateAssessmentRequest.Annotation annotation) { + + AnnotateAssessmentRequest request = + AnnotateAssessmentRequest.newBuilder().setName(name).setAnnotation(annotation).build(); + return annotateAssessment(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Annotates a previously created Assessment to provide additional information on whether the + * event turned out to be authentic or fradulent. + * + *

Sample code: + * + *


+   * try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
+   *   AssessmentName name = AssessmentName.of("[PROJECT]", "[ASSESSMENT]");
+   *   AnnotateAssessmentRequest.Annotation annotation = AnnotateAssessmentRequest.Annotation.ANNOTATION_UNSPECIFIED;
+   *   AnnotateAssessmentRequest request = AnnotateAssessmentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setAnnotation(annotation)
+   *     .build();
+   *   AnnotateAssessmentResponse response = recaptchaEnterpriseServiceV1Beta1Client.annotateAssessment(request);
+   * }
+   * 
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final AnnotateAssessmentResponse annotateAssessment(AnnotateAssessmentRequest request) { + return annotateAssessmentCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Annotates a previously created Assessment to provide additional information on whether the + * event turned out to be authentic or fradulent. + * + *

Sample code: + * + *


+   * try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
+   *   AssessmentName name = AssessmentName.of("[PROJECT]", "[ASSESSMENT]");
+   *   AnnotateAssessmentRequest.Annotation annotation = AnnotateAssessmentRequest.Annotation.ANNOTATION_UNSPECIFIED;
+   *   AnnotateAssessmentRequest request = AnnotateAssessmentRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .setAnnotation(annotation)
+   *     .build();
+   *   ApiFuture<AnnotateAssessmentResponse> future = recaptchaEnterpriseServiceV1Beta1Client.annotateAssessmentCallable().futureCall(request);
+   *   // Do something
+   *   AnnotateAssessmentResponse response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable + annotateAssessmentCallable() { + return stub.annotateAssessmentCallable(); + } + + @Override + public final void close() { + stub.close(); + } + + @Override + public void shutdown() { + stub.shutdown(); + } + + @Override + public boolean isShutdown() { + return stub.isShutdown(); + } + + @Override + public boolean isTerminated() { + return stub.isTerminated(); + } + + @Override + public void shutdownNow() { + stub.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return stub.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Settings.java b/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Settings.java new file mode 100644 index 000000000000..5b6a38fd06ff --- /dev/null +++ b/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Settings.java @@ -0,0 +1,196 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.recaptchaenterprise.v1beta1; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.cloud.recaptchaenterprise.v1beta1.stub.RecaptchaEnterpriseServiceV1Beta1StubSettings; +import com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest; +import com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse; +import com.google.recaptchaenterprise.v1beta1.Assessment; +import com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RecaptchaEnterpriseServiceV1Beta1Client}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (recaptchaenterprise.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of createAssessment to 30 seconds: + * + *

+ * 
+ * RecaptchaEnterpriseServiceV1Beta1Settings.Builder recaptchaEnterpriseServiceV1Beta1SettingsBuilder =
+ *     RecaptchaEnterpriseServiceV1Beta1Settings.newBuilder();
+ * recaptchaEnterpriseServiceV1Beta1SettingsBuilder.createAssessmentSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RecaptchaEnterpriseServiceV1Beta1Settings recaptchaEnterpriseServiceV1Beta1Settings = recaptchaEnterpriseServiceV1Beta1SettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class RecaptchaEnterpriseServiceV1Beta1Settings + extends ClientSettings { + /** Returns the object with the settings used for calls to createAssessment. */ + public UnaryCallSettings createAssessmentSettings() { + return ((RecaptchaEnterpriseServiceV1Beta1StubSettings) getStubSettings()) + .createAssessmentSettings(); + } + + /** Returns the object with the settings used for calls to annotateAssessment. */ + public UnaryCallSettings + annotateAssessmentSettings() { + return ((RecaptchaEnterpriseServiceV1Beta1StubSettings) getStubSettings()) + .annotateAssessmentSettings(); + } + + public static final RecaptchaEnterpriseServiceV1Beta1Settings create( + RecaptchaEnterpriseServiceV1Beta1StubSettings stub) throws IOException { + return new RecaptchaEnterpriseServiceV1Beta1Settings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return RecaptchaEnterpriseServiceV1Beta1StubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return RecaptchaEnterpriseServiceV1Beta1StubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return RecaptchaEnterpriseServiceV1Beta1StubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return RecaptchaEnterpriseServiceV1Beta1StubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return RecaptchaEnterpriseServiceV1Beta1StubSettings.defaultGrpcTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return RecaptchaEnterpriseServiceV1Beta1StubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return RecaptchaEnterpriseServiceV1Beta1StubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RecaptchaEnterpriseServiceV1Beta1Settings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for RecaptchaEnterpriseServiceV1Beta1Settings. */ + public static class Builder + extends ClientSettings.Builder { + protected Builder() throws IOException { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(RecaptchaEnterpriseServiceV1Beta1StubSettings.newBuilder(clientContext)); + } + + private static Builder createDefault() { + return new Builder(RecaptchaEnterpriseServiceV1Beta1StubSettings.newBuilder()); + } + + protected Builder(RecaptchaEnterpriseServiceV1Beta1Settings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(RecaptchaEnterpriseServiceV1Beta1StubSettings.Builder stubSettings) { + super(stubSettings); + } + + public RecaptchaEnterpriseServiceV1Beta1StubSettings.Builder getStubSettingsBuilder() { + return ((RecaptchaEnterpriseServiceV1Beta1StubSettings.Builder) getStubSettings()); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods( + getStubSettingsBuilder().unaryMethodSettingsBuilders(), settingsUpdater); + return this; + } + + /** Returns the builder for the settings used for calls to createAssessment. */ + public UnaryCallSettings.Builder + createAssessmentSettings() { + return getStubSettingsBuilder().createAssessmentSettings(); + } + + /** Returns the builder for the settings used for calls to annotateAssessment. */ + public UnaryCallSettings.Builder + annotateAssessmentSettings() { + return getStubSettingsBuilder().annotateAssessmentSettings(); + } + + @Override + public RecaptchaEnterpriseServiceV1Beta1Settings build() throws IOException { + return new RecaptchaEnterpriseServiceV1Beta1Settings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/package-info.java b/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/package-info.java new file mode 100644 index 000000000000..7347310bcc63 --- /dev/null +++ b/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/package-info.java @@ -0,0 +1,39 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * A client to reCAPTCHA Enterprise API. + * + *

The interfaces provided are listed below, along with usage samples. + * + *

======================================= RecaptchaEnterpriseServiceV1Beta1Client + * ======================================= + * + *

Service Description: Service to determine the likelihood an event is legitimate. + * + *

Sample for RecaptchaEnterpriseServiceV1Beta1Client: + * + *

+ * 
+ * try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
+ *   ProjectName parent = ProjectName.of("[PROJECT]");
+ *   Assessment assessment = Assessment.newBuilder().build();
+ *   Assessment response = recaptchaEnterpriseServiceV1Beta1Client.createAssessment(parent, assessment);
+ * }
+ * 
+ * 
+ */ +package com.google.cloud.recaptchaenterprise.v1beta1; diff --git a/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/GrpcRecaptchaEnterpriseServiceV1Beta1CallableFactory.java b/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/GrpcRecaptchaEnterpriseServiceV1Beta1CallableFactory.java new file mode 100644 index 000000000000..691c3f51fb0c --- /dev/null +++ b/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/GrpcRecaptchaEnterpriseServiceV1Beta1CallableFactory.java @@ -0,0 +1,116 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.recaptchaenterprise.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcCallableFactory; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.BidiStreamingCallable; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.ClientStreamingCallable; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.StreamingCallSettings; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.stub.OperationsStub; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC callable factory implementation for reCAPTCHA Enterprise API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator") +@BetaApi("The surface for use by generated code is not stable yet and may change in the future.") +public class GrpcRecaptchaEnterpriseServiceV1Beta1CallableFactory + implements GrpcStubCallableFactory { + @Override + public UnaryCallable createUnaryCallable( + GrpcCallSettings grpcCallSettings, + UnaryCallSettings callSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createUnaryCallable(grpcCallSettings, callSettings, clientContext); + } + + @Override + public + UnaryCallable createPagedCallable( + GrpcCallSettings grpcCallSettings, + PagedCallSettings pagedCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createPagedCallable( + grpcCallSettings, pagedCallSettings, clientContext); + } + + @Override + public UnaryCallable createBatchingCallable( + GrpcCallSettings grpcCallSettings, + BatchingCallSettings batchingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBatchingCallable( + grpcCallSettings, batchingCallSettings, clientContext); + } + + @BetaApi( + "The surface for long-running operations is not stable yet and may change in the future.") + @Override + public + OperationCallable createOperationCallable( + GrpcCallSettings grpcCallSettings, + OperationCallSettings operationCallSettings, + ClientContext clientContext, + OperationsStub operationsStub) { + return GrpcCallableFactory.createOperationCallable( + grpcCallSettings, operationCallSettings, clientContext, operationsStub); + } + + @Override + public + BidiStreamingCallable createBidiStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createBidiStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ServerStreamingCallable createServerStreamingCallable( + GrpcCallSettings grpcCallSettings, + ServerStreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createServerStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } + + @Override + public + ClientStreamingCallable createClientStreamingCallable( + GrpcCallSettings grpcCallSettings, + StreamingCallSettings streamingCallSettings, + ClientContext clientContext) { + return GrpcCallableFactory.createClientStreamingCallable( + grpcCallSettings, streamingCallSettings, clientContext); + } +} diff --git a/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/GrpcRecaptchaEnterpriseServiceV1Beta1Stub.java b/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/GrpcRecaptchaEnterpriseServiceV1Beta1Stub.java new file mode 100644 index 000000000000..7dd11c80a647 --- /dev/null +++ b/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/GrpcRecaptchaEnterpriseServiceV1Beta1Stub.java @@ -0,0 +1,199 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.recaptchaenterprise.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.core.BackgroundResourceAggregation; +import com.google.api.gax.grpc.GrpcCallSettings; +import com.google.api.gax.grpc.GrpcStubCallableFactory; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.RequestParamsExtractor; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.common.collect.ImmutableMap; +import com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest; +import com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse; +import com.google.recaptchaenterprise.v1beta1.Assessment; +import com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest; +import io.grpc.MethodDescriptor; +import io.grpc.protobuf.ProtoUtils; +import java.io.IOException; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * gRPC stub implementation for reCAPTCHA Enterprise API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public class GrpcRecaptchaEnterpriseServiceV1Beta1Stub + extends RecaptchaEnterpriseServiceV1Beta1Stub { + + private static final MethodDescriptor + createAssessmentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1/CreateAssessment") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateAssessmentRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Assessment.getDefaultInstance())) + .build(); + private static final MethodDescriptor + annotateAssessmentMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1/AnnotateAssessment") + .setRequestMarshaller( + ProtoUtils.marshaller(AnnotateAssessmentRequest.getDefaultInstance())) + .setResponseMarshaller( + ProtoUtils.marshaller(AnnotateAssessmentResponse.getDefaultInstance())) + .build(); + + private final BackgroundResource backgroundResources; + + private final UnaryCallable createAssessmentCallable; + private final UnaryCallable + annotateAssessmentCallable; + + private final GrpcStubCallableFactory callableFactory; + + public static final GrpcRecaptchaEnterpriseServiceV1Beta1Stub create( + RecaptchaEnterpriseServiceV1Beta1StubSettings settings) throws IOException { + return new GrpcRecaptchaEnterpriseServiceV1Beta1Stub(settings, ClientContext.create(settings)); + } + + public static final GrpcRecaptchaEnterpriseServiceV1Beta1Stub create(ClientContext clientContext) + throws IOException { + return new GrpcRecaptchaEnterpriseServiceV1Beta1Stub( + RecaptchaEnterpriseServiceV1Beta1StubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcRecaptchaEnterpriseServiceV1Beta1Stub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcRecaptchaEnterpriseServiceV1Beta1Stub( + RecaptchaEnterpriseServiceV1Beta1StubSettings.newBuilder().build(), + clientContext, + callableFactory); + } + + /** + * Constructs an instance of GrpcRecaptchaEnterpriseServiceV1Beta1Stub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static factory + * methods should be preferred. + */ + protected GrpcRecaptchaEnterpriseServiceV1Beta1Stub( + RecaptchaEnterpriseServiceV1Beta1StubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new GrpcRecaptchaEnterpriseServiceV1Beta1CallableFactory()); + } + + /** + * Constructs an instance of GrpcRecaptchaEnterpriseServiceV1Beta1Stub, using the given settings. + * This is protected so that it is easy to make a subclass, but otherwise, the static factory + * methods should be preferred. + */ + protected GrpcRecaptchaEnterpriseServiceV1Beta1Stub( + RecaptchaEnterpriseServiceV1Beta1StubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + + GrpcCallSettings createAssessmentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createAssessmentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateAssessmentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings + annotateAssessmentTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(annotateAssessmentMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(AnnotateAssessmentRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + + this.createAssessmentCallable = + callableFactory.createUnaryCallable( + createAssessmentTransportSettings, settings.createAssessmentSettings(), clientContext); + this.annotateAssessmentCallable = + callableFactory.createUnaryCallable( + annotateAssessmentTransportSettings, + settings.annotateAssessmentSettings(), + clientContext); + + backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + public UnaryCallable createAssessmentCallable() { + return createAssessmentCallable; + } + + public UnaryCallable + annotateAssessmentCallable() { + return annotateAssessmentCallable; + } + + @Override + public final void close() { + shutdown(); + } + + @Override + public void shutdown() { + backgroundResources.shutdown(); + } + + @Override + public boolean isShutdown() { + return backgroundResources.isShutdown(); + } + + @Override + public boolean isTerminated() { + return backgroundResources.isTerminated(); + } + + @Override + public void shutdownNow() { + backgroundResources.shutdownNow(); + } + + @Override + public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { + return backgroundResources.awaitTermination(duration, unit); + } +} diff --git a/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/RecaptchaEnterpriseServiceV1Beta1Stub.java b/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/RecaptchaEnterpriseServiceV1Beta1Stub.java new file mode 100644 index 000000000000..218b0fd17078 --- /dev/null +++ b/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/RecaptchaEnterpriseServiceV1Beta1Stub.java @@ -0,0 +1,48 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.recaptchaenterprise.v1beta1.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest; +import com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse; +import com.google.recaptchaenterprise.v1beta1.Assessment; +import com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Base stub class for reCAPTCHA Enterprise API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator") +@BetaApi("A restructuring of stub classes is planned, so this may break in the future") +public abstract class RecaptchaEnterpriseServiceV1Beta1Stub implements BackgroundResource { + + public UnaryCallable createAssessmentCallable() { + throw new UnsupportedOperationException("Not implemented: createAssessmentCallable()"); + } + + public UnaryCallable + annotateAssessmentCallable() { + throw new UnsupportedOperationException("Not implemented: annotateAssessmentCallable()"); + } + + @Override + public abstract void close(); +} diff --git a/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/RecaptchaEnterpriseServiceV1Beta1StubSettings.java b/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/RecaptchaEnterpriseServiceV1Beta1StubSettings.java new file mode 100644 index 000000000000..5c7681ef0d44 --- /dev/null +++ b/google-cloud-clients/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/RecaptchaEnterpriseServiceV1Beta1StubSettings.java @@ -0,0 +1,300 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.recaptchaenterprise.v1beta1.stub; + +import com.google.api.core.ApiFunction; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.GaxProperties; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.GrpcTransportChannel; +import com.google.api.gax.grpc.InstantiatingGrpcChannelProvider; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.StatusCode; +import com.google.api.gax.rpc.StubSettings; +import com.google.api.gax.rpc.TransportChannelProvider; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest; +import com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse; +import com.google.recaptchaenterprise.v1beta1.Assessment; +import com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; +import org.threeten.bp.Duration; + +// AUTO-GENERATED DOCUMENTATION AND CLASS +/** + * Settings class to configure an instance of {@link RecaptchaEnterpriseServiceV1Beta1Stub}. + * + *

The default instance has everything set to sensible defaults: + * + *

    + *
  • The default service address (recaptchaenterprise.googleapis.com) and default port (443) are + * used. + *
  • Credentials are acquired automatically through Application Default Credentials. + *
  • Retries are configured for idempotent methods but not for non-idempotent methods. + *
+ * + *

The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. For + * example, to set the total timeout of createAssessment to 30 seconds: + * + *

+ * 
+ * RecaptchaEnterpriseServiceV1Beta1StubSettings.Builder recaptchaEnterpriseServiceV1Beta1SettingsBuilder =
+ *     RecaptchaEnterpriseServiceV1Beta1StubSettings.newBuilder();
+ * recaptchaEnterpriseServiceV1Beta1SettingsBuilder.createAssessmentSettings().getRetrySettings().toBuilder()
+ *     .setTotalTimeout(Duration.ofSeconds(30));
+ * RecaptchaEnterpriseServiceV1Beta1StubSettings recaptchaEnterpriseServiceV1Beta1Settings = recaptchaEnterpriseServiceV1Beta1SettingsBuilder.build();
+ * 
+ * 
+ */ +@Generated("by gapic-generator") +@BetaApi +public class RecaptchaEnterpriseServiceV1Beta1StubSettings + extends StubSettings { + /** The default scopes of the service. */ + private static final ImmutableList DEFAULT_SERVICE_SCOPES = + ImmutableList.builder().add("https://www.googleapis.com/auth/cloud-platform").build(); + + private final UnaryCallSettings createAssessmentSettings; + private final UnaryCallSettings + annotateAssessmentSettings; + + /** Returns the object with the settings used for calls to createAssessment. */ + public UnaryCallSettings createAssessmentSettings() { + return createAssessmentSettings; + } + + /** Returns the object with the settings used for calls to annotateAssessment. */ + public UnaryCallSettings + annotateAssessmentSettings() { + return annotateAssessmentSettings; + } + + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") + public RecaptchaEnterpriseServiceV1Beta1Stub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcRecaptchaEnterpriseServiceV1Beta1Stub.create(this); + } else { + throw new UnsupportedOperationException( + "Transport not supported: " + getTransportChannelProvider().getTransportName()); + } + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return "recaptchaenterprise.googleapis.com:443"; + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return DEFAULT_SERVICE_SCOPES; + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return GoogleCredentialsProvider.newBuilder().setScopesToApply(DEFAULT_SERVICE_SCOPES); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return InstantiatingGrpcChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultGrpcTransportProviderBuilder().build(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", + GaxProperties.getLibraryVersion(RecaptchaEnterpriseServiceV1Beta1StubSettings.class)) + .setTransportToken( + GaxGrpcProperties.getGrpcTokenName(), GaxGrpcProperties.getGrpcVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder(ClientContext clientContext) { + return new Builder(clientContext); + } + + /** Returns a builder containing all the values of this settings class. */ + public Builder toBuilder() { + return new Builder(this); + } + + protected RecaptchaEnterpriseServiceV1Beta1StubSettings(Builder settingsBuilder) + throws IOException { + super(settingsBuilder); + + createAssessmentSettings = settingsBuilder.createAssessmentSettings().build(); + annotateAssessmentSettings = settingsBuilder.annotateAssessmentSettings().build(); + } + + /** Builder for RecaptchaEnterpriseServiceV1Beta1StubSettings. */ + public static class Builder + extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + + private final UnaryCallSettings.Builder + createAssessmentSettings; + private final UnaryCallSettings.Builder + annotateAssessmentSettings; + + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "idempotent", + ImmutableSet.copyOf( + Lists.newArrayList( + StatusCode.Code.DEADLINE_EXCEEDED, StatusCode.Code.UNAVAILABLE))); + definitions.put("non_idempotent", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(100L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelay(Duration.ofMillis(60000L)) + .setInitialRpcTimeout(Duration.ofMillis(20000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(20000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("default", settings); + RETRY_PARAM_DEFINITIONS = definitions.build(); + } + + protected Builder() { + this((ClientContext) null); + } + + protected Builder(ClientContext clientContext) { + super(clientContext); + + createAssessmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + annotateAssessmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createAssessmentSettings, annotateAssessmentSettings); + + initDefaults(this); + } + + private static Builder createDefault() { + Builder builder = new Builder((ClientContext) null); + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setEndpoint(getDefaultEndpoint()); + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + + builder + .createAssessmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .annotateAssessmentSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + return builder; + } + + protected Builder(RecaptchaEnterpriseServiceV1Beta1StubSettings settings) { + super(settings); + + createAssessmentSettings = settings.createAssessmentSettings.toBuilder(); + annotateAssessmentSettings = settings.annotateAssessmentSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + createAssessmentSettings, annotateAssessmentSettings); + } + + // NEXT_MAJOR_VER: remove 'throws Exception' + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) throws Exception { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to createAssessment. */ + public UnaryCallSettings.Builder + createAssessmentSettings() { + return createAssessmentSettings; + } + + /** Returns the builder for the settings used for calls to annotateAssessment. */ + public UnaryCallSettings.Builder + annotateAssessmentSettings() { + return annotateAssessmentSettings; + } + + @Override + public RecaptchaEnterpriseServiceV1Beta1StubSettings build() throws IOException { + return new RecaptchaEnterpriseServiceV1Beta1StubSettings(this); + } + } +} diff --git a/google-cloud-clients/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1beta1/MockRecaptchaEnterpriseServiceV1Beta1.java b/google-cloud-clients/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1beta1/MockRecaptchaEnterpriseServiceV1Beta1.java new file mode 100644 index 000000000000..51facf40c80c --- /dev/null +++ b/google-cloud-clients/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1beta1/MockRecaptchaEnterpriseServiceV1Beta1.java @@ -0,0 +1,57 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.recaptchaenterprise.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.protobuf.AbstractMessage; +import io.grpc.ServerServiceDefinition; +import java.util.List; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockRecaptchaEnterpriseServiceV1Beta1 implements MockGrpcService { + private final MockRecaptchaEnterpriseServiceV1Beta1Impl serviceImpl; + + public MockRecaptchaEnterpriseServiceV1Beta1() { + serviceImpl = new MockRecaptchaEnterpriseServiceV1Beta1Impl(); + } + + @Override + public List getRequests() { + return serviceImpl.getRequests(); + } + + @Override + public void addResponse(AbstractMessage response) { + serviceImpl.addResponse(response); + } + + @Override + public void addException(Exception exception) { + serviceImpl.addException(exception); + } + + @Override + public ServerServiceDefinition getServiceDefinition() { + return serviceImpl.bindService(); + } + + @Override + public void reset() { + serviceImpl.reset(); + } +} diff --git a/google-cloud-clients/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1beta1/MockRecaptchaEnterpriseServiceV1Beta1Impl.java b/google-cloud-clients/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1beta1/MockRecaptchaEnterpriseServiceV1Beta1Impl.java new file mode 100644 index 000000000000..58d009595a50 --- /dev/null +++ b/google-cloud-clients/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1beta1/MockRecaptchaEnterpriseServiceV1Beta1Impl.java @@ -0,0 +1,94 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.recaptchaenterprise.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.protobuf.AbstractMessage; +import com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest; +import com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse; +import com.google.recaptchaenterprise.v1beta1.Assessment; +import com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest; +import com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Grpc.RecaptchaEnterpriseServiceV1Beta1ImplBase; +import io.grpc.stub.StreamObserver; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Queue; + +@javax.annotation.Generated("by GAPIC") +@BetaApi +public class MockRecaptchaEnterpriseServiceV1Beta1Impl + extends RecaptchaEnterpriseServiceV1Beta1ImplBase { + private List requests; + private Queue responses; + + public MockRecaptchaEnterpriseServiceV1Beta1Impl() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + public List getRequests() { + return requests; + } + + public void addResponse(AbstractMessage response) { + responses.add(response); + } + + public void setResponses(List responses) { + this.responses = new LinkedList(responses); + } + + public void addException(Exception exception) { + responses.add(exception); + } + + public void reset() { + requests = new ArrayList<>(); + responses = new LinkedList<>(); + } + + @Override + public void createAssessment( + CreateAssessmentRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Assessment) { + requests.add(request); + responseObserver.onNext((Assessment) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void annotateAssessment( + AnnotateAssessmentRequest request, + StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof AnnotateAssessmentResponse) { + requests.add(request); + responseObserver.onNext((AnnotateAssessmentResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } +} diff --git a/google-cloud-clients/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1ClientTest.java b/google-cloud-clients/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1ClientTest.java new file mode 100644 index 000000000000..9137f20ada30 --- /dev/null +++ b/google-cloud-clients/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1ClientTest.java @@ -0,0 +1,167 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.recaptchaenterprise.v1beta1; + +import com.google.api.gax.core.NoCredentialsProvider; +import com.google.api.gax.grpc.GaxGrpcProperties; +import com.google.api.gax.grpc.testing.LocalChannelProvider; +import com.google.api.gax.grpc.testing.MockGrpcService; +import com.google.api.gax.grpc.testing.MockServiceHelper; +import com.google.api.gax.rpc.ApiClientHeaderProvider; +import com.google.api.gax.rpc.InvalidArgumentException; +import com.google.protobuf.AbstractMessage; +import com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest; +import com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse; +import com.google.recaptchaenterprise.v1beta1.Assessment; +import com.google.recaptchaenterprise.v1beta1.AssessmentName; +import com.google.recaptchaenterprise.v1beta1.CreateAssessmentRequest; +import com.google.recaptchaenterprise.v1beta1.ProjectName; +import io.grpc.Status; +import io.grpc.StatusRuntimeException; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +@javax.annotation.Generated("by GAPIC") +public class RecaptchaEnterpriseServiceV1Beta1ClientTest { + private static MockRecaptchaEnterpriseServiceV1Beta1 mockRecaptchaEnterpriseServiceV1Beta1; + private static MockServiceHelper serviceHelper; + private RecaptchaEnterpriseServiceV1Beta1Client client; + private LocalChannelProvider channelProvider; + + @BeforeClass + public static void startStaticServer() { + mockRecaptchaEnterpriseServiceV1Beta1 = new MockRecaptchaEnterpriseServiceV1Beta1(); + serviceHelper = + new MockServiceHelper( + "in-process-1", Arrays.asList(mockRecaptchaEnterpriseServiceV1Beta1)); + serviceHelper.start(); + } + + @AfterClass + public static void stopServer() { + serviceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + serviceHelper.reset(); + channelProvider = serviceHelper.createChannelProvider(); + RecaptchaEnterpriseServiceV1Beta1Settings settings = + RecaptchaEnterpriseServiceV1Beta1Settings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = RecaptchaEnterpriseServiceV1Beta1Client.create(settings); + } + + @After + public void tearDown() throws Exception { + client.close(); + } + + @Test + @SuppressWarnings("all") + public void createAssessmentTest() { + String name = "name3373707"; + float score = 1.0926453E7F; + Assessment expectedResponse = Assessment.newBuilder().setName(name).setScore(score).build(); + mockRecaptchaEnterpriseServiceV1Beta1.addResponse(expectedResponse); + + ProjectName parent = ProjectName.of("[PROJECT]"); + Assessment assessment = Assessment.newBuilder().build(); + + Assessment actualResponse = client.createAssessment(parent, assessment); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRecaptchaEnterpriseServiceV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + CreateAssessmentRequest actualRequest = (CreateAssessmentRequest) actualRequests.get(0); + + Assert.assertEquals(parent, ProjectName.parse(actualRequest.getParent())); + Assert.assertEquals(assessment, actualRequest.getAssessment()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void createAssessmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRecaptchaEnterpriseServiceV1Beta1.addException(exception); + + try { + ProjectName parent = ProjectName.of("[PROJECT]"); + Assessment assessment = Assessment.newBuilder().build(); + + client.createAssessment(parent, assessment); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } + + @Test + @SuppressWarnings("all") + public void annotateAssessmentTest() { + AnnotateAssessmentResponse expectedResponse = AnnotateAssessmentResponse.newBuilder().build(); + mockRecaptchaEnterpriseServiceV1Beta1.addResponse(expectedResponse); + + AssessmentName name = AssessmentName.of("[PROJECT]", "[ASSESSMENT]"); + AnnotateAssessmentRequest.Annotation annotation = + AnnotateAssessmentRequest.Annotation.ANNOTATION_UNSPECIFIED; + + AnnotateAssessmentResponse actualResponse = client.annotateAssessment(name, annotation); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockRecaptchaEnterpriseServiceV1Beta1.getRequests(); + Assert.assertEquals(1, actualRequests.size()); + AnnotateAssessmentRequest actualRequest = (AnnotateAssessmentRequest) actualRequests.get(0); + + Assert.assertEquals(name, AssessmentName.parse(actualRequest.getName())); + Assert.assertEquals(annotation, actualRequest.getAnnotation()); + Assert.assertTrue( + channelProvider.isHeaderSent( + ApiClientHeaderProvider.getDefaultApiClientHeaderKey(), + GaxGrpcProperties.getDefaultApiClientHeaderPattern())); + } + + @Test + @SuppressWarnings("all") + public void annotateAssessmentExceptionTest() throws Exception { + StatusRuntimeException exception = new StatusRuntimeException(Status.INVALID_ARGUMENT); + mockRecaptchaEnterpriseServiceV1Beta1.addException(exception); + + try { + AssessmentName name = AssessmentName.of("[PROJECT]", "[ASSESSMENT]"); + AnnotateAssessmentRequest.Annotation annotation = + AnnotateAssessmentRequest.Annotation.ANNOTATION_UNSPECIFIED; + + client.annotateAssessment(name, annotation); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception + } + } +} diff --git a/google-cloud-clients/google-cloud-recaptchaenterprise/synth.py b/google-cloud-clients/google-cloud-recaptchaenterprise/synth.py new file mode 100644 index 000000000000..907fda832037 --- /dev/null +++ b/google-cloud-clients/google-cloud-recaptchaenterprise/synth.py @@ -0,0 +1,41 @@ +# Copyright 2018 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""This script is used to synthesize generated parts of this library.""" + +import synthtool as s +import synthtool.gcp as gcp +import synthtool.languages.java as java + +gapic = gcp.GAPICGenerator() +common_templates = gcp.CommonTemplates() + +versions = ['v1beta1'] +service = 'recaptchaenterprise' +config_pattern = '/google/cloud/recaptchaenterprise/artman_recaptchaenterprise_{version}.yaml' + +for version in versions: + library = gapic.java_library( + service=service, + version=version, + config_path=config_pattern.format(version=version), + artman_output_name='') + + s.copy(library / f'gapic-google-cloud-{service}-{version}/src', 'src') + s.copy(library / f'grpc-google-cloud-{service}-{version}/src', f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src') + s.copy(library / f'proto-google-cloud-{service}-{version}/src', f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src') + + java.format_code('./src') + java.format_code(f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src') + java.format_code(f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src') \ No newline at end of file diff --git a/google-cloud-clients/pom.xml b/google-cloud-clients/pom.xml index 68c2248b3216..ef4f4c2655b0 100644 --- a/google-cloud-clients/pom.xml +++ b/google-cloud-clients/pom.xml @@ -449,6 +449,7 @@ google-cloud-notification google-cloud-os-login google-cloud-pubsub + google-cloud-recaptchaenterprise google-cloud-redis google-cloud-resourcemanager google-cloud-scheduler @@ -789,7 +790,7 @@ Stub packages - com.google.cloud.asset.v1.stub:com.google.cloud.asset.v1beta1.stub:com.google.cloud.automl.v1beta1.stub:com.google.cloud.bigquery.datatransfer.v1.stub:com.google.cloud.bigquery.storage.v1beta1.stub*:com.google.cloud.bigtable.admin.v2.stub:com.google.cloud.bigtable.v2.stub:com.google.cloud.bigtable.data.v2.stub*:com.google.cloud.compute.v1.stub:com.google.cloud.container.v1.stub:com.google.cloud.containeranalysis.v1beta1.stub:com.google.cloud.datacatalog.v1beta1.stub:com.google.cloud.datalabeling.v1beta1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dataproc.v1beta2.stub:com.google.cloud.devtools.containeranalysis.v1beta1.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.errorreporting.v1beta1.stub:com.google.cloud.firestore-admin.v1.stub:com.google.cloud.firestore.v1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.iam.credentials.v1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.oslogin.v1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.redis.v1.stub:com.google.cloud.redis.v1beta1.stub:com.google.cloud.scheduler.v1.stub:com.google.cloud.scheduler.v1beta1.stub:com.google.cloud.securitycenter.v1.stub:com.google.cloud.securitycenter.v1beta1.stub:com.google.cloud.spanner.admin.database.v1.stub:com.google.cloud.spanner.admin.instance.v1.stub:com.google.cloud.spanner.v1.stub:com.google.cloud.speech.v1.stub:com.google.cloud.speech.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.talent.v4beta1.stub:com.google.cloud.tasks.v2.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.tasks.v2beta3.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.translate.v3beta1.stub:com.google.cloud.videointelligence.v1.stub:com.google.cloud.videointelligence.v1beta1.stub:com.google.cloud.videointelligence.v1beta2.stub:com.google.cloud.videointelligence.v1p1beta1.stub:com.google.cloud.videointelligence.v1p2beta1.stub:com.google.cloud.videointelligence.v1p3beta1.stub:com.google.cloud.vision.v1.stub:com.google.cloud.vision.v1p1beta1.stub:com.google.cloud.vision.v1p2beta1.stub:com.google.cloud.vision.v1p3beta1.stub:com.google.cloud.vision.v1p4beta1.stub:com.google.cloud.webrisk.v1beta1.stub:com.google.cloud.websecurityscanner.v1alpha.stub + com.google.cloud.asset.v1.stub:com.google.cloud.asset.v1beta1.stub:com.google.cloud.automl.v1beta1.stub:com.google.cloud.bigquerydatatransfer.v1.stub:com.google.cloud.bigquerystorage.v1beta1.stub:com.google.cloud.bigtable-admin.v2.stub:com.google.cloud.bigtable.v2.stub:com.google.cloud.container.v1.stub:com.google.cloud.containeranalysis.v1beta1.stub:com.google.cloud.datacatalog.v1beta1.stub:com.google.cloud.datalabeling.v1beta1.stub:com.google.cloud.dataproc.v1.stub:com.google.cloud.dataproc.v1beta2.stub:com.google.cloud.dialogflow.v2.stub:com.google.cloud.dialogflow.v2beta1.stub:com.google.cloud.dlp.v2.stub:com.google.cloud.error-reporting.v1beta1.stub:com.google.cloud.firestore-admin.v1.stub:com.google.cloud.firestore.v1.stub:com.google.cloud.firestore.v1beta1.stub:com.google.cloud.iamcredentials.v1.stub:com.google.cloud.iot.v1.stub:com.google.cloud.kms.v1.stub:com.google.cloud.language.v1.stub:com.google.cloud.language.v1beta2.stub:com.google.cloud.logging.v2.stub:com.google.cloud.monitoring.v3.stub:com.google.cloud.os-login.v1.stub:com.google.cloud.pubsub.v1.stub:com.google.cloud.recaptchaenterprise.v1beta1.stub:com.google.cloud.redis.v1.stub:com.google.cloud.redis.v1beta1.stub:com.google.cloud.scheduler.v1.stub:com.google.cloud.scheduler.v1beta1.stub:com.google.cloud.securitycenter.v1.stub:com.google.cloud.securitycenter.v1beta1.stub:com.google.cloud.spanner-admin-database.v1.stub:com.google.cloud.spanner-admin-instance.v1.stub:com.google.cloud.spanner.v1.stub:com.google.cloud.speech.v1.stub:com.google.cloud.speech.v1beta1.stub:com.google.cloud.speech.v1p1beta1.stub:com.google.cloud.talent.v4beta1.stub:com.google.cloud.tasks.v2.stub:com.google.cloud.tasks.v2beta2.stub:com.google.cloud.tasks.v2beta3.stub:com.google.cloud.texttospeech.v1.stub:com.google.cloud.texttospeech.v1beta1.stub:com.google.cloud.trace.v1.stub:com.google.cloud.trace.v2.stub:com.google.cloud.translate.v3beta1.stub:com.google.cloud.video-intelligence.v1.stub:com.google.cloud.video-intelligence.v1beta1.stub:com.google.cloud.video-intelligence.v1beta2.stub:com.google.cloud.video-intelligence.v1p1beta1.stub:com.google.cloud.video-intelligence.v1p2beta1.stub:com.google.cloud.video-intelligence.v1p3beta1.stub:com.google.cloud.vision.v1.stub:com.google.cloud.vision.v1p1beta1.stub:com.google.cloud.vision.v1p2beta1.stub:com.google.cloud.vision.v1p3beta1.stub:com.google.cloud.vision.v1p4beta1.stub:com.google.cloud.webrisk.v1beta1.stub:com.google.cloud.websecurityscanner.v1alpha.stub Deprecated packages diff --git a/versions.txt b/versions.txt index 186518cd1ed5..9f979480b323 100644 --- a/versions.txt +++ b/versions.txt @@ -48,6 +48,7 @@ google-cloud-nio-examples:0.89.0-alpha:0.89.1-alpha-SNAPSHOT google-cloud-notification:0.89.0-beta:0.89.1-beta-SNAPSHOT google-cloud-os-login:0.89.0-alpha:0.89.1-alpha-SNAPSHOT google-cloud-pubsub:1.71.0:1.71.1-SNAPSHOT +google-cloud-recaptchaenterprise:0.0.0:0.0.1-SNAPSHOT google-cloud-redis:0.89.0-alpha:0.89.1-alpha-SNAPSHOT google-cloud-resourcemanager:0.89.0-alpha:0.89.1-alpha-SNAPSHOT google-cloud-scheduler:0.89.0-alpha:0.89.1-alpha-SNAPSHOT @@ -95,6 +96,7 @@ grpc-google-cloud-logging-v2:0.54.0:0.54.1-SNAPSHOT grpc-google-cloud-monitoring-v3:1.53.0:1.53.1-SNAPSHOT grpc-google-cloud-os-login-v1:0.54.0:0.54.1-SNAPSHOT grpc-google-cloud-pubsub-v1:1.53.0:1.53.1-SNAPSHOT +grpc-google-cloud-recaptchaenterprise-v1beta1:0.0.0:0.0.1-SNAPSHOT grpc-google-cloud-redis-v1:0.54.0:0.54.1-SNAPSHOT grpc-google-cloud-redis-v1beta1:0.54.0:0.54.1-SNAPSHOT grpc-google-cloud-scheduler-v1:0.54.0:0.54.1-SNAPSHOT @@ -159,6 +161,7 @@ proto-google-cloud-logging-v2:0.54.0:0.54.1-SNAPSHOT proto-google-cloud-monitoring-v3:1.53.0:1.53.1-SNAPSHOT proto-google-cloud-os-login-v1:0.54.0:0.54.1-SNAPSHOT proto-google-cloud-pubsub-v1:1.53.0:1.53.1-SNAPSHOT +proto-google-cloud-recaptchaenterprise-v1beta1:0.0.0:0.0.1-SNAPSHOT proto-google-cloud-redis-v1:0.54.0:0.54.1-SNAPSHOT proto-google-cloud-redis-v1beta1:0.54.0:0.54.1-SNAPSHOT proto-google-cloud-scheduler-v1:0.54.0:0.54.1-SNAPSHOT From f71c25f0eb0136b47365f71ab0581051453b0c73 Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Fri, 26 Apr 2019 12:20:09 -0700 Subject: [PATCH 2/3] Fix parent versions --- .../grpc-google-cloud-recaptchaenterprise-v1beta1/pom.xml | 4 ++-- .../proto-google-cloud-recaptchaenterprise-v1beta1/pom.xml | 4 ++-- google-cloud-clients/google-cloud-recaptchaenterprise/pom.xml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/google-api-grpc/grpc-google-cloud-recaptchaenterprise-v1beta1/pom.xml b/google-api-grpc/grpc-google-cloud-recaptchaenterprise-v1beta1/pom.xml index 9e16b66f2a44..11eab7d34faf 100644 --- a/google-api-grpc/grpc-google-cloud-recaptchaenterprise-v1beta1/pom.xml +++ b/google-api-grpc/grpc-google-cloud-recaptchaenterprise-v1beta1/pom.xml @@ -9,7 +9,7 @@ com.google.api.grpc google-api-grpc - 0.0.1-SNAPSHOT + 0.54.1-SNAPSHOT @@ -50,4 +50,4 @@ - \ No newline at end of file + diff --git a/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/pom.xml b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/pom.xml index d29658b4cdc9..e962b49fedb1 100644 --- a/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/pom.xml +++ b/google-api-grpc/proto-google-cloud-recaptchaenterprise-v1beta1/pom.xml @@ -9,7 +9,7 @@ com.google.api.grpc google-api-grpc - 0.0.1-SNAPSHOT + 0.54.1-SNAPSHOT @@ -33,4 +33,4 @@ compile - \ No newline at end of file + diff --git a/google-cloud-clients/google-cloud-recaptchaenterprise/pom.xml b/google-cloud-clients/google-cloud-recaptchaenterprise/pom.xml index 9d0f71b9453d..44fdffdd57bb 100644 --- a/google-cloud-clients/google-cloud-recaptchaenterprise/pom.xml +++ b/google-cloud-clients/google-cloud-recaptchaenterprise/pom.xml @@ -12,7 +12,7 @@ com.google.cloud google-cloud-clients - 0.0.1-SNAPSHOT + 0.89.1-alpha-SNAPSHOT google-cloud-recaptchaenterprise @@ -110,4 +110,4 @@ - \ No newline at end of file + From ecc50d0511abed014ebb3f972bcce689f420533f Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Mon, 29 Apr 2019 09:44:34 -0700 Subject: [PATCH 3/3] Fix initial version in the README and year in new synth.py --- .../google-cloud-recaptchaenterprise/README.md | 8 ++++---- .../google-cloud-recaptchaenterprise/synth.py | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/google-cloud-clients/google-cloud-recaptchaenterprise/README.md b/google-cloud-clients/google-cloud-recaptchaenterprise/README.md index 6f8961572d20..9fc68fdc1fa5 100644 --- a/google-cloud-clients/google-cloud-recaptchaenterprise/README.md +++ b/google-cloud-clients/google-cloud-recaptchaenterprise/README.md @@ -22,16 +22,16 @@ If you are using Maven, add this to your pom.xml file com.google.cloud google-cloud-recaptchaenterprise - 0.71.0-beta + 0.0.1 ``` If you are using Gradle, add this to your dependencies ```Groovy -compile 'com.google.cloud:google-cloud-recaptchaenterprise:0.71.0-beta' +compile 'com.google.cloud:google-cloud-recaptchaenterprise:0.0.1' ``` If you are using SBT, add this to your dependencies ```Scala -libraryDependencies += "com.google.cloud" % "google-cloud-recaptchaenterprise" % "0.71.0-beta" +libraryDependencies += "com.google.cloud" % "google-cloud-recaptchaenterprise" % "0.0.1" ``` [//]: # ({x-version-update-end}) @@ -97,4 +97,4 @@ Apache 2.0 - See [LICENSE] for more information. [cloud-platform]: https://cloud.google.com/ [product-overview]: https://cloud.google.com/recaptcha-enterprise/ [product-docs]: https://cloud.google.com/recaptcha-enterprise/docs/ -[lib-docs]: https://googleapis.github.io/google-cloud-java/google-cloud-clients/apidocs/index.html?com/google/cloud/recaptchaenterprise/v1beta1/package-summary.html \ No newline at end of file +[lib-docs]: https://googleapis.github.io/google-cloud-java/google-cloud-clients/apidocs/index.html?com/google/cloud/recaptchaenterprise/v1beta1/package-summary.html diff --git a/google-cloud-clients/google-cloud-recaptchaenterprise/synth.py b/google-cloud-clients/google-cloud-recaptchaenterprise/synth.py index 907fda832037..3ce0e8413247 100644 --- a/google-cloud-clients/google-cloud-recaptchaenterprise/synth.py +++ b/google-cloud-clients/google-cloud-recaptchaenterprise/synth.py @@ -1,4 +1,4 @@ -# Copyright 2018 Google LLC +# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -38,4 +38,4 @@ java.format_code('./src') java.format_code(f'../../google-api-grpc/grpc-google-cloud-{service}-{version}/src') - java.format_code(f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src') \ No newline at end of file + java.format_code(f'../../google-api-grpc/proto-google-cloud-{service}-{version}/src')