diff --git a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Client.java b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Client.java index a18175cd..ea728ad4 100644 --- a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Client.java +++ b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Client.java @@ -15,18 +15,35 @@ */ package com.google.cloud.recaptchaenterprise.v1beta1; +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.PageContext; 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.common.util.concurrent.MoreExecutors; +import com.google.protobuf.Empty; 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.CreateKeyRequest; +import com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest; +import com.google.recaptchaenterprise.v1beta1.GetKeyRequest; +import com.google.recaptchaenterprise.v1beta1.Key; +import com.google.recaptchaenterprise.v1beta1.ListKeysRequest; +import com.google.recaptchaenterprise.v1beta1.ListKeysResponse; import com.google.recaptchaenterprise.v1beta1.ProjectName; +import com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest; import java.io.IOException; +import java.util.List; import java.util.concurrent.TimeUnit; import javax.annotation.Generated; @@ -372,6 +389,270 @@ public final AnnotateAssessmentResponse annotateAssessment(AnnotateAssessmentReq return stub.annotateAssessmentCallable(); } + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new reCAPTCHA Enterprise key. + * + *

Sample code: + * + *


+   * try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Key key = Key.newBuilder().build();
+   *   CreateKeyRequest request = CreateKeyRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setKey(key)
+   *     .build();
+   *   Key response = recaptchaEnterpriseServiceV1Beta1Client.createKey(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 Key createKey(CreateKeyRequest request) { + return createKeyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Creates a new reCAPTCHA Enterprise key. + * + *

Sample code: + * + *


+   * try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   Key key = Key.newBuilder().build();
+   *   CreateKeyRequest request = CreateKeyRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .setKey(key)
+   *     .build();
+   *   ApiFuture<Key> future = recaptchaEnterpriseServiceV1Beta1Client.createKeyCallable().futureCall(request);
+   *   // Do something
+   *   Key response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable createKeyCallable() { + return stub.createKeyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all keys that belong to a project. + * + *

Sample code: + * + *


+   * try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListKeysRequest request = ListKeysRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   for (Key element : recaptchaEnterpriseServiceV1Beta1Client.listKeys(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ * + * @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 ListKeysPagedResponse listKeys(ListKeysRequest request) { + return listKeysPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all keys that belong to a project. + * + *

Sample code: + * + *


+   * try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListKeysRequest request = ListKeysRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   ApiFuture<ListKeysPagedResponse> future = recaptchaEnterpriseServiceV1Beta1Client.listKeysPagedCallable().futureCall(request);
+   *   // Do something
+   *   for (Key element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listKeysPagedCallable() { + return stub.listKeysPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the list of all keys that belong to a project. + * + *

Sample code: + * + *


+   * try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
+   *   ProjectName parent = ProjectName.of("[PROJECT]");
+   *   ListKeysRequest request = ListKeysRequest.newBuilder()
+   *     .setParent(parent.toString())
+   *     .build();
+   *   while (true) {
+   *     ListKeysResponse response = recaptchaEnterpriseServiceV1Beta1Client.listKeysCallable().call(request);
+   *     for (Key element : response.getKeysList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * 
+ */ + public final UnaryCallable listKeysCallable() { + return stub.listKeysCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified key. + * + *

Sample code: + * + *


+   * try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
+   *   KeyName name = KeyName.of("[PROJECT]", "[KEY]");
+   *   GetKeyRequest request = GetKeyRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   Key response = recaptchaEnterpriseServiceV1Beta1Client.getKey(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 Key getKey(GetKeyRequest request) { + return getKeyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Returns the specified key. + * + *

Sample code: + * + *


+   * try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
+   *   KeyName name = KeyName.of("[PROJECT]", "[KEY]");
+   *   GetKeyRequest request = GetKeyRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Key> future = recaptchaEnterpriseServiceV1Beta1Client.getKeyCallable().futureCall(request);
+   *   // Do something
+   *   Key response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable getKeyCallable() { + return stub.getKeyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified key. + * + *

Sample code: + * + *


+   * try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
+   *   KeyName key = KeyName.of("[PROJECT]", "[KEY]");
+   *   UpdateKeyRequest request = UpdateKeyRequest.newBuilder()
+   *     .setKey(key.toString())
+   *     .build();
+   *   Key response = recaptchaEnterpriseServiceV1Beta1Client.updateKey(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 Key updateKey(UpdateKeyRequest request) { + return updateKeyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Updates the specified key. + * + *

Sample code: + * + *


+   * try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
+   *   KeyName key = KeyName.of("[PROJECT]", "[KEY]");
+   *   UpdateKeyRequest request = UpdateKeyRequest.newBuilder()
+   *     .setKey(key.toString())
+   *     .build();
+   *   ApiFuture<Key> future = recaptchaEnterpriseServiceV1Beta1Client.updateKeyCallable().futureCall(request);
+   *   // Do something
+   *   Key response = future.get();
+   * }
+   * 
+ */ + public final UnaryCallable updateKeyCallable() { + return stub.updateKeyCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified key. + * + *

Sample code: + * + *


+   * try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
+   *   KeyName name = KeyName.of("[PROJECT]", "[KEY]");
+   *   DeleteKeyRequest request = DeleteKeyRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   recaptchaEnterpriseServiceV1Beta1Client.deleteKey(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 void deleteKey(DeleteKeyRequest request) { + deleteKeyCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD + /** + * Deletes the specified key. + * + *

Sample code: + * + *


+   * try (RecaptchaEnterpriseServiceV1Beta1Client recaptchaEnterpriseServiceV1Beta1Client = RecaptchaEnterpriseServiceV1Beta1Client.create()) {
+   *   KeyName name = KeyName.of("[PROJECT]", "[KEY]");
+   *   DeleteKeyRequest request = DeleteKeyRequest.newBuilder()
+   *     .setName(name.toString())
+   *     .build();
+   *   ApiFuture<Void> future = recaptchaEnterpriseServiceV1Beta1Client.deleteKeyCallable().futureCall(request);
+   *   // Do something
+   *   future.get();
+   * }
+   * 
+ */ + public final UnaryCallable deleteKeyCallable() { + return stub.deleteKeyCallable(); + } + @Override public final void close() { stub.close(); @@ -401,4 +682,74 @@ public void shutdownNow() { public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return stub.awaitTermination(duration, unit); } + + public static class ListKeysPagedResponse + extends AbstractPagedListResponse< + ListKeysRequest, ListKeysResponse, Key, ListKeysPage, ListKeysFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListKeysPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + new ApiFunction() { + @Override + public ListKeysPagedResponse apply(ListKeysPage input) { + return new ListKeysPagedResponse(input); + } + }, + MoreExecutors.directExecutor()); + } + + private ListKeysPagedResponse(ListKeysPage page) { + super(page, ListKeysFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListKeysPage + extends AbstractPage { + + private ListKeysPage( + PageContext context, ListKeysResponse response) { + super(context, response); + } + + private static ListKeysPage createEmptyPage() { + return new ListKeysPage(null, null); + } + + @Override + protected ListKeysPage createPage( + PageContext context, ListKeysResponse response) { + return new ListKeysPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListKeysFixedSizeCollection + extends AbstractFixedSizeCollection< + ListKeysRequest, ListKeysResponse, Key, ListKeysPage, ListKeysFixedSizeCollection> { + + private ListKeysFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListKeysFixedSizeCollection createEmptyCollection() { + return new ListKeysFixedSizeCollection(null, 0); + } + + @Override + protected ListKeysFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListKeysFixedSizeCollection(pages, collectionSize); + } + } } diff --git a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Settings.java b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Settings.java index a82fef9b..7d4e78ee 100644 --- a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Settings.java +++ b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Settings.java @@ -15,6 +15,8 @@ */ package com.google.cloud.recaptchaenterprise.v1beta1; +import static com.google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client.ListKeysPagedResponse; + import com.google.api.core.ApiFunction; import com.google.api.core.BetaApi; import com.google.api.gax.core.GoogleCredentialsProvider; @@ -23,13 +25,22 @@ 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.PagedCallSettings; 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.protobuf.Empty; 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.CreateKeyRequest; +import com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest; +import com.google.recaptchaenterprise.v1beta1.GetKeyRequest; +import com.google.recaptchaenterprise.v1beta1.Key; +import com.google.recaptchaenterprise.v1beta1.ListKeysRequest; +import com.google.recaptchaenterprise.v1beta1.ListKeysResponse; +import com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest; import java.io.IOException; import java.util.List; import javax.annotation.Generated; @@ -79,6 +90,32 @@ public UnaryCallSettings createAssessmentSe .annotateAssessmentSettings(); } + /** Returns the object with the settings used for calls to createKey. */ + public UnaryCallSettings createKeySettings() { + return ((RecaptchaEnterpriseServiceV1Beta1StubSettings) getStubSettings()).createKeySettings(); + } + + /** Returns the object with the settings used for calls to listKeys. */ + public PagedCallSettings + listKeysSettings() { + return ((RecaptchaEnterpriseServiceV1Beta1StubSettings) getStubSettings()).listKeysSettings(); + } + + /** Returns the object with the settings used for calls to getKey. */ + public UnaryCallSettings getKeySettings() { + return ((RecaptchaEnterpriseServiceV1Beta1StubSettings) getStubSettings()).getKeySettings(); + } + + /** Returns the object with the settings used for calls to updateKey. */ + public UnaryCallSettings updateKeySettings() { + return ((RecaptchaEnterpriseServiceV1Beta1StubSettings) getStubSettings()).updateKeySettings(); + } + + /** Returns the object with the settings used for calls to deleteKey. */ + public UnaryCallSettings deleteKeySettings() { + return ((RecaptchaEnterpriseServiceV1Beta1StubSettings) getStubSettings()).deleteKeySettings(); + } + public static final RecaptchaEnterpriseServiceV1Beta1Settings create( RecaptchaEnterpriseServiceV1Beta1StubSettings stub) throws IOException { return new RecaptchaEnterpriseServiceV1Beta1Settings.Builder(stub.toBuilder()).build(); @@ -189,6 +226,32 @@ public Builder applyToAllUnaryMethods( return getStubSettingsBuilder().annotateAssessmentSettings(); } + /** Returns the builder for the settings used for calls to createKey. */ + public UnaryCallSettings.Builder createKeySettings() { + return getStubSettingsBuilder().createKeySettings(); + } + + /** Returns the builder for the settings used for calls to listKeys. */ + public PagedCallSettings.Builder + listKeysSettings() { + return getStubSettingsBuilder().listKeysSettings(); + } + + /** Returns the builder for the settings used for calls to getKey. */ + public UnaryCallSettings.Builder getKeySettings() { + return getStubSettingsBuilder().getKeySettings(); + } + + /** Returns the builder for the settings used for calls to updateKey. */ + public UnaryCallSettings.Builder updateKeySettings() { + return getStubSettingsBuilder().updateKeySettings(); + } + + /** Returns the builder for the settings used for calls to deleteKey. */ + public UnaryCallSettings.Builder deleteKeySettings() { + return getStubSettingsBuilder().deleteKeySettings(); + } + @Override public RecaptchaEnterpriseServiceV1Beta1Settings build() throws IOException { return new RecaptchaEnterpriseServiceV1Beta1Settings(this); diff --git a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/GrpcRecaptchaEnterpriseServiceV1Beta1Stub.java b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/GrpcRecaptchaEnterpriseServiceV1Beta1Stub.java index 7dd11c80..ca081d0c 100644 --- a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/GrpcRecaptchaEnterpriseServiceV1Beta1Stub.java +++ b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/GrpcRecaptchaEnterpriseServiceV1Beta1Stub.java @@ -15,6 +15,8 @@ */ package com.google.cloud.recaptchaenterprise.v1beta1.stub; +import static com.google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client.ListKeysPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.core.BackgroundResourceAggregation; @@ -24,10 +26,18 @@ import com.google.api.gax.rpc.RequestParamsExtractor; import com.google.api.gax.rpc.UnaryCallable; import com.google.common.collect.ImmutableMap; +import com.google.protobuf.Empty; 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.CreateKeyRequest; +import com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest; +import com.google.recaptchaenterprise.v1beta1.GetKeyRequest; +import com.google.recaptchaenterprise.v1beta1.Key; +import com.google.recaptchaenterprise.v1beta1.ListKeysRequest; +import com.google.recaptchaenterprise.v1beta1.ListKeysResponse; +import com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest; import io.grpc.MethodDescriptor; import io.grpc.protobuf.ProtoUtils; import java.io.IOException; @@ -67,12 +77,59 @@ public class GrpcRecaptchaEnterpriseServiceV1Beta1Stub .setResponseMarshaller( ProtoUtils.marshaller(AnnotateAssessmentResponse.getDefaultInstance())) .build(); + private static final MethodDescriptor createKeyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1/CreateKey") + .setRequestMarshaller(ProtoUtils.marshaller(CreateKeyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Key.getDefaultInstance())) + .build(); + private static final MethodDescriptor + listKeysMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1/ListKeys") + .setRequestMarshaller(ProtoUtils.marshaller(ListKeysRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(ListKeysResponse.getDefaultInstance())) + .build(); + private static final MethodDescriptor getKeyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1/GetKey") + .setRequestMarshaller(ProtoUtils.marshaller(GetKeyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Key.getDefaultInstance())) + .build(); + private static final MethodDescriptor updateKeyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1/UpdateKey") + .setRequestMarshaller(ProtoUtils.marshaller(UpdateKeyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Key.getDefaultInstance())) + .build(); + private static final MethodDescriptor deleteKeyMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1/DeleteKey") + .setRequestMarshaller(ProtoUtils.marshaller(DeleteKeyRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Empty.getDefaultInstance())) + .build(); private final BackgroundResource backgroundResources; private final UnaryCallable createAssessmentCallable; private final UnaryCallable annotateAssessmentCallable; + private final UnaryCallable createKeyCallable; + private final UnaryCallable listKeysCallable; + private final UnaryCallable listKeysPagedCallable; + private final UnaryCallable getKeyCallable; + private final UnaryCallable updateKeyCallable; + private final UnaryCallable deleteKeyCallable; private final GrpcStubCallableFactory callableFactory; @@ -145,6 +202,71 @@ public Map extract(AnnotateAssessmentRequest request) { } }) .build(); + GrpcCallSettings createKeyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createKeyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(CreateKeyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings listKeysTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listKeysMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(ListKeysRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("parent", String.valueOf(request.getParent())); + return params.build(); + } + }) + .build(); + GrpcCallSettings getKeyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getKeyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(GetKeyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings updateKeyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateKeyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(UpdateKeyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("key.name", String.valueOf(request.getKey().getName())); + return params.build(); + } + }) + .build(); + GrpcCallSettings deleteKeyTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteKeyMethodDescriptor) + .setParamsExtractor( + new RequestParamsExtractor() { + @Override + public Map extract(DeleteKeyRequest request) { + ImmutableMap.Builder params = ImmutableMap.builder(); + params.put("name", String.valueOf(request.getName())); + return params.build(); + } + }) + .build(); this.createAssessmentCallable = callableFactory.createUnaryCallable( @@ -154,6 +276,24 @@ public Map extract(AnnotateAssessmentRequest request) { annotateAssessmentTransportSettings, settings.annotateAssessmentSettings(), clientContext); + this.createKeyCallable = + callableFactory.createUnaryCallable( + createKeyTransportSettings, settings.createKeySettings(), clientContext); + this.listKeysCallable = + callableFactory.createUnaryCallable( + listKeysTransportSettings, settings.listKeysSettings(), clientContext); + this.listKeysPagedCallable = + callableFactory.createPagedCallable( + listKeysTransportSettings, settings.listKeysSettings(), clientContext); + this.getKeyCallable = + callableFactory.createUnaryCallable( + getKeyTransportSettings, settings.getKeySettings(), clientContext); + this.updateKeyCallable = + callableFactory.createUnaryCallable( + updateKeyTransportSettings, settings.updateKeySettings(), clientContext); + this.deleteKeyCallable = + callableFactory.createUnaryCallable( + deleteKeyTransportSettings, settings.deleteKeySettings(), clientContext); backgroundResources = new BackgroundResourceAggregation(clientContext.getBackgroundResources()); } @@ -167,6 +307,30 @@ public UnaryCallable createAssessmentCallab return annotateAssessmentCallable; } + public UnaryCallable createKeyCallable() { + return createKeyCallable; + } + + public UnaryCallable listKeysPagedCallable() { + return listKeysPagedCallable; + } + + public UnaryCallable listKeysCallable() { + return listKeysCallable; + } + + public UnaryCallable getKeyCallable() { + return getKeyCallable; + } + + public UnaryCallable updateKeyCallable() { + return updateKeyCallable; + } + + public UnaryCallable deleteKeyCallable() { + return deleteKeyCallable; + } + @Override public final void close() { shutdown(); diff --git a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/RecaptchaEnterpriseServiceV1Beta1Stub.java b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/RecaptchaEnterpriseServiceV1Beta1Stub.java index 218b0fd1..119febdb 100644 --- a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/RecaptchaEnterpriseServiceV1Beta1Stub.java +++ b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/RecaptchaEnterpriseServiceV1Beta1Stub.java @@ -15,13 +15,23 @@ */ package com.google.cloud.recaptchaenterprise.v1beta1.stub; +import static com.google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client.ListKeysPagedResponse; + import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; import com.google.api.gax.rpc.UnaryCallable; +import com.google.protobuf.Empty; 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.CreateKeyRequest; +import com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest; +import com.google.recaptchaenterprise.v1beta1.GetKeyRequest; +import com.google.recaptchaenterprise.v1beta1.Key; +import com.google.recaptchaenterprise.v1beta1.ListKeysRequest; +import com.google.recaptchaenterprise.v1beta1.ListKeysResponse; +import com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest; import javax.annotation.Generated; // AUTO-GENERATED DOCUMENTATION AND CLASS @@ -43,6 +53,30 @@ public UnaryCallable createAssessmentCallab throw new UnsupportedOperationException("Not implemented: annotateAssessmentCallable()"); } + public UnaryCallable createKeyCallable() { + throw new UnsupportedOperationException("Not implemented: createKeyCallable()"); + } + + public UnaryCallable listKeysPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listKeysPagedCallable()"); + } + + public UnaryCallable listKeysCallable() { + throw new UnsupportedOperationException("Not implemented: listKeysCallable()"); + } + + public UnaryCallable getKeyCallable() { + throw new UnsupportedOperationException("Not implemented: getKeyCallable()"); + } + + public UnaryCallable updateKeyCallable() { + throw new UnsupportedOperationException("Not implemented: updateKeyCallable()"); + } + + public UnaryCallable deleteKeyCallable() { + throw new UnsupportedOperationException("Not implemented: deleteKeyCallable()"); + } + @Override public abstract void close(); } diff --git a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/RecaptchaEnterpriseServiceV1Beta1StubSettings.java b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/RecaptchaEnterpriseServiceV1Beta1StubSettings.java index 3f134123..2c548c5f 100644 --- a/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/RecaptchaEnterpriseServiceV1Beta1StubSettings.java +++ b/google-cloud-recaptchaenterprise/src/main/java/com/google/cloud/recaptchaenterprise/v1beta1/stub/RecaptchaEnterpriseServiceV1Beta1StubSettings.java @@ -15,7 +15,10 @@ */ package com.google.cloud.recaptchaenterprise.v1beta1.stub; +import static com.google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Client.ListKeysPagedResponse; + import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; import com.google.api.core.BetaApi; import com.google.api.gax.core.GaxProperties; import com.google.api.gax.core.GoogleCredentialsProvider; @@ -24,20 +27,34 @@ 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.ApiCallContext; import com.google.api.gax.rpc.ApiClientHeaderProvider; import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.PagedListDescriptor; +import com.google.api.gax.rpc.PagedListResponseFactory; 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.api.gax.rpc.UnaryCallable; 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.protobuf.Empty; 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.CreateKeyRequest; +import com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest; +import com.google.recaptchaenterprise.v1beta1.GetKeyRequest; +import com.google.recaptchaenterprise.v1beta1.Key; +import com.google.recaptchaenterprise.v1beta1.ListKeysRequest; +import com.google.recaptchaenterprise.v1beta1.ListKeysResponse; +import com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest; import java.io.IOException; import java.util.List; import javax.annotation.Generated; @@ -82,6 +99,12 @@ public class RecaptchaEnterpriseServiceV1Beta1StubSettings private final UnaryCallSettings createAssessmentSettings; private final UnaryCallSettings annotateAssessmentSettings; + private final UnaryCallSettings createKeySettings; + private final PagedCallSettings + listKeysSettings; + private final UnaryCallSettings getKeySettings; + private final UnaryCallSettings updateKeySettings; + private final UnaryCallSettings deleteKeySettings; /** Returns the object with the settings used for calls to createAssessment. */ public UnaryCallSettings createAssessmentSettings() { @@ -94,6 +117,32 @@ public UnaryCallSettings createAssessmentSe return annotateAssessmentSettings; } + /** Returns the object with the settings used for calls to createKey. */ + public UnaryCallSettings createKeySettings() { + return createKeySettings; + } + + /** Returns the object with the settings used for calls to listKeys. */ + public PagedCallSettings + listKeysSettings() { + return listKeysSettings; + } + + /** Returns the object with the settings used for calls to getKey. */ + public UnaryCallSettings getKeySettings() { + return getKeySettings; + } + + /** Returns the object with the settings used for calls to updateKey. */ + public UnaryCallSettings updateKeySettings() { + return updateKeySettings; + } + + /** Returns the object with the settings used for calls to deleteKey. */ + public UnaryCallSettings deleteKeySettings() { + return deleteKeySettings; + } + @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public RecaptchaEnterpriseServiceV1Beta1Stub createStub() throws IOException { if (getTransportChannelProvider() @@ -167,8 +216,65 @@ protected RecaptchaEnterpriseServiceV1Beta1StubSettings(Builder settingsBuilder) createAssessmentSettings = settingsBuilder.createAssessmentSettings().build(); annotateAssessmentSettings = settingsBuilder.annotateAssessmentSettings().build(); + createKeySettings = settingsBuilder.createKeySettings().build(); + listKeysSettings = settingsBuilder.listKeysSettings().build(); + getKeySettings = settingsBuilder.getKeySettings().build(); + updateKeySettings = settingsBuilder.updateKeySettings().build(); + deleteKeySettings = settingsBuilder.deleteKeySettings().build(); } + private static final PagedListDescriptor + LIST_KEYS_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListKeysRequest injectToken(ListKeysRequest payload, String token) { + return ListKeysRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListKeysRequest injectPageSize(ListKeysRequest payload, int pageSize) { + return ListKeysRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListKeysRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListKeysResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListKeysResponse payload) { + return payload.getKeysList() != null + ? payload.getKeysList() + : ImmutableList.of(); + } + }; + + private static final PagedListResponseFactory< + ListKeysRequest, ListKeysResponse, ListKeysPagedResponse> + LIST_KEYS_PAGE_STR_FACT = + new PagedListResponseFactory() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListKeysRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_KEYS_PAGE_STR_DESC, request, context); + return ListKeysPagedResponse.createAsync(pageContext, futureResponse); + } + }; + /** Builder for RecaptchaEnterpriseServiceV1Beta1StubSettings. */ public static class Builder extends StubSettings.Builder { @@ -178,6 +284,13 @@ public static class Builder createAssessmentSettings; private final UnaryCallSettings.Builder annotateAssessmentSettings; + private final UnaryCallSettings.Builder createKeySettings; + private final PagedCallSettings.Builder< + ListKeysRequest, ListKeysResponse, ListKeysPagedResponse> + listKeysSettings; + private final UnaryCallSettings.Builder getKeySettings; + private final UnaryCallSettings.Builder updateKeySettings; + private final UnaryCallSettings.Builder deleteKeySettings; private static final ImmutableMap> RETRYABLE_CODE_DEFINITIONS; @@ -224,9 +337,25 @@ protected Builder(ClientContext clientContext) { annotateAssessmentSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + listKeysSettings = PagedCallSettings.newBuilder(LIST_KEYS_PAGE_STR_FACT); + + getKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + updateKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + deleteKeySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + unaryMethodSettingsBuilders = ImmutableList.>of( - createAssessmentSettings, annotateAssessmentSettings); + createAssessmentSettings, + annotateAssessmentSettings, + createKeySettings, + listKeysSettings, + getKeySettings, + updateKeySettings, + deleteKeySettings); initDefaults(this); } @@ -252,6 +381,31 @@ private static Builder initDefaults(Builder builder) { .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + builder + .createKeySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .listKeysSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .getKeySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .updateKeySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + + builder + .deleteKeySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("non_idempotent")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("default")); + return builder; } @@ -260,10 +414,21 @@ protected Builder(RecaptchaEnterpriseServiceV1Beta1StubSettings settings) { createAssessmentSettings = settings.createAssessmentSettings.toBuilder(); annotateAssessmentSettings = settings.annotateAssessmentSettings.toBuilder(); + createKeySettings = settings.createKeySettings.toBuilder(); + listKeysSettings = settings.listKeysSettings.toBuilder(); + getKeySettings = settings.getKeySettings.toBuilder(); + updateKeySettings = settings.updateKeySettings.toBuilder(); + deleteKeySettings = settings.deleteKeySettings.toBuilder(); unaryMethodSettingsBuilders = ImmutableList.>of( - createAssessmentSettings, annotateAssessmentSettings); + createAssessmentSettings, + annotateAssessmentSettings, + createKeySettings, + listKeysSettings, + getKeySettings, + updateKeySettings, + deleteKeySettings); } // NEXT_MAJOR_VER: remove 'throws Exception' @@ -294,6 +459,32 @@ public Builder applyToAllUnaryMethods( return annotateAssessmentSettings; } + /** Returns the builder for the settings used for calls to createKey. */ + public UnaryCallSettings.Builder createKeySettings() { + return createKeySettings; + } + + /** Returns the builder for the settings used for calls to listKeys. */ + public PagedCallSettings.Builder + listKeysSettings() { + return listKeysSettings; + } + + /** Returns the builder for the settings used for calls to getKey. */ + public UnaryCallSettings.Builder getKeySettings() { + return getKeySettings; + } + + /** Returns the builder for the settings used for calls to updateKey. */ + public UnaryCallSettings.Builder updateKeySettings() { + return updateKeySettings; + } + + /** Returns the builder for the settings used for calls to deleteKey. */ + public UnaryCallSettings.Builder deleteKeySettings() { + return deleteKeySettings; + } + @Override public RecaptchaEnterpriseServiceV1Beta1StubSettings build() throws IOException { return new RecaptchaEnterpriseServiceV1Beta1StubSettings(this); diff --git a/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1beta1/MockRecaptchaEnterpriseServiceV1Beta1Impl.java b/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1beta1/MockRecaptchaEnterpriseServiceV1Beta1Impl.java index 58d00959..ed02a640 100644 --- a/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1beta1/MockRecaptchaEnterpriseServiceV1Beta1Impl.java +++ b/google-cloud-recaptchaenterprise/src/test/java/com/google/cloud/recaptchaenterprise/v1beta1/MockRecaptchaEnterpriseServiceV1Beta1Impl.java @@ -17,11 +17,19 @@ import com.google.api.core.BetaApi; import com.google.protobuf.AbstractMessage; +import com.google.protobuf.Empty; 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.CreateKeyRequest; +import com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest; +import com.google.recaptchaenterprise.v1beta1.GetKeyRequest; +import com.google.recaptchaenterprise.v1beta1.Key; +import com.google.recaptchaenterprise.v1beta1.ListKeysRequest; +import com.google.recaptchaenterprise.v1beta1.ListKeysResponse; import com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1Grpc.RecaptchaEnterpriseServiceV1Beta1ImplBase; +import com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest; import io.grpc.stub.StreamObserver; import java.util.ArrayList; import java.util.LinkedList; @@ -91,4 +99,74 @@ public void annotateAssessment( responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); } } + + @Override + public void createKey(CreateKeyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Key) { + requests.add(request); + responseObserver.onNext((Key) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void listKeys(ListKeysRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof ListKeysResponse) { + requests.add(request); + responseObserver.onNext((ListKeysResponse) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void getKey(GetKeyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Key) { + requests.add(request); + responseObserver.onNext((Key) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void updateKey(UpdateKeyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Key) { + requests.add(request); + responseObserver.onNext((Key) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } + + @Override + public void deleteKey(DeleteKeyRequest request, StreamObserver responseObserver) { + Object response = responses.remove(); + if (response instanceof Empty) { + requests.add(request); + responseObserver.onNext((Empty) response); + responseObserver.onCompleted(); + } else if (response instanceof Exception) { + responseObserver.onError((Exception) response); + } else { + responseObserver.onError(new IllegalArgumentException("Unrecognized response type")); + } + } } diff --git a/grpc-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Grpc.java b/grpc-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Grpc.java index 82341061..3d1e6edc 100644 --- a/grpc-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Grpc.java +++ b/grpc-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/RecaptchaEnterpriseServiceV1Beta1Grpc.java @@ -170,6 +170,303 @@ private RecaptchaEnterpriseServiceV1Beta1Grpc() {} return getAnnotateAssessmentMethod; } + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getCreateKeyMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.CreateKeyRequest, + com.google.recaptchaenterprise.v1beta1.Key> + METHOD_CREATE_KEY = getCreateKeyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.CreateKeyRequest, + com.google.recaptchaenterprise.v1beta1.Key> + getCreateKeyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.CreateKeyRequest, + com.google.recaptchaenterprise.v1beta1.Key> + getCreateKeyMethod() { + return getCreateKeyMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.CreateKeyRequest, + com.google.recaptchaenterprise.v1beta1.Key> + getCreateKeyMethodHelper() { + io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.CreateKeyRequest, + com.google.recaptchaenterprise.v1beta1.Key> + getCreateKeyMethod; + if ((getCreateKeyMethod = RecaptchaEnterpriseServiceV1Beta1Grpc.getCreateKeyMethod) == null) { + synchronized (RecaptchaEnterpriseServiceV1Beta1Grpc.class) { + if ((getCreateKeyMethod = RecaptchaEnterpriseServiceV1Beta1Grpc.getCreateKeyMethod) + == null) { + RecaptchaEnterpriseServiceV1Beta1Grpc.getCreateKeyMethod = + getCreateKeyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1", + "CreateKey")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.recaptchaenterprise.v1beta1.CreateKeyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.recaptchaenterprise.v1beta1.Key.getDefaultInstance())) + .setSchemaDescriptor( + new RecaptchaEnterpriseServiceV1Beta1MethodDescriptorSupplier( + "CreateKey")) + .build(); + } + } + } + return getCreateKeyMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getListKeysMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.ListKeysRequest, + com.google.recaptchaenterprise.v1beta1.ListKeysResponse> + METHOD_LIST_KEYS = getListKeysMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.ListKeysRequest, + com.google.recaptchaenterprise.v1beta1.ListKeysResponse> + getListKeysMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.ListKeysRequest, + com.google.recaptchaenterprise.v1beta1.ListKeysResponse> + getListKeysMethod() { + return getListKeysMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.ListKeysRequest, + com.google.recaptchaenterprise.v1beta1.ListKeysResponse> + getListKeysMethodHelper() { + io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.ListKeysRequest, + com.google.recaptchaenterprise.v1beta1.ListKeysResponse> + getListKeysMethod; + if ((getListKeysMethod = RecaptchaEnterpriseServiceV1Beta1Grpc.getListKeysMethod) == null) { + synchronized (RecaptchaEnterpriseServiceV1Beta1Grpc.class) { + if ((getListKeysMethod = RecaptchaEnterpriseServiceV1Beta1Grpc.getListKeysMethod) == null) { + RecaptchaEnterpriseServiceV1Beta1Grpc.getListKeysMethod = + getListKeysMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1", + "ListKeys")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.recaptchaenterprise.v1beta1.ListKeysRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.recaptchaenterprise.v1beta1.ListKeysResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new RecaptchaEnterpriseServiceV1Beta1MethodDescriptorSupplier("ListKeys")) + .build(); + } + } + } + return getListKeysMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getGetKeyMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.GetKeyRequest, + com.google.recaptchaenterprise.v1beta1.Key> + METHOD_GET_KEY = getGetKeyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.GetKeyRequest, + com.google.recaptchaenterprise.v1beta1.Key> + getGetKeyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.GetKeyRequest, + com.google.recaptchaenterprise.v1beta1.Key> + getGetKeyMethod() { + return getGetKeyMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.GetKeyRequest, + com.google.recaptchaenterprise.v1beta1.Key> + getGetKeyMethodHelper() { + io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.GetKeyRequest, + com.google.recaptchaenterprise.v1beta1.Key> + getGetKeyMethod; + if ((getGetKeyMethod = RecaptchaEnterpriseServiceV1Beta1Grpc.getGetKeyMethod) == null) { + synchronized (RecaptchaEnterpriseServiceV1Beta1Grpc.class) { + if ((getGetKeyMethod = RecaptchaEnterpriseServiceV1Beta1Grpc.getGetKeyMethod) == null) { + RecaptchaEnterpriseServiceV1Beta1Grpc.getGetKeyMethod = + getGetKeyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1", + "GetKey")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.recaptchaenterprise.v1beta1.GetKeyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.recaptchaenterprise.v1beta1.Key.getDefaultInstance())) + .setSchemaDescriptor( + new RecaptchaEnterpriseServiceV1Beta1MethodDescriptorSupplier("GetKey")) + .build(); + } + } + } + return getGetKeyMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getUpdateKeyMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest, + com.google.recaptchaenterprise.v1beta1.Key> + METHOD_UPDATE_KEY = getUpdateKeyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest, + com.google.recaptchaenterprise.v1beta1.Key> + getUpdateKeyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest, + com.google.recaptchaenterprise.v1beta1.Key> + getUpdateKeyMethod() { + return getUpdateKeyMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest, + com.google.recaptchaenterprise.v1beta1.Key> + getUpdateKeyMethodHelper() { + io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest, + com.google.recaptchaenterprise.v1beta1.Key> + getUpdateKeyMethod; + if ((getUpdateKeyMethod = RecaptchaEnterpriseServiceV1Beta1Grpc.getUpdateKeyMethod) == null) { + synchronized (RecaptchaEnterpriseServiceV1Beta1Grpc.class) { + if ((getUpdateKeyMethod = RecaptchaEnterpriseServiceV1Beta1Grpc.getUpdateKeyMethod) + == null) { + RecaptchaEnterpriseServiceV1Beta1Grpc.getUpdateKeyMethod = + getUpdateKeyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1", + "UpdateKey")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.recaptchaenterprise.v1beta1.Key.getDefaultInstance())) + .setSchemaDescriptor( + new RecaptchaEnterpriseServiceV1Beta1MethodDescriptorSupplier( + "UpdateKey")) + .build(); + } + } + } + return getUpdateKeyMethod; + } + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + @java.lang.Deprecated // Use {@link #getDeleteKeyMethod()} instead. + public static final io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest, com.google.protobuf.Empty> + METHOD_DELETE_KEY = getDeleteKeyMethodHelper(); + + private static volatile io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest, com.google.protobuf.Empty> + getDeleteKeyMethod; + + @io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901") + public static io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest, com.google.protobuf.Empty> + getDeleteKeyMethod() { + return getDeleteKeyMethodHelper(); + } + + private static io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest, com.google.protobuf.Empty> + getDeleteKeyMethodHelper() { + io.grpc.MethodDescriptor< + com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest, com.google.protobuf.Empty> + getDeleteKeyMethod; + if ((getDeleteKeyMethod = RecaptchaEnterpriseServiceV1Beta1Grpc.getDeleteKeyMethod) == null) { + synchronized (RecaptchaEnterpriseServiceV1Beta1Grpc.class) { + if ((getDeleteKeyMethod = RecaptchaEnterpriseServiceV1Beta1Grpc.getDeleteKeyMethod) + == null) { + RecaptchaEnterpriseServiceV1Beta1Grpc.getDeleteKeyMethod = + getDeleteKeyMethod = + io.grpc.MethodDescriptor + . + newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + generateFullMethodName( + "google.cloud.recaptchaenterprise.v1beta1.RecaptchaEnterpriseServiceV1Beta1", + "DeleteKey")) + .setSampledToLocalTracing(true) + .setRequestMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor( + new RecaptchaEnterpriseServiceV1Beta1MethodDescriptorSupplier( + "DeleteKey")) + .build(); + } + } + } + return getDeleteKeyMethod; + } + /** 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); @@ -228,6 +525,72 @@ public void annotateAssessment( asyncUnimplementedUnaryCall(getAnnotateAssessmentMethodHelper(), responseObserver); } + /** + * + * + *
+     * Creates a new reCAPTCHA Enterprise key.
+     * 
+ */ + public void createKey( + com.google.recaptchaenterprise.v1beta1.CreateKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getCreateKeyMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Returns the list of all keys that belong to a project.
+     * 
+ */ + public void listKeys( + com.google.recaptchaenterprise.v1beta1.ListKeysRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnimplementedUnaryCall(getListKeysMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Returns the specified key.
+     * 
+ */ + public void getKey( + com.google.recaptchaenterprise.v1beta1.GetKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetKeyMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Updates the specified key.
+     * 
+ */ + public void updateKey( + com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUpdateKeyMethodHelper(), responseObserver); + } + + /** + * + * + *
+     * Deletes the specified key.
+     * 
+ */ + public void deleteKey( + com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteKeyMethodHelper(), responseObserver); + } + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) @@ -245,6 +608,37 @@ public final io.grpc.ServerServiceDefinition bindService() { com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentRequest, com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse>( this, METHODID_ANNOTATE_ASSESSMENT))) + .addMethod( + getCreateKeyMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.recaptchaenterprise.v1beta1.CreateKeyRequest, + com.google.recaptchaenterprise.v1beta1.Key>(this, METHODID_CREATE_KEY))) + .addMethod( + getListKeysMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.recaptchaenterprise.v1beta1.ListKeysRequest, + com.google.recaptchaenterprise.v1beta1.ListKeysResponse>( + this, METHODID_LIST_KEYS))) + .addMethod( + getGetKeyMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.recaptchaenterprise.v1beta1.GetKeyRequest, + com.google.recaptchaenterprise.v1beta1.Key>(this, METHODID_GET_KEY))) + .addMethod( + getUpdateKeyMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest, + com.google.recaptchaenterprise.v1beta1.Key>(this, METHODID_UPDATE_KEY))) + .addMethod( + getDeleteKeyMethodHelper(), + asyncUnaryCall( + new MethodHandlers< + com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest, + com.google.protobuf.Empty>(this, METHODID_DELETE_KEY))) .build(); } } @@ -308,6 +702,87 @@ public void annotateAssessment( request, responseObserver); } + + /** + * + * + *
+     * Creates a new reCAPTCHA Enterprise key.
+     * 
+ */ + public void createKey( + com.google.recaptchaenterprise.v1beta1.CreateKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getCreateKeyMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns the list of all keys that belong to a project.
+     * 
+ */ + public void listKeys( + com.google.recaptchaenterprise.v1beta1.ListKeysRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListKeysMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Returns the specified key.
+     * 
+ */ + public void getKey( + com.google.recaptchaenterprise.v1beta1.GetKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetKeyMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Updates the specified key.
+     * 
+ */ + public void updateKey( + com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUpdateKeyMethodHelper(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes the specified key.
+     * 
+ */ + public void deleteKey( + com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteKeyMethodHelper(), getCallOptions()), + request, + responseObserver); + } } /** @@ -360,6 +835,66 @@ public com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse annotat return blockingUnaryCall( getChannel(), getAnnotateAssessmentMethodHelper(), getCallOptions(), request); } + + /** + * + * + *
+     * Creates a new reCAPTCHA Enterprise key.
+     * 
+ */ + public com.google.recaptchaenterprise.v1beta1.Key createKey( + com.google.recaptchaenterprise.v1beta1.CreateKeyRequest request) { + return blockingUnaryCall(getChannel(), getCreateKeyMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns the list of all keys that belong to a project.
+     * 
+ */ + public com.google.recaptchaenterprise.v1beta1.ListKeysResponse listKeys( + com.google.recaptchaenterprise.v1beta1.ListKeysRequest request) { + return blockingUnaryCall(getChannel(), getListKeysMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Returns the specified key.
+     * 
+ */ + public com.google.recaptchaenterprise.v1beta1.Key getKey( + com.google.recaptchaenterprise.v1beta1.GetKeyRequest request) { + return blockingUnaryCall(getChannel(), getGetKeyMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the specified key.
+     * 
+ */ + public com.google.recaptchaenterprise.v1beta1.Key updateKey( + com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest request) { + return blockingUnaryCall(getChannel(), getUpdateKeyMethodHelper(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes the specified key.
+     * 
+ */ + public com.google.protobuf.Empty deleteKey( + com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest request) { + return blockingUnaryCall(getChannel(), getDeleteKeyMethodHelper(), getCallOptions(), request); + } } /** @@ -415,10 +950,84 @@ protected RecaptchaEnterpriseServiceV1Beta1FutureStub build( return futureUnaryCall( getChannel().newCall(getAnnotateAssessmentMethodHelper(), getCallOptions()), request); } + + /** + * + * + *
+     * Creates a new reCAPTCHA Enterprise key.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.recaptchaenterprise.v1beta1.Key> + createKey(com.google.recaptchaenterprise.v1beta1.CreateKeyRequest request) { + return futureUnaryCall( + getChannel().newCall(getCreateKeyMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns the list of all keys that belong to a project.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.recaptchaenterprise.v1beta1.ListKeysResponse> + listKeys(com.google.recaptchaenterprise.v1beta1.ListKeysRequest request) { + return futureUnaryCall( + getChannel().newCall(getListKeysMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Returns the specified key.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.recaptchaenterprise.v1beta1.Key> + getKey(com.google.recaptchaenterprise.v1beta1.GetKeyRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetKeyMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the specified key.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.recaptchaenterprise.v1beta1.Key> + updateKey(com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest request) { + return futureUnaryCall( + getChannel().newCall(getUpdateKeyMethodHelper(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes the specified key.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteKey( + com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteKeyMethodHelper(), getCallOptions()), request); + } } private static final int METHODID_CREATE_ASSESSMENT = 0; private static final int METHODID_ANNOTATE_ASSESSMENT = 1; + private static final int METHODID_CREATE_KEY = 2; + private static final int METHODID_LIST_KEYS = 3; + private static final int METHODID_GET_KEY = 4; + private static final int METHODID_UPDATE_KEY = 5; + private static final int METHODID_DELETE_KEY = 6; private static final class MethodHandlers implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -450,6 +1059,35 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv com.google.recaptchaenterprise.v1beta1.AnnotateAssessmentResponse>) responseObserver); break; + case METHODID_CREATE_KEY: + serviceImpl.createKey( + (com.google.recaptchaenterprise.v1beta1.CreateKeyRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_LIST_KEYS: + serviceImpl.listKeys( + (com.google.recaptchaenterprise.v1beta1.ListKeysRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_KEY: + serviceImpl.getKey( + (com.google.recaptchaenterprise.v1beta1.GetKeyRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_KEY: + serviceImpl.updateKey( + (com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_DELETE_KEY: + serviceImpl.deleteKey( + (com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; default: throw new AssertionError(); } @@ -517,6 +1155,11 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { new RecaptchaEnterpriseServiceV1Beta1FileDescriptorSupplier()) .addMethod(getCreateAssessmentMethodHelper()) .addMethod(getAnnotateAssessmentMethodHelper()) + .addMethod(getCreateKeyMethodHelper()) + .addMethod(getListKeysMethodHelper()) + .addMethod(getGetKeyMethodHelper()) + .addMethod(getUpdateKeyMethodHelper()) + .addMethod(getDeleteKeyMethodHelper()) .build(); } } diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/clirr-ignored-differences.xml b/proto-google-cloud-recaptchaenterprise-v1beta1/clirr-ignored-differences.xml new file mode 100644 index 00000000..15347264 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/recaptchaenterprise/v1beta1/*OrBuilder + * get*(*) + + + 7012 + com/google/recaptchaenterprise/v1beta1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/recaptchaenterprise/v1beta1/*OrBuilder + boolean has*(*) + + diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AndroidKeySettings.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AndroidKeySettings.java new file mode 100644 index 00000000..e7921308 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AndroidKeySettings.java @@ -0,0 +1,710 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +/** + * + * + *
+ * Settings specific to keys that can be used by Android apps.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings} + */ +public final class AndroidKeySettings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings) + AndroidKeySettingsOrBuilder { + private static final long serialVersionUID = 0L; + // Use AndroidKeySettings.newBuilder() to construct. + private AndroidKeySettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AndroidKeySettings() { + allowedPackageNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private AndroidKeySettings( + 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(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + allowedPackageNames_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + allowedPackageNames_.add(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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + allowedPackageNames_ = allowedPackageNames_.getUnmodifiableView(); + } + 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_AndroidKeySettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_AndroidKeySettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.class, + com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.Builder.class); + } + + public static final int ALLOWED_PACKAGE_NAMES_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList allowedPackageNames_; + /** + * + * + *
+   * Android package names of apps allowed to use the key.
+   * Example: 'com.companyname.appname'
+   * 
+ * + * repeated string allowed_package_names = 1; + */ + public com.google.protobuf.ProtocolStringList getAllowedPackageNamesList() { + return allowedPackageNames_; + } + /** + * + * + *
+   * Android package names of apps allowed to use the key.
+   * Example: 'com.companyname.appname'
+   * 
+ * + * repeated string allowed_package_names = 1; + */ + public int getAllowedPackageNamesCount() { + return allowedPackageNames_.size(); + } + /** + * + * + *
+   * Android package names of apps allowed to use the key.
+   * Example: 'com.companyname.appname'
+   * 
+ * + * repeated string allowed_package_names = 1; + */ + public java.lang.String getAllowedPackageNames(int index) { + return allowedPackageNames_.get(index); + } + /** + * + * + *
+   * Android package names of apps allowed to use the key.
+   * Example: 'com.companyname.appname'
+   * 
+ * + * repeated string allowed_package_names = 1; + */ + public com.google.protobuf.ByteString getAllowedPackageNamesBytes(int index) { + return allowedPackageNames_.getByteString(index); + } + + 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 { + for (int i = 0; i < allowedPackageNames_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, allowedPackageNames_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < allowedPackageNames_.size(); i++) { + dataSize += computeStringSizeNoTag(allowedPackageNames_.getRaw(i)); + } + size += dataSize; + size += 1 * getAllowedPackageNamesList().size(); + } + 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.AndroidKeySettings)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1beta1.AndroidKeySettings other = + (com.google.recaptchaenterprise.v1beta1.AndroidKeySettings) obj; + + if (!getAllowedPackageNamesList().equals(other.getAllowedPackageNamesList())) 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(); + if (getAllowedPackageNamesCount() > 0) { + hash = (37 * hash) + ALLOWED_PACKAGE_NAMES_FIELD_NUMBER; + hash = (53 * hash) + getAllowedPackageNamesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1beta1.AndroidKeySettings parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.AndroidKeySettings 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.AndroidKeySettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.AndroidKeySettings 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.AndroidKeySettings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.AndroidKeySettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.AndroidKeySettings parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.AndroidKeySettings 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.AndroidKeySettings parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.AndroidKeySettings 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.AndroidKeySettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.AndroidKeySettings 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.AndroidKeySettings 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; + } + /** + * + * + *
+   * Settings specific to keys that can be used by Android apps.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings) + com.google.recaptchaenterprise.v1beta1.AndroidKeySettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_AndroidKeySettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_AndroidKeySettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.class, + com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.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(); + allowedPackageNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_AndroidKeySettings_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.AndroidKeySettings getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.AndroidKeySettings build() { + com.google.recaptchaenterprise.v1beta1.AndroidKeySettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.AndroidKeySettings buildPartial() { + com.google.recaptchaenterprise.v1beta1.AndroidKeySettings result = + new com.google.recaptchaenterprise.v1beta1.AndroidKeySettings(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + allowedPackageNames_ = allowedPackageNames_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.allowedPackageNames_ = allowedPackageNames_; + 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.AndroidKeySettings) { + return mergeFrom((com.google.recaptchaenterprise.v1beta1.AndroidKeySettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1beta1.AndroidKeySettings other) { + if (other == com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.getDefaultInstance()) + return this; + if (!other.allowedPackageNames_.isEmpty()) { + if (allowedPackageNames_.isEmpty()) { + allowedPackageNames_ = other.allowedPackageNames_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAllowedPackageNamesIsMutable(); + allowedPackageNames_.addAll(other.allowedPackageNames_); + } + 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.AndroidKeySettings parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.recaptchaenterprise.v1beta1.AndroidKeySettings) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList allowedPackageNames_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAllowedPackageNamesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + allowedPackageNames_ = new com.google.protobuf.LazyStringArrayList(allowedPackageNames_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * Android package names of apps allowed to use the key.
+     * Example: 'com.companyname.appname'
+     * 
+ * + * repeated string allowed_package_names = 1; + */ + public com.google.protobuf.ProtocolStringList getAllowedPackageNamesList() { + return allowedPackageNames_.getUnmodifiableView(); + } + /** + * + * + *
+     * Android package names of apps allowed to use the key.
+     * Example: 'com.companyname.appname'
+     * 
+ * + * repeated string allowed_package_names = 1; + */ + public int getAllowedPackageNamesCount() { + return allowedPackageNames_.size(); + } + /** + * + * + *
+     * Android package names of apps allowed to use the key.
+     * Example: 'com.companyname.appname'
+     * 
+ * + * repeated string allowed_package_names = 1; + */ + public java.lang.String getAllowedPackageNames(int index) { + return allowedPackageNames_.get(index); + } + /** + * + * + *
+     * Android package names of apps allowed to use the key.
+     * Example: 'com.companyname.appname'
+     * 
+ * + * repeated string allowed_package_names = 1; + */ + public com.google.protobuf.ByteString getAllowedPackageNamesBytes(int index) { + return allowedPackageNames_.getByteString(index); + } + /** + * + * + *
+     * Android package names of apps allowed to use the key.
+     * Example: 'com.companyname.appname'
+     * 
+ * + * repeated string allowed_package_names = 1; + */ + public Builder setAllowedPackageNames(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedPackageNamesIsMutable(); + allowedPackageNames_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Android package names of apps allowed to use the key.
+     * Example: 'com.companyname.appname'
+     * 
+ * + * repeated string allowed_package_names = 1; + */ + public Builder addAllowedPackageNames(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedPackageNamesIsMutable(); + allowedPackageNames_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Android package names of apps allowed to use the key.
+     * Example: 'com.companyname.appname'
+     * 
+ * + * repeated string allowed_package_names = 1; + */ + public Builder addAllAllowedPackageNames(java.lang.Iterable values) { + ensureAllowedPackageNamesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedPackageNames_); + onChanged(); + return this; + } + /** + * + * + *
+     * Android package names of apps allowed to use the key.
+     * Example: 'com.companyname.appname'
+     * 
+ * + * repeated string allowed_package_names = 1; + */ + public Builder clearAllowedPackageNames() { + allowedPackageNames_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Android package names of apps allowed to use the key.
+     * Example: 'com.companyname.appname'
+     * 
+ * + * repeated string allowed_package_names = 1; + */ + public Builder addAllowedPackageNamesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAllowedPackageNamesIsMutable(); + allowedPackageNames_.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.AndroidKeySettings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings) + private static final com.google.recaptchaenterprise.v1beta1.AndroidKeySettings DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1beta1.AndroidKeySettings(); + } + + public static com.google.recaptchaenterprise.v1beta1.AndroidKeySettings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AndroidKeySettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AndroidKeySettings(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.AndroidKeySettings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AndroidKeySettingsOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AndroidKeySettingsOrBuilder.java new file mode 100644 index 00000000..ad1400f1 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/AndroidKeySettingsOrBuilder.java @@ -0,0 +1,70 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +public interface AndroidKeySettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Android package names of apps allowed to use the key.
+   * Example: 'com.companyname.appname'
+   * 
+ * + * repeated string allowed_package_names = 1; + */ + java.util.List getAllowedPackageNamesList(); + /** + * + * + *
+   * Android package names of apps allowed to use the key.
+   * Example: 'com.companyname.appname'
+   * 
+ * + * repeated string allowed_package_names = 1; + */ + int getAllowedPackageNamesCount(); + /** + * + * + *
+   * Android package names of apps allowed to use the key.
+   * Example: 'com.companyname.appname'
+   * 
+ * + * repeated string allowed_package_names = 1; + */ + java.lang.String getAllowedPackageNames(int index); + /** + * + * + *
+   * Android package names of apps allowed to use the key.
+   * Example: 'com.companyname.appname'
+   * 
+ * + * repeated string allowed_package_names = 1; + */ + com.google.protobuf.ByteString getAllowedPackageNamesBytes(int index); +} diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/CreateKeyRequest.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/CreateKeyRequest.java new file mode 100644 index 00000000..4689ead0 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/CreateKeyRequest.java @@ -0,0 +1,923 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +/** + * + * + *
+ * The create key request message.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest} + */ +public final class CreateKeyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest) + CreateKeyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateKeyRequest.newBuilder() to construct. + private CreateKeyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateKeyRequest() { + parent_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private CreateKeyRequest( + 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.Key.Builder subBuilder = null; + if (key_ != null) { + subBuilder = key_.toBuilder(); + } + key_ = + input.readMessage( + com.google.recaptchaenterprise.v1beta1.Key.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(key_); + key_ = 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_CreateKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_CreateKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.CreateKeyRequest.class, + com.google.recaptchaenterprise.v1beta1.CreateKeyRequest.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 key will be created, in the
+   * format "projects/{project_number}".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + 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 key will be created, in the
+   * format "projects/{project_number}".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + 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 KEY_FIELD_NUMBER = 2; + private com.google.recaptchaenterprise.v1beta1.Key key_; + /** + * + * + *
+   * Required. Information to create a reCAPTCHA Enterprise key.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public boolean hasKey() { + return key_ != null; + } + /** + * + * + *
+   * Required. Information to create a reCAPTCHA Enterprise key.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.recaptchaenterprise.v1beta1.Key getKey() { + return key_ == null ? com.google.recaptchaenterprise.v1beta1.Key.getDefaultInstance() : key_; + } + /** + * + * + *
+   * Required. Information to create a reCAPTCHA Enterprise key.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.recaptchaenterprise.v1beta1.KeyOrBuilder getKeyOrBuilder() { + return getKey(); + } + + 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 (key_ != null) { + output.writeMessage(2, getKey()); + } + 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 (key_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getKey()); + } + 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.CreateKeyRequest)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1beta1.CreateKeyRequest other = + (com.google.recaptchaenterprise.v1beta1.CreateKeyRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (hasKey() != other.hasKey()) return false; + if (hasKey()) { + if (!getKey().equals(other.getKey())) 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 (hasKey()) { + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1beta1.CreateKeyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.CreateKeyRequest 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.CreateKeyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.CreateKeyRequest 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.CreateKeyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.CreateKeyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.CreateKeyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.CreateKeyRequest 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.CreateKeyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.CreateKeyRequest 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.CreateKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.CreateKeyRequest 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.CreateKeyRequest 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 key request message.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest) + com.google.recaptchaenterprise.v1beta1.CreateKeyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_CreateKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_CreateKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.CreateKeyRequest.class, + com.google.recaptchaenterprise.v1beta1.CreateKeyRequest.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1beta1.CreateKeyRequest.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 (keyBuilder_ == null) { + key_ = null; + } else { + key_ = null; + keyBuilder_ = 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_CreateKeyRequest_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.CreateKeyRequest getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1beta1.CreateKeyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.CreateKeyRequest build() { + com.google.recaptchaenterprise.v1beta1.CreateKeyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.CreateKeyRequest buildPartial() { + com.google.recaptchaenterprise.v1beta1.CreateKeyRequest result = + new com.google.recaptchaenterprise.v1beta1.CreateKeyRequest(this); + result.parent_ = parent_; + if (keyBuilder_ == null) { + result.key_ = key_; + } else { + result.key_ = keyBuilder_.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.CreateKeyRequest) { + return mergeFrom((com.google.recaptchaenterprise.v1beta1.CreateKeyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1beta1.CreateKeyRequest other) { + if (other == com.google.recaptchaenterprise.v1beta1.CreateKeyRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.hasKey()) { + mergeKey(other.getKey()); + } + 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.CreateKeyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.recaptchaenterprise.v1beta1.CreateKeyRequest) 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 key will be created, in the
+     * format "projects/{project_number}".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + 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 key will be created, in the
+     * format "projects/{project_number}".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + 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 key will be created, in the
+     * format "projects/{project_number}".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + 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 key will be created, in the
+     * format "projects/{project_number}".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the project in which the key will be created, in the
+     * format "projects/{project_number}".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + 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.Key key_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.Key, + com.google.recaptchaenterprise.v1beta1.Key.Builder, + com.google.recaptchaenterprise.v1beta1.KeyOrBuilder> + keyBuilder_; + /** + * + * + *
+     * Required. Information to create a reCAPTCHA Enterprise key.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public boolean hasKey() { + return keyBuilder_ != null || key_ != null; + } + /** + * + * + *
+     * Required. Information to create a reCAPTCHA Enterprise key.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.recaptchaenterprise.v1beta1.Key getKey() { + if (keyBuilder_ == null) { + return key_ == null + ? com.google.recaptchaenterprise.v1beta1.Key.getDefaultInstance() + : key_; + } else { + return keyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Information to create a reCAPTCHA Enterprise key.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setKey(com.google.recaptchaenterprise.v1beta1.Key value) { + if (keyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + key_ = value; + onChanged(); + } else { + keyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. Information to create a reCAPTCHA Enterprise key.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setKey(com.google.recaptchaenterprise.v1beta1.Key.Builder builderForValue) { + if (keyBuilder_ == null) { + key_ = builderForValue.build(); + onChanged(); + } else { + keyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. Information to create a reCAPTCHA Enterprise key.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeKey(com.google.recaptchaenterprise.v1beta1.Key value) { + if (keyBuilder_ == null) { + if (key_ != null) { + key_ = + com.google.recaptchaenterprise.v1beta1.Key.newBuilder(key_) + .mergeFrom(value) + .buildPartial(); + } else { + key_ = value; + } + onChanged(); + } else { + keyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. Information to create a reCAPTCHA Enterprise key.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearKey() { + if (keyBuilder_ == null) { + key_ = null; + onChanged(); + } else { + key_ = null; + keyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. Information to create a reCAPTCHA Enterprise key.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.recaptchaenterprise.v1beta1.Key.Builder getKeyBuilder() { + + onChanged(); + return getKeyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Information to create a reCAPTCHA Enterprise key.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.recaptchaenterprise.v1beta1.KeyOrBuilder getKeyOrBuilder() { + if (keyBuilder_ != null) { + return keyBuilder_.getMessageOrBuilder(); + } else { + return key_ == null + ? com.google.recaptchaenterprise.v1beta1.Key.getDefaultInstance() + : key_; + } + } + /** + * + * + *
+     * Required. Information to create a reCAPTCHA Enterprise key.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.Key, + com.google.recaptchaenterprise.v1beta1.Key.Builder, + com.google.recaptchaenterprise.v1beta1.KeyOrBuilder> + getKeyFieldBuilder() { + if (keyBuilder_ == null) { + keyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.Key, + com.google.recaptchaenterprise.v1beta1.Key.Builder, + com.google.recaptchaenterprise.v1beta1.KeyOrBuilder>( + getKey(), getParentForChildren(), isClean()); + key_ = null; + } + return keyBuilder_; + } + + @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.CreateKeyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest) + private static final com.google.recaptchaenterprise.v1beta1.CreateKeyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1beta1.CreateKeyRequest(); + } + + public static com.google.recaptchaenterprise.v1beta1.CreateKeyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateKeyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CreateKeyRequest(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.CreateKeyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/CreateKeyRequestOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/CreateKeyRequestOrBuilder.java new file mode 100644 index 00000000..c0e572cb --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/CreateKeyRequestOrBuilder.java @@ -0,0 +1,89 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +public interface CreateKeyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1beta1.CreateKeyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the project in which the key will be created, in the
+   * format "projects/{project_number}".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the project in which the key will be created, in the
+   * format "projects/{project_number}".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. Information to create a reCAPTCHA Enterprise key.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + boolean hasKey(); + /** + * + * + *
+   * Required. Information to create a reCAPTCHA Enterprise key.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.recaptchaenterprise.v1beta1.Key getKey(); + /** + * + * + *
+   * Required. Information to create a reCAPTCHA Enterprise key.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.recaptchaenterprise.v1beta1.KeyOrBuilder getKeyOrBuilder(); +} diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/DeleteKeyRequest.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/DeleteKeyRequest.java new file mode 100644 index 00000000..b49f007f --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/DeleteKeyRequest.java @@ -0,0 +1,635 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +/** + * + * + *
+ * The delete key request message.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest} + */ +public final class DeleteKeyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest) + DeleteKeyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteKeyRequest.newBuilder() to construct. + private DeleteKeyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteKeyRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private DeleteKeyRequest( + 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; + } + 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_DeleteKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_DeleteKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest.class, + com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the key to be deleted, in the format
+   * "projects/{project_number}/keys/{key_id}".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + 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 name of the key to be deleted, in the format
+   * "projects/{project_number}/keys/{key_id}".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + 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; + } + } + + 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_); + } + 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_); + } + 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.DeleteKeyRequest)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest other = + (com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest) obj; + + if (!getName().equals(other.getName())) 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest 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.DeleteKeyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest 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.DeleteKeyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest 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.DeleteKeyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest 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.DeleteKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest 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.DeleteKeyRequest 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 delete key request message.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest) + com.google.recaptchaenterprise.v1beta1.DeleteKeyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_DeleteKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_DeleteKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest.class, + com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest.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_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_DeleteKeyRequest_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest build() { + com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest buildPartial() { + com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest result = + new com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest(this); + result.name_ = name_; + 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.DeleteKeyRequest) { + return mergeFrom((com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest other) { + if (other == com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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.DeleteKeyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the key to be deleted, in the format
+     * "projects/{project_number}/keys/{key_id}".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + 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 name of the key to be deleted, in the format
+     * "projects/{project_number}/keys/{key_id}".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + 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 name of the key to be deleted, in the format
+     * "projects/{project_number}/keys/{key_id}".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the key to be deleted, in the format
+     * "projects/{project_number}/keys/{key_id}".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the key to be deleted, in the format
+     * "projects/{project_number}/keys/{key_id}".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = 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.DeleteKeyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest) + private static final com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest(); + } + + public static com.google.recaptchaenterprise.v1beta1.DeleteKeyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteKeyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteKeyRequest(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.DeleteKeyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/DeleteKeyRequestOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/DeleteKeyRequestOrBuilder.java new file mode 100644 index 00000000..5eb225a3 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/DeleteKeyRequestOrBuilder.java @@ -0,0 +1,52 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +public interface DeleteKeyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1beta1.DeleteKeyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the key to be deleted, in the format
+   * "projects/{project_number}/keys/{key_id}".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the key to be deleted, in the format
+   * "projects/{project_number}/keys/{key_id}".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/Event.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/Event.java index 6c1852d1..9d83e6ad 100644 --- a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/Event.java +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/Event.java @@ -32,6 +32,9 @@ private Event(com.google.protobuf.GeneratedMessageV3.Builder builder) { private Event() { token_ = ""; siteKey_ = ""; + userAgent_ = ""; + userIpAddress_ = ""; + expectedAction_ = ""; } @java.lang.Override @@ -72,6 +75,27 @@ private Event( siteKey_ = s; break; } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + userAgent_ = s; + break; + } + case 34: + { + java.lang.String s = input.readStringRequireUtf8(); + + userIpAddress_ = s; + break; + } + case 42: + { + java.lang.String s = input.readStringRequireUtf8(); + + expectedAction_ = s; + break; + } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { @@ -112,11 +136,11 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { * * *
-   * Required. The user response token provided by the reCAPTCHA client-side integration
+   * Optional. The user response token provided by the reCAPTCHA client-side integration
    * on your site.
    * 
* - * string token = 1 [(.google.api.field_behavior) = REQUIRED]; + * string token = 1 [(.google.api.field_behavior) = OPTIONAL]; */ public java.lang.String getToken() { java.lang.Object ref = token_; @@ -133,11 +157,11 @@ public java.lang.String getToken() { * * *
-   * Required. The user response token provided by the reCAPTCHA client-side integration
+   * Optional. The user response token provided by the reCAPTCHA client-side integration
    * on your site.
    * 
* - * string token = 1 [(.google.api.field_behavior) = REQUIRED]; + * string token = 1 [(.google.api.field_behavior) = OPTIONAL]; */ public com.google.protobuf.ByteString getTokenBytes() { java.lang.Object ref = token_; @@ -157,11 +181,11 @@ public com.google.protobuf.ByteString getTokenBytes() { * * *
-   * Required. The site key that was used to invoke reCAPTCHA on your site and generate
+   * Optional. The site key that was used to invoke reCAPTCHA on your site and generate
    * the token.
    * 
* - * string site_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * string site_key = 2 [(.google.api.field_behavior) = OPTIONAL]; */ public java.lang.String getSiteKey() { java.lang.Object ref = siteKey_; @@ -178,11 +202,11 @@ public java.lang.String getSiteKey() { * * *
-   * Required. The site key that was used to invoke reCAPTCHA on your site and generate
+   * Optional. The site key that was used to invoke reCAPTCHA on your site and generate
    * the token.
    * 
* - * string site_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * string site_key = 2 [(.google.api.field_behavior) = OPTIONAL]; */ public com.google.protobuf.ByteString getSiteKeyBytes() { java.lang.Object ref = siteKey_; @@ -196,6 +220,141 @@ public com.google.protobuf.ByteString getSiteKeyBytes() { } } + public static final int USER_AGENT_FIELD_NUMBER = 3; + private volatile java.lang.Object userAgent_; + /** + * + * + *
+   * Optional. The user agent present in the request from the user's device related to
+   * this event.
+   * 
+ * + * string user_agent = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.lang.String getUserAgent() { + java.lang.Object ref = userAgent_; + 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(); + userAgent_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The user agent present in the request from the user's device related to
+   * this event.
+   * 
+ * + * string user_agent = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.protobuf.ByteString getUserAgentBytes() { + java.lang.Object ref = userAgent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userAgent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_IP_ADDRESS_FIELD_NUMBER = 4; + private volatile java.lang.Object userIpAddress_; + /** + * + * + *
+   * Optional. The IP address in the request from the user's device related to this event.
+   * 
+ * + * string user_ip_address = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.lang.String getUserIpAddress() { + java.lang.Object ref = userIpAddress_; + 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(); + userIpAddress_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The IP address in the request from the user's device related to this event.
+   * 
+ * + * string user_ip_address = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.protobuf.ByteString getUserIpAddressBytes() { + java.lang.Object ref = userIpAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userIpAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPECTED_ACTION_FIELD_NUMBER = 5; + private volatile java.lang.Object expectedAction_; + /** + * + * + *
+   * Optional. The expected action for this type of event. This should be the same action
+   * provided at token generation time on client-side platforms already
+   * integrated with recaptcha enterprise.
+   * 
+ * + * string expected_action = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.lang.String getExpectedAction() { + java.lang.Object ref = expectedAction_; + 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(); + expectedAction_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The expected action for this type of event. This should be the same action
+   * provided at token generation time on client-side platforms already
+   * integrated with recaptcha enterprise.
+   * 
+ * + * string expected_action = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.protobuf.ByteString getExpectedActionBytes() { + java.lang.Object ref = expectedAction_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + expectedAction_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + private byte memoizedIsInitialized = -1; @java.lang.Override @@ -216,6 +375,15 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io if (!getSiteKeyBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, siteKey_); } + if (!getUserAgentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, userAgent_); + } + if (!getUserIpAddressBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, userIpAddress_); + } + if (!getExpectedActionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, expectedAction_); + } unknownFields.writeTo(output); } @@ -231,6 +399,15 @@ public int getSerializedSize() { if (!getSiteKeyBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, siteKey_); } + if (!getUserAgentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, userAgent_); + } + if (!getUserIpAddressBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, userIpAddress_); + } + if (!getExpectedActionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, expectedAction_); + } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; @@ -249,6 +426,9 @@ public boolean equals(final java.lang.Object obj) { if (!getToken().equals(other.getToken())) return false; if (!getSiteKey().equals(other.getSiteKey())) return false; + if (!getUserAgent().equals(other.getUserAgent())) return false; + if (!getUserIpAddress().equals(other.getUserIpAddress())) return false; + if (!getExpectedAction().equals(other.getExpectedAction())) return false; if (!unknownFields.equals(other.unknownFields)) return false; return true; } @@ -264,6 +444,12 @@ public int hashCode() { hash = (53 * hash) + getToken().hashCode(); hash = (37 * hash) + SITE_KEY_FIELD_NUMBER; hash = (53 * hash) + getSiteKey().hashCode(); + hash = (37 * hash) + USER_AGENT_FIELD_NUMBER; + hash = (53 * hash) + getUserAgent().hashCode(); + hash = (37 * hash) + USER_IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getUserIpAddress().hashCode(); + hash = (37 * hash) + EXPECTED_ACTION_FIELD_NUMBER; + hash = (53 * hash) + getExpectedAction().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; @@ -405,6 +591,12 @@ public Builder clear() { siteKey_ = ""; + userAgent_ = ""; + + userIpAddress_ = ""; + + expectedAction_ = ""; + return this; } @@ -434,6 +626,9 @@ public com.google.recaptchaenterprise.v1beta1.Event buildPartial() { new com.google.recaptchaenterprise.v1beta1.Event(this); result.token_ = token_; result.siteKey_ = siteKey_; + result.userAgent_ = userAgent_; + result.userIpAddress_ = userIpAddress_; + result.expectedAction_ = expectedAction_; onBuilt(); return result; } @@ -491,6 +686,18 @@ public Builder mergeFrom(com.google.recaptchaenterprise.v1beta1.Event other) { siteKey_ = other.siteKey_; onChanged(); } + if (!other.getUserAgent().isEmpty()) { + userAgent_ = other.userAgent_; + onChanged(); + } + if (!other.getUserIpAddress().isEmpty()) { + userIpAddress_ = other.userIpAddress_; + onChanged(); + } + if (!other.getExpectedAction().isEmpty()) { + expectedAction_ = other.expectedAction_; + onChanged(); + } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; @@ -525,11 +732,11 @@ public Builder mergeFrom( * * *
-     * Required. The user response token provided by the reCAPTCHA client-side integration
+     * Optional. The user response token provided by the reCAPTCHA client-side integration
      * on your site.
      * 
* - * string token = 1 [(.google.api.field_behavior) = REQUIRED]; + * string token = 1 [(.google.api.field_behavior) = OPTIONAL]; */ public java.lang.String getToken() { java.lang.Object ref = token_; @@ -546,11 +753,11 @@ public java.lang.String getToken() { * * *
-     * Required. The user response token provided by the reCAPTCHA client-side integration
+     * Optional. The user response token provided by the reCAPTCHA client-side integration
      * on your site.
      * 
* - * string token = 1 [(.google.api.field_behavior) = REQUIRED]; + * string token = 1 [(.google.api.field_behavior) = OPTIONAL]; */ public com.google.protobuf.ByteString getTokenBytes() { java.lang.Object ref = token_; @@ -567,11 +774,11 @@ public com.google.protobuf.ByteString getTokenBytes() { * * *
-     * Required. The user response token provided by the reCAPTCHA client-side integration
+     * Optional. The user response token provided by the reCAPTCHA client-side integration
      * on your site.
      * 
* - * string token = 1 [(.google.api.field_behavior) = REQUIRED]; + * string token = 1 [(.google.api.field_behavior) = OPTIONAL]; */ public Builder setToken(java.lang.String value) { if (value == null) { @@ -586,11 +793,11 @@ public Builder setToken(java.lang.String value) { * * *
-     * Required. The user response token provided by the reCAPTCHA client-side integration
+     * Optional. The user response token provided by the reCAPTCHA client-side integration
      * on your site.
      * 
* - * string token = 1 [(.google.api.field_behavior) = REQUIRED]; + * string token = 1 [(.google.api.field_behavior) = OPTIONAL]; */ public Builder clearToken() { @@ -602,11 +809,11 @@ public Builder clearToken() { * * *
-     * Required. The user response token provided by the reCAPTCHA client-side integration
+     * Optional. The user response token provided by the reCAPTCHA client-side integration
      * on your site.
      * 
* - * string token = 1 [(.google.api.field_behavior) = REQUIRED]; + * string token = 1 [(.google.api.field_behavior) = OPTIONAL]; */ public Builder setTokenBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -624,11 +831,11 @@ public Builder setTokenBytes(com.google.protobuf.ByteString value) { * * *
-     * Required. The site key that was used to invoke reCAPTCHA on your site and generate
+     * Optional. The site key that was used to invoke reCAPTCHA on your site and generate
      * the token.
      * 
* - * string site_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * string site_key = 2 [(.google.api.field_behavior) = OPTIONAL]; */ public java.lang.String getSiteKey() { java.lang.Object ref = siteKey_; @@ -645,11 +852,11 @@ public java.lang.String getSiteKey() { * * *
-     * Required. The site key that was used to invoke reCAPTCHA on your site and generate
+     * Optional. The site key that was used to invoke reCAPTCHA on your site and generate
      * the token.
      * 
* - * string site_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * string site_key = 2 [(.google.api.field_behavior) = OPTIONAL]; */ public com.google.protobuf.ByteString getSiteKeyBytes() { java.lang.Object ref = siteKey_; @@ -666,11 +873,11 @@ public com.google.protobuf.ByteString getSiteKeyBytes() { * * *
-     * Required. The site key that was used to invoke reCAPTCHA on your site and generate
+     * Optional. The site key that was used to invoke reCAPTCHA on your site and generate
      * the token.
      * 
* - * string site_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * string site_key = 2 [(.google.api.field_behavior) = OPTIONAL]; */ public Builder setSiteKey(java.lang.String value) { if (value == null) { @@ -685,11 +892,11 @@ public Builder setSiteKey(java.lang.String value) { * * *
-     * Required. The site key that was used to invoke reCAPTCHA on your site and generate
+     * Optional. The site key that was used to invoke reCAPTCHA on your site and generate
      * the token.
      * 
* - * string site_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * string site_key = 2 [(.google.api.field_behavior) = OPTIONAL]; */ public Builder clearSiteKey() { @@ -701,11 +908,11 @@ public Builder clearSiteKey() { * * *
-     * Required. The site key that was used to invoke reCAPTCHA on your site and generate
+     * Optional. The site key that was used to invoke reCAPTCHA on your site and generate
      * the token.
      * 
* - * string site_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * string site_key = 2 [(.google.api.field_behavior) = OPTIONAL]; */ public Builder setSiteKeyBytes(com.google.protobuf.ByteString value) { if (value == null) { @@ -718,6 +925,303 @@ public Builder setSiteKeyBytes(com.google.protobuf.ByteString value) { return this; } + private java.lang.Object userAgent_ = ""; + /** + * + * + *
+     * Optional. The user agent present in the request from the user's device related to
+     * this event.
+     * 
+ * + * string user_agent = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.lang.String getUserAgent() { + java.lang.Object ref = userAgent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userAgent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The user agent present in the request from the user's device related to
+     * this event.
+     * 
+ * + * string user_agent = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.protobuf.ByteString getUserAgentBytes() { + java.lang.Object ref = userAgent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userAgent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The user agent present in the request from the user's device related to
+     * this event.
+     * 
+ * + * string user_agent = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setUserAgent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + userAgent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The user agent present in the request from the user's device related to
+     * this event.
+     * 
+ * + * string user_agent = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder clearUserAgent() { + + userAgent_ = getDefaultInstance().getUserAgent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The user agent present in the request from the user's device related to
+     * this event.
+     * 
+ * + * string user_agent = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setUserAgentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + userAgent_ = value; + onChanged(); + return this; + } + + private java.lang.Object userIpAddress_ = ""; + /** + * + * + *
+     * Optional. The IP address in the request from the user's device related to this event.
+     * 
+ * + * string user_ip_address = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.lang.String getUserIpAddress() { + java.lang.Object ref = userIpAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userIpAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The IP address in the request from the user's device related to this event.
+     * 
+ * + * string user_ip_address = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.protobuf.ByteString getUserIpAddressBytes() { + java.lang.Object ref = userIpAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + userIpAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The IP address in the request from the user's device related to this event.
+     * 
+ * + * string user_ip_address = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setUserIpAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + userIpAddress_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The IP address in the request from the user's device related to this event.
+     * 
+ * + * string user_ip_address = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder clearUserIpAddress() { + + userIpAddress_ = getDefaultInstance().getUserIpAddress(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The IP address in the request from the user's device related to this event.
+     * 
+ * + * string user_ip_address = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setUserIpAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + userIpAddress_ = value; + onChanged(); + return this; + } + + private java.lang.Object expectedAction_ = ""; + /** + * + * + *
+     * Optional. The expected action for this type of event. This should be the same action
+     * provided at token generation time on client-side platforms already
+     * integrated with recaptcha enterprise.
+     * 
+ * + * string expected_action = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.lang.String getExpectedAction() { + java.lang.Object ref = expectedAction_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + expectedAction_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The expected action for this type of event. This should be the same action
+     * provided at token generation time on client-side platforms already
+     * integrated with recaptcha enterprise.
+     * 
+ * + * string expected_action = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.protobuf.ByteString getExpectedActionBytes() { + java.lang.Object ref = expectedAction_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + expectedAction_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The expected action for this type of event. This should be the same action
+     * provided at token generation time on client-side platforms already
+     * integrated with recaptcha enterprise.
+     * 
+ * + * string expected_action = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setExpectedAction(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + expectedAction_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The expected action for this type of event. This should be the same action
+     * provided at token generation time on client-side platforms already
+     * integrated with recaptcha enterprise.
+     * 
+ * + * string expected_action = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder clearExpectedAction() { + + expectedAction_ = getDefaultInstance().getExpectedAction(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The expected action for this type of event. This should be the same action
+     * provided at token generation time on client-side platforms already
+     * integrated with recaptcha enterprise.
+     * 
+ * + * string expected_action = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setExpectedActionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + expectedAction_ = value; + onChanged(); + return this; + } + @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/EventOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/EventOrBuilder.java index be832353..4b1d6dee 100644 --- a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/EventOrBuilder.java +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/EventOrBuilder.java @@ -27,22 +27,22 @@ public interface EventOrBuilder * * *
-   * Required. The user response token provided by the reCAPTCHA client-side integration
+   * Optional. The user response token provided by the reCAPTCHA client-side integration
    * on your site.
    * 
* - * string token = 1 [(.google.api.field_behavior) = REQUIRED]; + * string token = 1 [(.google.api.field_behavior) = OPTIONAL]; */ java.lang.String getToken(); /** * * *
-   * Required. The user response token provided by the reCAPTCHA client-side integration
+   * Optional. The user response token provided by the reCAPTCHA client-side integration
    * on your site.
    * 
* - * string token = 1 [(.google.api.field_behavior) = REQUIRED]; + * string token = 1 [(.google.api.field_behavior) = OPTIONAL]; */ com.google.protobuf.ByteString getTokenBytes(); @@ -50,22 +50,91 @@ public interface EventOrBuilder * * *
-   * Required. The site key that was used to invoke reCAPTCHA on your site and generate
+   * Optional. The site key that was used to invoke reCAPTCHA on your site and generate
    * the token.
    * 
* - * string site_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * string site_key = 2 [(.google.api.field_behavior) = OPTIONAL]; */ java.lang.String getSiteKey(); /** * * *
-   * Required. The site key that was used to invoke reCAPTCHA on your site and generate
+   * Optional. The site key that was used to invoke reCAPTCHA on your site and generate
    * the token.
    * 
* - * string site_key = 2 [(.google.api.field_behavior) = REQUIRED]; + * string site_key = 2 [(.google.api.field_behavior) = OPTIONAL]; */ com.google.protobuf.ByteString getSiteKeyBytes(); + + /** + * + * + *
+   * Optional. The user agent present in the request from the user's device related to
+   * this event.
+   * 
+ * + * string user_agent = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getUserAgent(); + /** + * + * + *
+   * Optional. The user agent present in the request from the user's device related to
+   * this event.
+   * 
+ * + * string user_agent = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + com.google.protobuf.ByteString getUserAgentBytes(); + + /** + * + * + *
+   * Optional. The IP address in the request from the user's device related to this event.
+   * 
+ * + * string user_ip_address = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getUserIpAddress(); + /** + * + * + *
+   * Optional. The IP address in the request from the user's device related to this event.
+   * 
+ * + * string user_ip_address = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + com.google.protobuf.ByteString getUserIpAddressBytes(); + + /** + * + * + *
+   * Optional. The expected action for this type of event. This should be the same action
+   * provided at token generation time on client-side platforms already
+   * integrated with recaptcha enterprise.
+   * 
+ * + * string expected_action = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getExpectedAction(); + /** + * + * + *
+   * Optional. The expected action for this type of event. This should be the same action
+   * provided at token generation time on client-side platforms already
+   * integrated with recaptcha enterprise.
+   * 
+ * + * string expected_action = 5 [(.google.api.field_behavior) = OPTIONAL]; + */ + com.google.protobuf.ByteString getExpectedActionBytes(); } diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/GetKeyRequest.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/GetKeyRequest.java new file mode 100644 index 00000000..facd6709 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/GetKeyRequest.java @@ -0,0 +1,634 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +/** + * + * + *
+ * The get key request message.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest} + */ +public final class GetKeyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest) + GetKeyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetKeyRequest.newBuilder() to construct. + private GetKeyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetKeyRequest() { + name_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private GetKeyRequest( + 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; + } + 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_GetKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_GetKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.GetKeyRequest.class, + com.google.recaptchaenterprise.v1beta1.GetKeyRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * Required. The name of the requested key, in the format
+   * "projects/{project_number}/keys/{key_id}".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + 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 name of the requested key, in the format
+   * "projects/{project_number}/keys/{key_id}".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + 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; + } + } + + 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_); + } + 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_); + } + 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.GetKeyRequest)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1beta1.GetKeyRequest other = + (com.google.recaptchaenterprise.v1beta1.GetKeyRequest) obj; + + if (!getName().equals(other.getName())) 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 = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1beta1.GetKeyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.GetKeyRequest 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.GetKeyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.GetKeyRequest 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.GetKeyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.GetKeyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.GetKeyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.GetKeyRequest 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.GetKeyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.GetKeyRequest 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.GetKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.GetKeyRequest 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.GetKeyRequest 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 get key request message.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest) + com.google.recaptchaenterprise.v1beta1.GetKeyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_GetKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_GetKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.GetKeyRequest.class, + com.google.recaptchaenterprise.v1beta1.GetKeyRequest.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1beta1.GetKeyRequest.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_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_GetKeyRequest_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.GetKeyRequest getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1beta1.GetKeyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.GetKeyRequest build() { + com.google.recaptchaenterprise.v1beta1.GetKeyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.GetKeyRequest buildPartial() { + com.google.recaptchaenterprise.v1beta1.GetKeyRequest result = + new com.google.recaptchaenterprise.v1beta1.GetKeyRequest(this); + result.name_ = name_; + 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.GetKeyRequest) { + return mergeFrom((com.google.recaptchaenterprise.v1beta1.GetKeyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1beta1.GetKeyRequest other) { + if (other == com.google.recaptchaenterprise.v1beta1.GetKeyRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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.GetKeyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.recaptchaenterprise.v1beta1.GetKeyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the requested key, in the format
+     * "projects/{project_number}/keys/{key_id}".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + 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 name of the requested key, in the format
+     * "projects/{project_number}/keys/{key_id}".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + 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 name of the requested key, in the format
+     * "projects/{project_number}/keys/{key_id}".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the requested key, in the format
+     * "projects/{project_number}/keys/{key_id}".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the requested key, in the format
+     * "projects/{project_number}/keys/{key_id}".
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = 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.GetKeyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest) + private static final com.google.recaptchaenterprise.v1beta1.GetKeyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1beta1.GetKeyRequest(); + } + + public static com.google.recaptchaenterprise.v1beta1.GetKeyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetKeyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetKeyRequest(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.GetKeyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/GetKeyRequestOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/GetKeyRequestOrBuilder.java new file mode 100644 index 00000000..8c3220e0 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/GetKeyRequestOrBuilder.java @@ -0,0 +1,52 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +public interface GetKeyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1beta1.GetKeyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the requested key, in the format
+   * "projects/{project_number}/keys/{key_id}".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the requested key, in the format
+   * "projects/{project_number}/keys/{key_id}".
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + com.google.protobuf.ByteString getNameBytes(); +} diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/IOSKeySettings.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/IOSKeySettings.java new file mode 100644 index 00000000..492f0909 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/IOSKeySettings.java @@ -0,0 +1,710 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +/** + * + * + *
+ * Settings specific to keys that can be used by iOS apps.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings} + */ +public final class IOSKeySettings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings) + IOSKeySettingsOrBuilder { + private static final long serialVersionUID = 0L; + // Use IOSKeySettings.newBuilder() to construct. + private IOSKeySettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private IOSKeySettings() { + allowedBundleIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private IOSKeySettings( + 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(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + allowedBundleIds_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + allowedBundleIds_.add(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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + allowedBundleIds_ = allowedBundleIds_.getUnmodifiableView(); + } + 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_IOSKeySettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_IOSKeySettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.IOSKeySettings.class, + com.google.recaptchaenterprise.v1beta1.IOSKeySettings.Builder.class); + } + + public static final int ALLOWED_BUNDLE_IDS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList allowedBundleIds_; + /** + * + * + *
+   * iOS bundle ids of apps allowed to use the key.
+   * Example: 'com.companyname.productname.appname'
+   * 
+ * + * repeated string allowed_bundle_ids = 1; + */ + public com.google.protobuf.ProtocolStringList getAllowedBundleIdsList() { + return allowedBundleIds_; + } + /** + * + * + *
+   * iOS bundle ids of apps allowed to use the key.
+   * Example: 'com.companyname.productname.appname'
+   * 
+ * + * repeated string allowed_bundle_ids = 1; + */ + public int getAllowedBundleIdsCount() { + return allowedBundleIds_.size(); + } + /** + * + * + *
+   * iOS bundle ids of apps allowed to use the key.
+   * Example: 'com.companyname.productname.appname'
+   * 
+ * + * repeated string allowed_bundle_ids = 1; + */ + public java.lang.String getAllowedBundleIds(int index) { + return allowedBundleIds_.get(index); + } + /** + * + * + *
+   * iOS bundle ids of apps allowed to use the key.
+   * Example: 'com.companyname.productname.appname'
+   * 
+ * + * repeated string allowed_bundle_ids = 1; + */ + public com.google.protobuf.ByteString getAllowedBundleIdsBytes(int index) { + return allowedBundleIds_.getByteString(index); + } + + 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 { + for (int i = 0; i < allowedBundleIds_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, allowedBundleIds_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < allowedBundleIds_.size(); i++) { + dataSize += computeStringSizeNoTag(allowedBundleIds_.getRaw(i)); + } + size += dataSize; + size += 1 * getAllowedBundleIdsList().size(); + } + 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.IOSKeySettings)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1beta1.IOSKeySettings other = + (com.google.recaptchaenterprise.v1beta1.IOSKeySettings) obj; + + if (!getAllowedBundleIdsList().equals(other.getAllowedBundleIdsList())) 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(); + if (getAllowedBundleIdsCount() > 0) { + hash = (37 * hash) + ALLOWED_BUNDLE_IDS_FIELD_NUMBER; + hash = (53 * hash) + getAllowedBundleIdsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1beta1.IOSKeySettings parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.IOSKeySettings 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.IOSKeySettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.IOSKeySettings 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.IOSKeySettings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.IOSKeySettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.IOSKeySettings parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.IOSKeySettings 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.IOSKeySettings parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.IOSKeySettings 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.IOSKeySettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.IOSKeySettings 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.IOSKeySettings 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; + } + /** + * + * + *
+   * Settings specific to keys that can be used by iOS apps.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings) + com.google.recaptchaenterprise.v1beta1.IOSKeySettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_IOSKeySettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_IOSKeySettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.IOSKeySettings.class, + com.google.recaptchaenterprise.v1beta1.IOSKeySettings.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1beta1.IOSKeySettings.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(); + allowedBundleIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_IOSKeySettings_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.IOSKeySettings getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1beta1.IOSKeySettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.IOSKeySettings build() { + com.google.recaptchaenterprise.v1beta1.IOSKeySettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.IOSKeySettings buildPartial() { + com.google.recaptchaenterprise.v1beta1.IOSKeySettings result = + new com.google.recaptchaenterprise.v1beta1.IOSKeySettings(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + allowedBundleIds_ = allowedBundleIds_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.allowedBundleIds_ = allowedBundleIds_; + 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.IOSKeySettings) { + return mergeFrom((com.google.recaptchaenterprise.v1beta1.IOSKeySettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1beta1.IOSKeySettings other) { + if (other == com.google.recaptchaenterprise.v1beta1.IOSKeySettings.getDefaultInstance()) + return this; + if (!other.allowedBundleIds_.isEmpty()) { + if (allowedBundleIds_.isEmpty()) { + allowedBundleIds_ = other.allowedBundleIds_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAllowedBundleIdsIsMutable(); + allowedBundleIds_.addAll(other.allowedBundleIds_); + } + 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.IOSKeySettings parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.recaptchaenterprise.v1beta1.IOSKeySettings) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringList allowedBundleIds_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAllowedBundleIdsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + allowedBundleIds_ = new com.google.protobuf.LazyStringArrayList(allowedBundleIds_); + bitField0_ |= 0x00000001; + } + } + /** + * + * + *
+     * iOS bundle ids of apps allowed to use the key.
+     * Example: 'com.companyname.productname.appname'
+     * 
+ * + * repeated string allowed_bundle_ids = 1; + */ + public com.google.protobuf.ProtocolStringList getAllowedBundleIdsList() { + return allowedBundleIds_.getUnmodifiableView(); + } + /** + * + * + *
+     * iOS bundle ids of apps allowed to use the key.
+     * Example: 'com.companyname.productname.appname'
+     * 
+ * + * repeated string allowed_bundle_ids = 1; + */ + public int getAllowedBundleIdsCount() { + return allowedBundleIds_.size(); + } + /** + * + * + *
+     * iOS bundle ids of apps allowed to use the key.
+     * Example: 'com.companyname.productname.appname'
+     * 
+ * + * repeated string allowed_bundle_ids = 1; + */ + public java.lang.String getAllowedBundleIds(int index) { + return allowedBundleIds_.get(index); + } + /** + * + * + *
+     * iOS bundle ids of apps allowed to use the key.
+     * Example: 'com.companyname.productname.appname'
+     * 
+ * + * repeated string allowed_bundle_ids = 1; + */ + public com.google.protobuf.ByteString getAllowedBundleIdsBytes(int index) { + return allowedBundleIds_.getByteString(index); + } + /** + * + * + *
+     * iOS bundle ids of apps allowed to use the key.
+     * Example: 'com.companyname.productname.appname'
+     * 
+ * + * repeated string allowed_bundle_ids = 1; + */ + public Builder setAllowedBundleIds(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedBundleIdsIsMutable(); + allowedBundleIds_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * iOS bundle ids of apps allowed to use the key.
+     * Example: 'com.companyname.productname.appname'
+     * 
+ * + * repeated string allowed_bundle_ids = 1; + */ + public Builder addAllowedBundleIds(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedBundleIdsIsMutable(); + allowedBundleIds_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * iOS bundle ids of apps allowed to use the key.
+     * Example: 'com.companyname.productname.appname'
+     * 
+ * + * repeated string allowed_bundle_ids = 1; + */ + public Builder addAllAllowedBundleIds(java.lang.Iterable values) { + ensureAllowedBundleIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedBundleIds_); + onChanged(); + return this; + } + /** + * + * + *
+     * iOS bundle ids of apps allowed to use the key.
+     * Example: 'com.companyname.productname.appname'
+     * 
+ * + * repeated string allowed_bundle_ids = 1; + */ + public Builder clearAllowedBundleIds() { + allowedBundleIds_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * iOS bundle ids of apps allowed to use the key.
+     * Example: 'com.companyname.productname.appname'
+     * 
+ * + * repeated string allowed_bundle_ids = 1; + */ + public Builder addAllowedBundleIdsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAllowedBundleIdsIsMutable(); + allowedBundleIds_.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.IOSKeySettings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings) + private static final com.google.recaptchaenterprise.v1beta1.IOSKeySettings DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1beta1.IOSKeySettings(); + } + + public static com.google.recaptchaenterprise.v1beta1.IOSKeySettings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public IOSKeySettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new IOSKeySettings(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.IOSKeySettings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/IOSKeySettingsOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/IOSKeySettingsOrBuilder.java new file mode 100644 index 00000000..bdbaa9b7 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/IOSKeySettingsOrBuilder.java @@ -0,0 +1,70 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +public interface IOSKeySettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * iOS bundle ids of apps allowed to use the key.
+   * Example: 'com.companyname.productname.appname'
+   * 
+ * + * repeated string allowed_bundle_ids = 1; + */ + java.util.List getAllowedBundleIdsList(); + /** + * + * + *
+   * iOS bundle ids of apps allowed to use the key.
+   * Example: 'com.companyname.productname.appname'
+   * 
+ * + * repeated string allowed_bundle_ids = 1; + */ + int getAllowedBundleIdsCount(); + /** + * + * + *
+   * iOS bundle ids of apps allowed to use the key.
+   * Example: 'com.companyname.productname.appname'
+   * 
+ * + * repeated string allowed_bundle_ids = 1; + */ + java.lang.String getAllowedBundleIds(int index); + /** + * + * + *
+   * iOS bundle ids of apps allowed to use the key.
+   * Example: 'com.companyname.productname.appname'
+   * 
+ * + * repeated string allowed_bundle_ids = 1; + */ + com.google.protobuf.ByteString getAllowedBundleIdsBytes(int index); +} diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/Key.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/Key.java new file mode 100644 index 00000000..1aaafbfe --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/Key.java @@ -0,0 +1,1760 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +/** + * + * + *
+ * A key used to identify and configure applications (web and/or mobile) that
+ * use reCAPTCHA Enterprise.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.Key} + */ +public final class Key extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1beta1.Key) + KeyOrBuilder { + private static final long serialVersionUID = 0L; + // Use Key.newBuilder() to construct. + private Key(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Key() { + name_ = ""; + displayName_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private Key( + 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: + { + java.lang.String s = input.readStringRequireUtf8(); + + displayName_ = s; + break; + } + case 26: + { + com.google.recaptchaenterprise.v1beta1.WebKeySettings.Builder subBuilder = null; + if (platformSettingsCase_ == 3) { + subBuilder = + ((com.google.recaptchaenterprise.v1beta1.WebKeySettings) platformSettings_) + .toBuilder(); + } + platformSettings_ = + input.readMessage( + com.google.recaptchaenterprise.v1beta1.WebKeySettings.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.recaptchaenterprise.v1beta1.WebKeySettings) platformSettings_); + platformSettings_ = subBuilder.buildPartial(); + } + platformSettingsCase_ = 3; + break; + } + case 34: + { + com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.Builder subBuilder = null; + if (platformSettingsCase_ == 4) { + subBuilder = + ((com.google.recaptchaenterprise.v1beta1.AndroidKeySettings) platformSettings_) + .toBuilder(); + } + platformSettings_ = + input.readMessage( + com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.recaptchaenterprise.v1beta1.AndroidKeySettings) platformSettings_); + platformSettings_ = subBuilder.buildPartial(); + } + platformSettingsCase_ = 4; + break; + } + case 42: + { + com.google.recaptchaenterprise.v1beta1.IOSKeySettings.Builder subBuilder = null; + if (platformSettingsCase_ == 5) { + subBuilder = + ((com.google.recaptchaenterprise.v1beta1.IOSKeySettings) platformSettings_) + .toBuilder(); + } + platformSettings_ = + input.readMessage( + com.google.recaptchaenterprise.v1beta1.IOSKeySettings.parser(), + extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom( + (com.google.recaptchaenterprise.v1beta1.IOSKeySettings) platformSettings_); + platformSettings_ = subBuilder.buildPartial(); + } + platformSettingsCase_ = 5; + 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_Key_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_Key_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.Key.class, + com.google.recaptchaenterprise.v1beta1.Key.Builder.class); + } + + private int platformSettingsCase_ = 0; + private java.lang.Object platformSettings_; + + public enum PlatformSettingsCase implements com.google.protobuf.Internal.EnumLite { + WEB_SETTINGS(3), + ANDROID_SETTINGS(4), + IOS_SETTINGS(5), + PLATFORMSETTINGS_NOT_SET(0); + private final int value; + + private PlatformSettingsCase(int value) { + this.value = value; + } + /** @deprecated Use {@link #forNumber(int)} instead. */ + @java.lang.Deprecated + public static PlatformSettingsCase valueOf(int value) { + return forNumber(value); + } + + public static PlatformSettingsCase forNumber(int value) { + switch (value) { + case 3: + return WEB_SETTINGS; + case 4: + return ANDROID_SETTINGS; + case 5: + return IOS_SETTINGS; + case 0: + return PLATFORMSETTINGS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PlatformSettingsCase getPlatformSettingsCase() { + return PlatformSettingsCase.forNumber(platformSettingsCase_); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + * + * + *
+   * The resource name for the Key in the format
+   * "projects/{project_number}/keys/{key_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; + } + } + /** + * + * + *
+   * The resource name for the Key in the format
+   * "projects/{project_number}/keys/{key_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 DISPLAY_NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object displayName_; + /** + * + * + *
+   * Human-readable display name of this key. Modifiable by user.
+   * 
+ * + * string display_name = 2; + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + 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(); + displayName_ = s; + return s; + } + } + /** + * + * + *
+   * Human-readable display name of this key. Modifiable by user.
+   * 
+ * + * string display_name = 2; + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WEB_SETTINGS_FIELD_NUMBER = 3; + /** + * + * + *
+   * Settings for keys that can be used by websites.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings web_settings = 3; + */ + public boolean hasWebSettings() { + return platformSettingsCase_ == 3; + } + /** + * + * + *
+   * Settings for keys that can be used by websites.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings web_settings = 3; + */ + public com.google.recaptchaenterprise.v1beta1.WebKeySettings getWebSettings() { + if (platformSettingsCase_ == 3) { + return (com.google.recaptchaenterprise.v1beta1.WebKeySettings) platformSettings_; + } + return com.google.recaptchaenterprise.v1beta1.WebKeySettings.getDefaultInstance(); + } + /** + * + * + *
+   * Settings for keys that can be used by websites.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings web_settings = 3; + */ + public com.google.recaptchaenterprise.v1beta1.WebKeySettingsOrBuilder getWebSettingsOrBuilder() { + if (platformSettingsCase_ == 3) { + return (com.google.recaptchaenterprise.v1beta1.WebKeySettings) platformSettings_; + } + return com.google.recaptchaenterprise.v1beta1.WebKeySettings.getDefaultInstance(); + } + + public static final int ANDROID_SETTINGS_FIELD_NUMBER = 4; + /** + * + * + *
+   * Settings for keys that can be used by Android apps.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings android_settings = 4; + */ + public boolean hasAndroidSettings() { + return platformSettingsCase_ == 4; + } + /** + * + * + *
+   * Settings for keys that can be used by Android apps.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings android_settings = 4; + */ + public com.google.recaptchaenterprise.v1beta1.AndroidKeySettings getAndroidSettings() { + if (platformSettingsCase_ == 4) { + return (com.google.recaptchaenterprise.v1beta1.AndroidKeySettings) platformSettings_; + } + return com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.getDefaultInstance(); + } + /** + * + * + *
+   * Settings for keys that can be used by Android apps.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings android_settings = 4; + */ + public com.google.recaptchaenterprise.v1beta1.AndroidKeySettingsOrBuilder + getAndroidSettingsOrBuilder() { + if (platformSettingsCase_ == 4) { + return (com.google.recaptchaenterprise.v1beta1.AndroidKeySettings) platformSettings_; + } + return com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.getDefaultInstance(); + } + + public static final int IOS_SETTINGS_FIELD_NUMBER = 5; + /** + * + * + *
+   * Settings for keys that can be used by iOS apps.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings ios_settings = 5; + */ + public boolean hasIosSettings() { + return platformSettingsCase_ == 5; + } + /** + * + * + *
+   * Settings for keys that can be used by iOS apps.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings ios_settings = 5; + */ + public com.google.recaptchaenterprise.v1beta1.IOSKeySettings getIosSettings() { + if (platformSettingsCase_ == 5) { + return (com.google.recaptchaenterprise.v1beta1.IOSKeySettings) platformSettings_; + } + return com.google.recaptchaenterprise.v1beta1.IOSKeySettings.getDefaultInstance(); + } + /** + * + * + *
+   * Settings for keys that can be used by iOS apps.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings ios_settings = 5; + */ + public com.google.recaptchaenterprise.v1beta1.IOSKeySettingsOrBuilder getIosSettingsOrBuilder() { + if (platformSettingsCase_ == 5) { + return (com.google.recaptchaenterprise.v1beta1.IOSKeySettings) platformSettings_; + } + return com.google.recaptchaenterprise.v1beta1.IOSKeySettings.getDefaultInstance(); + } + + 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 (!getDisplayNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_); + } + if (platformSettingsCase_ == 3) { + output.writeMessage( + 3, (com.google.recaptchaenterprise.v1beta1.WebKeySettings) platformSettings_); + } + if (platformSettingsCase_ == 4) { + output.writeMessage( + 4, (com.google.recaptchaenterprise.v1beta1.AndroidKeySettings) platformSettings_); + } + if (platformSettingsCase_ == 5) { + output.writeMessage( + 5, (com.google.recaptchaenterprise.v1beta1.IOSKeySettings) platformSettings_); + } + 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 (!getDisplayNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_); + } + if (platformSettingsCase_ == 3) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 3, (com.google.recaptchaenterprise.v1beta1.WebKeySettings) platformSettings_); + } + if (platformSettingsCase_ == 4) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 4, (com.google.recaptchaenterprise.v1beta1.AndroidKeySettings) platformSettings_); + } + if (platformSettingsCase_ == 5) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 5, (com.google.recaptchaenterprise.v1beta1.IOSKeySettings) platformSettings_); + } + 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.Key)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1beta1.Key other = + (com.google.recaptchaenterprise.v1beta1.Key) obj; + + if (!getName().equals(other.getName())) return false; + if (!getDisplayName().equals(other.getDisplayName())) return false; + if (!getPlatformSettingsCase().equals(other.getPlatformSettingsCase())) return false; + switch (platformSettingsCase_) { + case 3: + if (!getWebSettings().equals(other.getWebSettings())) return false; + break; + case 4: + if (!getAndroidSettings().equals(other.getAndroidSettings())) return false; + break; + case 5: + if (!getIosSettings().equals(other.getIosSettings())) return false; + break; + case 0: + default: + } + 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) + DISPLAY_NAME_FIELD_NUMBER; + hash = (53 * hash) + getDisplayName().hashCode(); + switch (platformSettingsCase_) { + case 3: + hash = (37 * hash) + WEB_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getWebSettings().hashCode(); + break; + case 4: + hash = (37 * hash) + ANDROID_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getAndroidSettings().hashCode(); + break; + case 5: + hash = (37 * hash) + IOS_SETTINGS_FIELD_NUMBER; + hash = (53 * hash) + getIosSettings().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1beta1.Key parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.Key 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.Key parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.Key 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.Key parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.Key parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.Key parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.Key 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.Key parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.Key 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.Key parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.Key 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.Key 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 key used to identify and configure applications (web and/or mobile) that
+   * use reCAPTCHA Enterprise.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.Key} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1beta1.Key) + com.google.recaptchaenterprise.v1beta1.KeyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_Key_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_Key_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.Key.class, + com.google.recaptchaenterprise.v1beta1.Key.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1beta1.Key.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_ = ""; + + displayName_ = ""; + + platformSettingsCase_ = 0; + platformSettings_ = 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_Key_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.Key getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1beta1.Key.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.Key build() { + com.google.recaptchaenterprise.v1beta1.Key result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.Key buildPartial() { + com.google.recaptchaenterprise.v1beta1.Key result = + new com.google.recaptchaenterprise.v1beta1.Key(this); + result.name_ = name_; + result.displayName_ = displayName_; + if (platformSettingsCase_ == 3) { + if (webSettingsBuilder_ == null) { + result.platformSettings_ = platformSettings_; + } else { + result.platformSettings_ = webSettingsBuilder_.build(); + } + } + if (platformSettingsCase_ == 4) { + if (androidSettingsBuilder_ == null) { + result.platformSettings_ = platformSettings_; + } else { + result.platformSettings_ = androidSettingsBuilder_.build(); + } + } + if (platformSettingsCase_ == 5) { + if (iosSettingsBuilder_ == null) { + result.platformSettings_ = platformSettings_; + } else { + result.platformSettings_ = iosSettingsBuilder_.build(); + } + } + result.platformSettingsCase_ = platformSettingsCase_; + 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.Key) { + return mergeFrom((com.google.recaptchaenterprise.v1beta1.Key) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1beta1.Key other) { + if (other == com.google.recaptchaenterprise.v1beta1.Key.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (!other.getDisplayName().isEmpty()) { + displayName_ = other.displayName_; + onChanged(); + } + switch (other.getPlatformSettingsCase()) { + case WEB_SETTINGS: + { + mergeWebSettings(other.getWebSettings()); + break; + } + case ANDROID_SETTINGS: + { + mergeAndroidSettings(other.getAndroidSettings()); + break; + } + case IOS_SETTINGS: + { + mergeIosSettings(other.getIosSettings()); + break; + } + case PLATFORMSETTINGS_NOT_SET: + { + break; + } + } + 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.Key parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.recaptchaenterprise.v1beta1.Key) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int platformSettingsCase_ = 0; + private java.lang.Object platformSettings_; + + public PlatformSettingsCase getPlatformSettingsCase() { + return PlatformSettingsCase.forNumber(platformSettingsCase_); + } + + public Builder clearPlatformSettings() { + platformSettingsCase_ = 0; + platformSettings_ = null; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * The resource name for the Key in the format
+     * "projects/{project_number}/keys/{key_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; + } + } + /** + * + * + *
+     * The resource name for the Key in the format
+     * "projects/{project_number}/keys/{key_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; + } + } + /** + * + * + *
+     * The resource name for the Key in the format
+     * "projects/{project_number}/keys/{key_id}".
+     * 
+ * + * string name = 1; + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name for the Key in the format
+     * "projects/{project_number}/keys/{key_id}".
+     * 
+ * + * string name = 1; + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * + * + *
+     * The resource name for the Key in the format
+     * "projects/{project_number}/keys/{key_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 java.lang.Object displayName_ = ""; + /** + * + * + *
+     * Human-readable display name of this key. Modifiable by user.
+     * 
+ * + * string display_name = 2; + */ + public java.lang.String getDisplayName() { + java.lang.Object ref = displayName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + displayName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Human-readable display name of this key. Modifiable by user.
+     * 
+ * + * string display_name = 2; + */ + public com.google.protobuf.ByteString getDisplayNameBytes() { + java.lang.Object ref = displayName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + displayName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Human-readable display name of this key. Modifiable by user.
+     * 
+ * + * string display_name = 2; + */ + public Builder setDisplayName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + displayName_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Human-readable display name of this key. Modifiable by user.
+     * 
+ * + * string display_name = 2; + */ + public Builder clearDisplayName() { + + displayName_ = getDefaultInstance().getDisplayName(); + onChanged(); + return this; + } + /** + * + * + *
+     * Human-readable display name of this key. Modifiable by user.
+     * 
+ * + * string display_name = 2; + */ + public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + displayName_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.WebKeySettings, + com.google.recaptchaenterprise.v1beta1.WebKeySettings.Builder, + com.google.recaptchaenterprise.v1beta1.WebKeySettingsOrBuilder> + webSettingsBuilder_; + /** + * + * + *
+     * Settings for keys that can be used by websites.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings web_settings = 3; + */ + public boolean hasWebSettings() { + return platformSettingsCase_ == 3; + } + /** + * + * + *
+     * Settings for keys that can be used by websites.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings web_settings = 3; + */ + public com.google.recaptchaenterprise.v1beta1.WebKeySettings getWebSettings() { + if (webSettingsBuilder_ == null) { + if (platformSettingsCase_ == 3) { + return (com.google.recaptchaenterprise.v1beta1.WebKeySettings) platformSettings_; + } + return com.google.recaptchaenterprise.v1beta1.WebKeySettings.getDefaultInstance(); + } else { + if (platformSettingsCase_ == 3) { + return webSettingsBuilder_.getMessage(); + } + return com.google.recaptchaenterprise.v1beta1.WebKeySettings.getDefaultInstance(); + } + } + /** + * + * + *
+     * Settings for keys that can be used by websites.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings web_settings = 3; + */ + public Builder setWebSettings(com.google.recaptchaenterprise.v1beta1.WebKeySettings value) { + if (webSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + platformSettings_ = value; + onChanged(); + } else { + webSettingsBuilder_.setMessage(value); + } + platformSettingsCase_ = 3; + return this; + } + /** + * + * + *
+     * Settings for keys that can be used by websites.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings web_settings = 3; + */ + public Builder setWebSettings( + com.google.recaptchaenterprise.v1beta1.WebKeySettings.Builder builderForValue) { + if (webSettingsBuilder_ == null) { + platformSettings_ = builderForValue.build(); + onChanged(); + } else { + webSettingsBuilder_.setMessage(builderForValue.build()); + } + platformSettingsCase_ = 3; + return this; + } + /** + * + * + *
+     * Settings for keys that can be used by websites.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings web_settings = 3; + */ + public Builder mergeWebSettings(com.google.recaptchaenterprise.v1beta1.WebKeySettings value) { + if (webSettingsBuilder_ == null) { + if (platformSettingsCase_ == 3 + && platformSettings_ + != com.google.recaptchaenterprise.v1beta1.WebKeySettings.getDefaultInstance()) { + platformSettings_ = + com.google.recaptchaenterprise.v1beta1.WebKeySettings.newBuilder( + (com.google.recaptchaenterprise.v1beta1.WebKeySettings) platformSettings_) + .mergeFrom(value) + .buildPartial(); + } else { + platformSettings_ = value; + } + onChanged(); + } else { + if (platformSettingsCase_ == 3) { + webSettingsBuilder_.mergeFrom(value); + } + webSettingsBuilder_.setMessage(value); + } + platformSettingsCase_ = 3; + return this; + } + /** + * + * + *
+     * Settings for keys that can be used by websites.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings web_settings = 3; + */ + public Builder clearWebSettings() { + if (webSettingsBuilder_ == null) { + if (platformSettingsCase_ == 3) { + platformSettingsCase_ = 0; + platformSettings_ = null; + onChanged(); + } + } else { + if (platformSettingsCase_ == 3) { + platformSettingsCase_ = 0; + platformSettings_ = null; + } + webSettingsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Settings for keys that can be used by websites.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings web_settings = 3; + */ + public com.google.recaptchaenterprise.v1beta1.WebKeySettings.Builder getWebSettingsBuilder() { + return getWebSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Settings for keys that can be used by websites.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings web_settings = 3; + */ + public com.google.recaptchaenterprise.v1beta1.WebKeySettingsOrBuilder + getWebSettingsOrBuilder() { + if ((platformSettingsCase_ == 3) && (webSettingsBuilder_ != null)) { + return webSettingsBuilder_.getMessageOrBuilder(); + } else { + if (platformSettingsCase_ == 3) { + return (com.google.recaptchaenterprise.v1beta1.WebKeySettings) platformSettings_; + } + return com.google.recaptchaenterprise.v1beta1.WebKeySettings.getDefaultInstance(); + } + } + /** + * + * + *
+     * Settings for keys that can be used by websites.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings web_settings = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.WebKeySettings, + com.google.recaptchaenterprise.v1beta1.WebKeySettings.Builder, + com.google.recaptchaenterprise.v1beta1.WebKeySettingsOrBuilder> + getWebSettingsFieldBuilder() { + if (webSettingsBuilder_ == null) { + if (!(platformSettingsCase_ == 3)) { + platformSettings_ = + com.google.recaptchaenterprise.v1beta1.WebKeySettings.getDefaultInstance(); + } + webSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.WebKeySettings, + com.google.recaptchaenterprise.v1beta1.WebKeySettings.Builder, + com.google.recaptchaenterprise.v1beta1.WebKeySettingsOrBuilder>( + (com.google.recaptchaenterprise.v1beta1.WebKeySettings) platformSettings_, + getParentForChildren(), + isClean()); + platformSettings_ = null; + } + platformSettingsCase_ = 3; + onChanged(); + ; + return webSettingsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.AndroidKeySettings, + com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.Builder, + com.google.recaptchaenterprise.v1beta1.AndroidKeySettingsOrBuilder> + androidSettingsBuilder_; + /** + * + * + *
+     * Settings for keys that can be used by Android apps.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings android_settings = 4; + * + */ + public boolean hasAndroidSettings() { + return platformSettingsCase_ == 4; + } + /** + * + * + *
+     * Settings for keys that can be used by Android apps.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings android_settings = 4; + * + */ + public com.google.recaptchaenterprise.v1beta1.AndroidKeySettings getAndroidSettings() { + if (androidSettingsBuilder_ == null) { + if (platformSettingsCase_ == 4) { + return (com.google.recaptchaenterprise.v1beta1.AndroidKeySettings) platformSettings_; + } + return com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.getDefaultInstance(); + } else { + if (platformSettingsCase_ == 4) { + return androidSettingsBuilder_.getMessage(); + } + return com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.getDefaultInstance(); + } + } + /** + * + * + *
+     * Settings for keys that can be used by Android apps.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings android_settings = 4; + * + */ + public Builder setAndroidSettings( + com.google.recaptchaenterprise.v1beta1.AndroidKeySettings value) { + if (androidSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + platformSettings_ = value; + onChanged(); + } else { + androidSettingsBuilder_.setMessage(value); + } + platformSettingsCase_ = 4; + return this; + } + /** + * + * + *
+     * Settings for keys that can be used by Android apps.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings android_settings = 4; + * + */ + public Builder setAndroidSettings( + com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.Builder builderForValue) { + if (androidSettingsBuilder_ == null) { + platformSettings_ = builderForValue.build(); + onChanged(); + } else { + androidSettingsBuilder_.setMessage(builderForValue.build()); + } + platformSettingsCase_ = 4; + return this; + } + /** + * + * + *
+     * Settings for keys that can be used by Android apps.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings android_settings = 4; + * + */ + public Builder mergeAndroidSettings( + com.google.recaptchaenterprise.v1beta1.AndroidKeySettings value) { + if (androidSettingsBuilder_ == null) { + if (platformSettingsCase_ == 4 + && platformSettings_ + != com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.getDefaultInstance()) { + platformSettings_ = + com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.newBuilder( + (com.google.recaptchaenterprise.v1beta1.AndroidKeySettings) platformSettings_) + .mergeFrom(value) + .buildPartial(); + } else { + platformSettings_ = value; + } + onChanged(); + } else { + if (platformSettingsCase_ == 4) { + androidSettingsBuilder_.mergeFrom(value); + } + androidSettingsBuilder_.setMessage(value); + } + platformSettingsCase_ = 4; + return this; + } + /** + * + * + *
+     * Settings for keys that can be used by Android apps.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings android_settings = 4; + * + */ + public Builder clearAndroidSettings() { + if (androidSettingsBuilder_ == null) { + if (platformSettingsCase_ == 4) { + platformSettingsCase_ = 0; + platformSettings_ = null; + onChanged(); + } + } else { + if (platformSettingsCase_ == 4) { + platformSettingsCase_ = 0; + platformSettings_ = null; + } + androidSettingsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Settings for keys that can be used by Android apps.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings android_settings = 4; + * + */ + public com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.Builder + getAndroidSettingsBuilder() { + return getAndroidSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Settings for keys that can be used by Android apps.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings android_settings = 4; + * + */ + public com.google.recaptchaenterprise.v1beta1.AndroidKeySettingsOrBuilder + getAndroidSettingsOrBuilder() { + if ((platformSettingsCase_ == 4) && (androidSettingsBuilder_ != null)) { + return androidSettingsBuilder_.getMessageOrBuilder(); + } else { + if (platformSettingsCase_ == 4) { + return (com.google.recaptchaenterprise.v1beta1.AndroidKeySettings) platformSettings_; + } + return com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.getDefaultInstance(); + } + } + /** + * + * + *
+     * Settings for keys that can be used by Android apps.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings android_settings = 4; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.AndroidKeySettings, + com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.Builder, + com.google.recaptchaenterprise.v1beta1.AndroidKeySettingsOrBuilder> + getAndroidSettingsFieldBuilder() { + if (androidSettingsBuilder_ == null) { + if (!(platformSettingsCase_ == 4)) { + platformSettings_ = + com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.getDefaultInstance(); + } + androidSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.AndroidKeySettings, + com.google.recaptchaenterprise.v1beta1.AndroidKeySettings.Builder, + com.google.recaptchaenterprise.v1beta1.AndroidKeySettingsOrBuilder>( + (com.google.recaptchaenterprise.v1beta1.AndroidKeySettings) platformSettings_, + getParentForChildren(), + isClean()); + platformSettings_ = null; + } + platformSettingsCase_ = 4; + onChanged(); + ; + return androidSettingsBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.IOSKeySettings, + com.google.recaptchaenterprise.v1beta1.IOSKeySettings.Builder, + com.google.recaptchaenterprise.v1beta1.IOSKeySettingsOrBuilder> + iosSettingsBuilder_; + /** + * + * + *
+     * Settings for keys that can be used by iOS apps.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings ios_settings = 5; + */ + public boolean hasIosSettings() { + return platformSettingsCase_ == 5; + } + /** + * + * + *
+     * Settings for keys that can be used by iOS apps.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings ios_settings = 5; + */ + public com.google.recaptchaenterprise.v1beta1.IOSKeySettings getIosSettings() { + if (iosSettingsBuilder_ == null) { + if (platformSettingsCase_ == 5) { + return (com.google.recaptchaenterprise.v1beta1.IOSKeySettings) platformSettings_; + } + return com.google.recaptchaenterprise.v1beta1.IOSKeySettings.getDefaultInstance(); + } else { + if (platformSettingsCase_ == 5) { + return iosSettingsBuilder_.getMessage(); + } + return com.google.recaptchaenterprise.v1beta1.IOSKeySettings.getDefaultInstance(); + } + } + /** + * + * + *
+     * Settings for keys that can be used by iOS apps.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings ios_settings = 5; + */ + public Builder setIosSettings(com.google.recaptchaenterprise.v1beta1.IOSKeySettings value) { + if (iosSettingsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + platformSettings_ = value; + onChanged(); + } else { + iosSettingsBuilder_.setMessage(value); + } + platformSettingsCase_ = 5; + return this; + } + /** + * + * + *
+     * Settings for keys that can be used by iOS apps.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings ios_settings = 5; + */ + public Builder setIosSettings( + com.google.recaptchaenterprise.v1beta1.IOSKeySettings.Builder builderForValue) { + if (iosSettingsBuilder_ == null) { + platformSettings_ = builderForValue.build(); + onChanged(); + } else { + iosSettingsBuilder_.setMessage(builderForValue.build()); + } + platformSettingsCase_ = 5; + return this; + } + /** + * + * + *
+     * Settings for keys that can be used by iOS apps.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings ios_settings = 5; + */ + public Builder mergeIosSettings(com.google.recaptchaenterprise.v1beta1.IOSKeySettings value) { + if (iosSettingsBuilder_ == null) { + if (platformSettingsCase_ == 5 + && platformSettings_ + != com.google.recaptchaenterprise.v1beta1.IOSKeySettings.getDefaultInstance()) { + platformSettings_ = + com.google.recaptchaenterprise.v1beta1.IOSKeySettings.newBuilder( + (com.google.recaptchaenterprise.v1beta1.IOSKeySettings) platformSettings_) + .mergeFrom(value) + .buildPartial(); + } else { + platformSettings_ = value; + } + onChanged(); + } else { + if (platformSettingsCase_ == 5) { + iosSettingsBuilder_.mergeFrom(value); + } + iosSettingsBuilder_.setMessage(value); + } + platformSettingsCase_ = 5; + return this; + } + /** + * + * + *
+     * Settings for keys that can be used by iOS apps.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings ios_settings = 5; + */ + public Builder clearIosSettings() { + if (iosSettingsBuilder_ == null) { + if (platformSettingsCase_ == 5) { + platformSettingsCase_ = 0; + platformSettings_ = null; + onChanged(); + } + } else { + if (platformSettingsCase_ == 5) { + platformSettingsCase_ = 0; + platformSettings_ = null; + } + iosSettingsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Settings for keys that can be used by iOS apps.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings ios_settings = 5; + */ + public com.google.recaptchaenterprise.v1beta1.IOSKeySettings.Builder getIosSettingsBuilder() { + return getIosSettingsFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Settings for keys that can be used by iOS apps.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings ios_settings = 5; + */ + public com.google.recaptchaenterprise.v1beta1.IOSKeySettingsOrBuilder + getIosSettingsOrBuilder() { + if ((platformSettingsCase_ == 5) && (iosSettingsBuilder_ != null)) { + return iosSettingsBuilder_.getMessageOrBuilder(); + } else { + if (platformSettingsCase_ == 5) { + return (com.google.recaptchaenterprise.v1beta1.IOSKeySettings) platformSettings_; + } + return com.google.recaptchaenterprise.v1beta1.IOSKeySettings.getDefaultInstance(); + } + } + /** + * + * + *
+     * Settings for keys that can be used by iOS apps.
+     * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings ios_settings = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.IOSKeySettings, + com.google.recaptchaenterprise.v1beta1.IOSKeySettings.Builder, + com.google.recaptchaenterprise.v1beta1.IOSKeySettingsOrBuilder> + getIosSettingsFieldBuilder() { + if (iosSettingsBuilder_ == null) { + if (!(platformSettingsCase_ == 5)) { + platformSettings_ = + com.google.recaptchaenterprise.v1beta1.IOSKeySettings.getDefaultInstance(); + } + iosSettingsBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.IOSKeySettings, + com.google.recaptchaenterprise.v1beta1.IOSKeySettings.Builder, + com.google.recaptchaenterprise.v1beta1.IOSKeySettingsOrBuilder>( + (com.google.recaptchaenterprise.v1beta1.IOSKeySettings) platformSettings_, + getParentForChildren(), + isClean()); + platformSettings_ = null; + } + platformSettingsCase_ = 5; + onChanged(); + ; + return iosSettingsBuilder_; + } + + @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.Key) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1beta1.Key) + private static final com.google.recaptchaenterprise.v1beta1.Key DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1beta1.Key(); + } + + public static com.google.recaptchaenterprise.v1beta1.Key getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Key parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Key(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.Key getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/KeyName.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/KeyName.java new file mode 100644 index 00000000..4b3e33f8 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/KeyName.java @@ -0,0 +1,182 @@ +/* + * 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.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 KeyName implements ResourceName { + + private static final PathTemplate PATH_TEMPLATE = + PathTemplate.createWithoutUrlEncoding("projects/{project}/keys/{key}"); + + private volatile Map fieldValuesMap; + + private final String project; + private final String key; + + public String getProject() { + return project; + } + + public String getKey() { + return key; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + private KeyName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + key = Preconditions.checkNotNull(builder.getKey()); + } + + public static KeyName of(String project, String key) { + return newBuilder().setProject(project).setKey(key).build(); + } + + public static String format(String project, String key) { + return newBuilder().setProject(project).setKey(key).build().toString(); + } + + public static KeyName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PATH_TEMPLATE.validatedMatch( + formattedString, "KeyName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("key")); + } + + 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 (KeyName 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("key", key); + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PATH_TEMPLATE.instantiate("project", project, "key", key); + } + + /** Builder for KeyName. */ + public static class Builder { + + private String project; + private String key; + + public String getProject() { + return project; + } + + public String getKey() { + return key; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setKey(String key) { + this.key = key; + return this; + } + + private Builder() {} + + private Builder(KeyName keyName) { + project = keyName.project; + key = keyName.key; + } + + public KeyName build() { + return new KeyName(this); + } + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o instanceof KeyName) { + KeyName that = (KeyName) o; + return (this.project.equals(that.project)) && (this.key.equals(that.key)); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= project.hashCode(); + h *= 1000003; + h ^= key.hashCode(); + return h; + } +} diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/KeyOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/KeyOrBuilder.java new file mode 100644 index 00000000..e88f10e4 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/KeyOrBuilder.java @@ -0,0 +1,164 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +public interface KeyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1beta1.Key) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * The resource name for the Key in the format
+   * "projects/{project_number}/keys/{key_id}".
+   * 
+ * + * string name = 1; + */ + java.lang.String getName(); + /** + * + * + *
+   * The resource name for the Key in the format
+   * "projects/{project_number}/keys/{key_id}".
+   * 
+ * + * string name = 1; + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Human-readable display name of this key. Modifiable by user.
+   * 
+ * + * string display_name = 2; + */ + java.lang.String getDisplayName(); + /** + * + * + *
+   * Human-readable display name of this key. Modifiable by user.
+   * 
+ * + * string display_name = 2; + */ + com.google.protobuf.ByteString getDisplayNameBytes(); + + /** + * + * + *
+   * Settings for keys that can be used by websites.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings web_settings = 3; + */ + boolean hasWebSettings(); + /** + * + * + *
+   * Settings for keys that can be used by websites.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings web_settings = 3; + */ + com.google.recaptchaenterprise.v1beta1.WebKeySettings getWebSettings(); + /** + * + * + *
+   * Settings for keys that can be used by websites.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings web_settings = 3; + */ + com.google.recaptchaenterprise.v1beta1.WebKeySettingsOrBuilder getWebSettingsOrBuilder(); + + /** + * + * + *
+   * Settings for keys that can be used by Android apps.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings android_settings = 4; + */ + boolean hasAndroidSettings(); + /** + * + * + *
+   * Settings for keys that can be used by Android apps.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings android_settings = 4; + */ + com.google.recaptchaenterprise.v1beta1.AndroidKeySettings getAndroidSettings(); + /** + * + * + *
+   * Settings for keys that can be used by Android apps.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.AndroidKeySettings android_settings = 4; + */ + com.google.recaptchaenterprise.v1beta1.AndroidKeySettingsOrBuilder getAndroidSettingsOrBuilder(); + + /** + * + * + *
+   * Settings for keys that can be used by iOS apps.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings ios_settings = 5; + */ + boolean hasIosSettings(); + /** + * + * + *
+   * Settings for keys that can be used by iOS apps.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings ios_settings = 5; + */ + com.google.recaptchaenterprise.v1beta1.IOSKeySettings getIosSettings(); + /** + * + * + *
+   * Settings for keys that can be used by iOS apps.
+   * 
+ * + * .google.cloud.recaptchaenterprise.v1beta1.IOSKeySettings ios_settings = 5; + */ + com.google.recaptchaenterprise.v1beta1.IOSKeySettingsOrBuilder getIosSettingsOrBuilder(); + + public com.google.recaptchaenterprise.v1beta1.Key.PlatformSettingsCase getPlatformSettingsCase(); +} diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/ListKeysRequest.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/ListKeysRequest.java new file mode 100644 index 00000000..51378a23 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/ListKeysRequest.java @@ -0,0 +1,886 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +/** + * + * + *
+ * The list keys request message.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest} + */ +public final class ListKeysRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest) + ListKeysRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListKeysRequest.newBuilder() to construct. + private ListKeysRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListKeysRequest() { + parent_ = ""; + pageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListKeysRequest( + 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 16: + { + pageSize_ = input.readInt32(); + break; + } + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + + pageToken_ = 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_ListKeysRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_ListKeysRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.ListKeysRequest.class, + com.google.recaptchaenterprise.v1beta1.ListKeysRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + private volatile java.lang.Object parent_; + /** + * + * + *
+   * Required. The name of the project that contains the keys that will be
+   * listed, in the format "projects/{project_number}".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + 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 that contains the keys that will be
+   * listed, in the format "projects/{project_number}".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + 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 PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * + * + *
+   * Optional. The maximum number of keys to return. Default is 10. Max limit is
+   * 1000.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + private volatile java.lang.Object pageToken_; + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous.
+   * ListKeysRequest, if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + 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(); + pageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous.
+   * ListKeysRequest, if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = 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 (!getParentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + 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 (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!getPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + 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.ListKeysRequest)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1beta1.ListKeysRequest other = + (com.google.recaptchaenterprise.v1beta1.ListKeysRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) 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(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1beta1.ListKeysRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.ListKeysRequest 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.ListKeysRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.ListKeysRequest 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.ListKeysRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.ListKeysRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.ListKeysRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.ListKeysRequest 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.ListKeysRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.ListKeysRequest 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.ListKeysRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.ListKeysRequest 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.ListKeysRequest 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 list keys request message.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest) + com.google.recaptchaenterprise.v1beta1.ListKeysRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_ListKeysRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_ListKeysRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.ListKeysRequest.class, + com.google.recaptchaenterprise.v1beta1.ListKeysRequest.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1beta1.ListKeysRequest.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_ = ""; + + pageSize_ = 0; + + pageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_ListKeysRequest_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.ListKeysRequest getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1beta1.ListKeysRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.ListKeysRequest build() { + com.google.recaptchaenterprise.v1beta1.ListKeysRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.ListKeysRequest buildPartial() { + com.google.recaptchaenterprise.v1beta1.ListKeysRequest result = + new com.google.recaptchaenterprise.v1beta1.ListKeysRequest(this); + result.parent_ = parent_; + result.pageSize_ = pageSize_; + result.pageToken_ = pageToken_; + 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.ListKeysRequest) { + return mergeFrom((com.google.recaptchaenterprise.v1beta1.ListKeysRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1beta1.ListKeysRequest other) { + if (other == com.google.recaptchaenterprise.v1beta1.ListKeysRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + 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.ListKeysRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.recaptchaenterprise.v1beta1.ListKeysRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The name of the project that contains the keys that will be
+     * listed, in the format "projects/{project_number}".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + 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 that contains the keys that will be
+     * listed, in the format "projects/{project_number}".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + 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 that contains the keys that will be
+     * listed, in the format "projects/{project_number}".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + parent_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the project that contains the keys that will be
+     * listed, in the format "projects/{project_number}".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public Builder clearParent() { + + parent_ = getDefaultInstance().getParent(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the project that contains the keys that will be
+     * listed, in the format "projects/{project_number}".
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + parent_ = value; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. The maximum number of keys to return. Default is 10. Max limit is
+     * 1000.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. The maximum number of keys to return. Default is 10. Max limit is
+     * 1000.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The maximum number of keys to return. Default is 10. Max limit is
+     * 1000.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous.
+     * ListKeysRequest, if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public java.lang.String getPageToken() { + java.lang.Object ref = pageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous.
+     * ListKeysRequest, if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous.
+     * ListKeysRequest, if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous.
+     * ListKeysRequest, if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder clearPageToken() { + + pageToken_ = getDefaultInstance().getPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The next_page_token value returned from a previous.
+     * ListKeysRequest, if any.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pageToken_ = 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.ListKeysRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest) + private static final com.google.recaptchaenterprise.v1beta1.ListKeysRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1beta1.ListKeysRequest(); + } + + public static com.google.recaptchaenterprise.v1beta1.ListKeysRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListKeysRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListKeysRequest(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.ListKeysRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/ListKeysRequestOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/ListKeysRequestOrBuilder.java new file mode 100644 index 00000000..9e79cb27 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/ListKeysRequestOrBuilder.java @@ -0,0 +1,87 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +public interface ListKeysRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1beta1.ListKeysRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the project that contains the keys that will be
+   * listed, in the format "projects/{project_number}".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The name of the project that contains the keys that will be
+   * listed, in the format "projects/{project_number}".
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. The maximum number of keys to return. Default is 10. Max limit is
+   * 1000.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous.
+   * ListKeysRequest, if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. The next_page_token value returned from a previous.
+   * ListKeysRequest, if any.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/ListKeysResponse.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/ListKeysResponse.java new file mode 100644 index 00000000..fb0504d7 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/ListKeysResponse.java @@ -0,0 +1,1109 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +/** + * + * + *
+ * Response to request to list keys in a project.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse} + */ +public final class ListKeysResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse) + ListKeysResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListKeysResponse.newBuilder() to construct. + private ListKeysResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListKeysResponse() { + keys_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private ListKeysResponse( + 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: + { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + keys_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + keys_.add( + input.readMessage( + com.google.recaptchaenterprise.v1beta1.Key.parser(), extensionRegistry)); + break; + } + case 18: + { + java.lang.String s = input.readStringRequireUtf8(); + + nextPageToken_ = 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 { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + keys_ = java.util.Collections.unmodifiableList(keys_); + } + 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_ListKeysResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_ListKeysResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.ListKeysResponse.class, + com.google.recaptchaenterprise.v1beta1.ListKeysResponse.Builder.class); + } + + private int bitField0_; + public static final int KEYS_FIELD_NUMBER = 1; + private java.util.List keys_; + /** + * + * + *
+   * Key details.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public java.util.List getKeysList() { + return keys_; + } + /** + * + * + *
+   * Key details.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public java.util.List + getKeysOrBuilderList() { + return keys_; + } + /** + * + * + *
+   * Key details.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public int getKeysCount() { + return keys_.size(); + } + /** + * + * + *
+   * Key details.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public com.google.recaptchaenterprise.v1beta1.Key getKeys(int index) { + return keys_.get(index); + } + /** + * + * + *
+   * Key details.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public com.google.recaptchaenterprise.v1beta1.KeyOrBuilder getKeysOrBuilder(int index) { + return keys_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + private volatile java.lang.Object nextPageToken_; + /** + * + * + *
+   * Token to retrieve the next page of results. It is set to empty if no keys
+   * remain in results.
+   * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + 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(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results. It is set to empty if no keys
+   * remain in results.
+   * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = 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 { + for (int i = 0; i < keys_.size(); i++) { + output.writeMessage(1, keys_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < keys_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, keys_.get(i)); + } + if (!getNextPageTokenBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + 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.ListKeysResponse)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1beta1.ListKeysResponse other = + (com.google.recaptchaenterprise.v1beta1.ListKeysResponse) obj; + + if (!getKeysList().equals(other.getKeysList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) 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(); + if (getKeysCount() > 0) { + hash = (37 * hash) + KEYS_FIELD_NUMBER; + hash = (53 * hash) + getKeysList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1beta1.ListKeysResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.ListKeysResponse 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.ListKeysResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.ListKeysResponse 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.ListKeysResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.ListKeysResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.ListKeysResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.ListKeysResponse 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.ListKeysResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.ListKeysResponse 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.ListKeysResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.ListKeysResponse 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.ListKeysResponse 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; + } + /** + * + * + *
+   * Response to request to list keys in a project.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse) + com.google.recaptchaenterprise.v1beta1.ListKeysResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_ListKeysResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_ListKeysResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.ListKeysResponse.class, + com.google.recaptchaenterprise.v1beta1.ListKeysResponse.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1beta1.ListKeysResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getKeysFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + if (keysBuilder_ == null) { + keys_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + keysBuilder_.clear(); + } + nextPageToken_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_ListKeysResponse_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.ListKeysResponse getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1beta1.ListKeysResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.ListKeysResponse build() { + com.google.recaptchaenterprise.v1beta1.ListKeysResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.ListKeysResponse buildPartial() { + com.google.recaptchaenterprise.v1beta1.ListKeysResponse result = + new com.google.recaptchaenterprise.v1beta1.ListKeysResponse(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (keysBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + keys_ = java.util.Collections.unmodifiableList(keys_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.keys_ = keys_; + } else { + result.keys_ = keysBuilder_.build(); + } + result.nextPageToken_ = nextPageToken_; + 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.ListKeysResponse) { + return mergeFrom((com.google.recaptchaenterprise.v1beta1.ListKeysResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1beta1.ListKeysResponse other) { + if (other == com.google.recaptchaenterprise.v1beta1.ListKeysResponse.getDefaultInstance()) + return this; + if (keysBuilder_ == null) { + if (!other.keys_.isEmpty()) { + if (keys_.isEmpty()) { + keys_ = other.keys_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKeysIsMutable(); + keys_.addAll(other.keys_); + } + onChanged(); + } + } else { + if (!other.keys_.isEmpty()) { + if (keysBuilder_.isEmpty()) { + keysBuilder_.dispose(); + keysBuilder_ = null; + keys_ = other.keys_; + bitField0_ = (bitField0_ & ~0x00000001); + keysBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getKeysFieldBuilder() + : null; + } else { + keysBuilder_.addAllMessages(other.keys_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + 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.ListKeysResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.recaptchaenterprise.v1beta1.ListKeysResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private java.util.List keys_ = + java.util.Collections.emptyList(); + + private void ensureKeysIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + keys_ = new java.util.ArrayList(keys_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.Key, + com.google.recaptchaenterprise.v1beta1.Key.Builder, + com.google.recaptchaenterprise.v1beta1.KeyOrBuilder> + keysBuilder_; + + /** + * + * + *
+     * Key details.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public java.util.List getKeysList() { + if (keysBuilder_ == null) { + return java.util.Collections.unmodifiableList(keys_); + } else { + return keysBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Key details.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public int getKeysCount() { + if (keysBuilder_ == null) { + return keys_.size(); + } else { + return keysBuilder_.getCount(); + } + } + /** + * + * + *
+     * Key details.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public com.google.recaptchaenterprise.v1beta1.Key getKeys(int index) { + if (keysBuilder_ == null) { + return keys_.get(index); + } else { + return keysBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Key details.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public Builder setKeys(int index, com.google.recaptchaenterprise.v1beta1.Key value) { + if (keysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKeysIsMutable(); + keys_.set(index, value); + onChanged(); + } else { + keysBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Key details.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public Builder setKeys( + int index, com.google.recaptchaenterprise.v1beta1.Key.Builder builderForValue) { + if (keysBuilder_ == null) { + ensureKeysIsMutable(); + keys_.set(index, builderForValue.build()); + onChanged(); + } else { + keysBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Key details.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public Builder addKeys(com.google.recaptchaenterprise.v1beta1.Key value) { + if (keysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKeysIsMutable(); + keys_.add(value); + onChanged(); + } else { + keysBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Key details.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public Builder addKeys(int index, com.google.recaptchaenterprise.v1beta1.Key value) { + if (keysBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureKeysIsMutable(); + keys_.add(index, value); + onChanged(); + } else { + keysBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Key details.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public Builder addKeys(com.google.recaptchaenterprise.v1beta1.Key.Builder builderForValue) { + if (keysBuilder_ == null) { + ensureKeysIsMutable(); + keys_.add(builderForValue.build()); + onChanged(); + } else { + keysBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Key details.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public Builder addKeys( + int index, com.google.recaptchaenterprise.v1beta1.Key.Builder builderForValue) { + if (keysBuilder_ == null) { + ensureKeysIsMutable(); + keys_.add(index, builderForValue.build()); + onChanged(); + } else { + keysBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Key details.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public Builder addAllKeys( + java.lang.Iterable values) { + if (keysBuilder_ == null) { + ensureKeysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, keys_); + onChanged(); + } else { + keysBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Key details.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public Builder clearKeys() { + if (keysBuilder_ == null) { + keys_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + keysBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Key details.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public Builder removeKeys(int index) { + if (keysBuilder_ == null) { + ensureKeysIsMutable(); + keys_.remove(index); + onChanged(); + } else { + keysBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Key details.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public com.google.recaptchaenterprise.v1beta1.Key.Builder getKeysBuilder(int index) { + return getKeysFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Key details.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public com.google.recaptchaenterprise.v1beta1.KeyOrBuilder getKeysOrBuilder(int index) { + if (keysBuilder_ == null) { + return keys_.get(index); + } else { + return keysBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Key details.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public java.util.List + getKeysOrBuilderList() { + if (keysBuilder_ != null) { + return keysBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(keys_); + } + } + /** + * + * + *
+     * Key details.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public com.google.recaptchaenterprise.v1beta1.Key.Builder addKeysBuilder() { + return getKeysFieldBuilder() + .addBuilder(com.google.recaptchaenterprise.v1beta1.Key.getDefaultInstance()); + } + /** + * + * + *
+     * Key details.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public com.google.recaptchaenterprise.v1beta1.Key.Builder addKeysBuilder(int index) { + return getKeysFieldBuilder() + .addBuilder(index, com.google.recaptchaenterprise.v1beta1.Key.getDefaultInstance()); + } + /** + * + * + *
+     * Key details.
+     * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + public java.util.List getKeysBuilderList() { + return getKeysFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.Key, + com.google.recaptchaenterprise.v1beta1.Key.Builder, + com.google.recaptchaenterprise.v1beta1.KeyOrBuilder> + getKeysFieldBuilder() { + if (keysBuilder_ == null) { + keysBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.Key, + com.google.recaptchaenterprise.v1beta1.Key.Builder, + com.google.recaptchaenterprise.v1beta1.KeyOrBuilder>( + keys_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + keys_ = null; + } + return keysBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results. It is set to empty if no keys
+     * remain in results.
+     * 
+ * + * string next_page_token = 2; + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results. It is set to empty if no keys
+     * remain in results.
+     * 
+ * + * string next_page_token = 2; + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results. It is set to empty if no keys
+     * remain in results.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nextPageToken_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results. It is set to empty if no keys
+     * remain in results.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder clearNextPageToken() { + + nextPageToken_ = getDefaultInstance().getNextPageToken(); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results. It is set to empty if no keys
+     * remain in results.
+     * 
+ * + * string next_page_token = 2; + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nextPageToken_ = 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.ListKeysResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse) + private static final com.google.recaptchaenterprise.v1beta1.ListKeysResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1beta1.ListKeysResponse(); + } + + public static com.google.recaptchaenterprise.v1beta1.ListKeysResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListKeysResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListKeysResponse(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.ListKeysResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/ListKeysResponseOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/ListKeysResponseOrBuilder.java new file mode 100644 index 00000000..2826aa5b --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/ListKeysResponseOrBuilder.java @@ -0,0 +1,100 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +public interface ListKeysResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1beta1.ListKeysResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Key details.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + java.util.List getKeysList(); + /** + * + * + *
+   * Key details.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + com.google.recaptchaenterprise.v1beta1.Key getKeys(int index); + /** + * + * + *
+   * Key details.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + int getKeysCount(); + /** + * + * + *
+   * Key details.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + java.util.List + getKeysOrBuilderList(); + /** + * + * + *
+   * Key details.
+   * 
+ * + * repeated .google.cloud.recaptchaenterprise.v1beta1.Key keys = 1; + */ + com.google.recaptchaenterprise.v1beta1.KeyOrBuilder getKeysOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results. It is set to empty if no keys
+   * remain in results.
+   * 
+ * + * string next_page_token = 2; + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results. It is set to empty if no keys
+   * remain in results.
+   * 
+ * + * string next_page_token = 2; + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); +} diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/RecaptchaEnterpriseProto.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/RecaptchaEnterpriseProto.java index a7c6f85d..883dd2c8 100644 --- a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/RecaptchaEnterpriseProto.java +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/RecaptchaEnterpriseProto.java @@ -51,6 +51,46 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r internal_static_google_cloud_recaptchaenterprise_v1beta1_TokenProperties_descriptor; static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_google_cloud_recaptchaenterprise_v1beta1_TokenProperties_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1beta1_CreateKeyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1beta1_CreateKeyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1beta1_ListKeysRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1beta1_ListKeysRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1beta1_ListKeysResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1beta1_ListKeysResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1beta1_GetKeyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1beta1_GetKeyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1beta1_UpdateKeyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1beta1_UpdateKeyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1beta1_DeleteKeyRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1beta1_DeleteKeyRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1beta1_Key_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1beta1_Key_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1beta1_WebKeySettings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1beta1_WebKeySettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1beta1_AndroidKeySettings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1beta1_AndroidKeySettings_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_recaptchaenterprise_v1beta1_IOSKeySettings_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_recaptchaenterprise_v1beta1_IOSKeySettings_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -65,67 +105,136 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "ud.recaptchaenterprise.v1beta1\032\034google/a" + "pi/annotations.proto\032\027google/api/client." + "proto\032\037google/api/field_behavior.proto\032\031" - + "google/api/resource.proto\032\037google/protob" - + "uf/timestamp.proto\"\255\001\n\027CreateAssessmentR" - + "equest\022C\n\006parent\030\001 \001(\tB3\340A\002\372A-\n+cloudres" - + "ourcemanager.googleapis.com/Project\022M\n\na" - + "ssessment\030\002 \001(\01324.google.cloud.recaptcha" - + "enterprise.v1beta1.AssessmentB\003\340A\002\"\223\002\n\031A" - + "nnotateAssessmentRequest\022C\n\004name\030\001 \001(\tB5" - + "\340A\002\372A/\n-recaptchaenterprise.googleapis.c" - + "om/Assessment\022g\n\nannotation\030\002 \001(\0162N.goog" - + "le.cloud.recaptchaenterprise.v1beta1.Ann" - + "otateAssessmentRequest.AnnotationB\003\340A\002\"H" - + "\n\nAnnotation\022\032\n\026ANNOTATION_UNSPECIFIED\020\000" - + "\022\016\n\nLEGITIMATE\020\001\022\016\n\nFRAUDULENT\020\002\"\034\n\032Anno" - + "tateAssessmentResponse\"\312\004\n\nAssessment\022\021\n" - + "\004name\030\001 \001(\tB\003\340A\003\022>\n\005event\030\002 \001(\0132/.google" - + ".cloud.recaptchaenterprise.v1beta1.Event" - + "\022\022\n\005score\030\003 \001(\002B\003\340A\003\022X\n\020token_properties" - + "\030\004 \001(\01329.google.cloud.recaptchaenterpris" - + "e.v1beta1.TokenPropertiesB\003\340A\003\022_\n\007reason" - + "s\030\005 \003(\0162I.google.cloud.recaptchaenterpri" - + "se.v1beta1.Assessment.ClassificationReas" - + "onB\003\340A\003\"\270\001\n\024ClassificationReason\022%\n!CLAS" - + "SIFICATION_REASON_UNSPECIFIED\020\000\022\016\n\nAUTOM" - + "ATION\020\001\022\032\n\026UNEXPECTED_ENVIRONMENT\020\002\022\024\n\020T" - + "OO_MUCH_TRAFFIC\020\003\022\035\n\031UNEXPECTED_USAGE_PA" - + "TTERNS\020\004\022\030\n\024LOW_CONFIDENCE_SCORE\020\005:_\352A\\\n" - + "-recaptchaenterprise.googleapis.com/Asse" - + "ssment\022+projects/{project}/assessments/{" - + "assessment}\"2\n\005Event\022\022\n\005token\030\001 \001(\tB\003\340A\002" - + "\022\025\n\010site_key\030\002 \001(\tB\003\340A\002\"\350\002\n\017TokenPropert" - + "ies\022\r\n\005valid\030\001 \001(\010\022_\n\016invalid_reason\030\002 \001" - + "(\0162G.google.cloud.recaptchaenterprise.v1" - + "beta1.TokenProperties.InvalidReason\022/\n\013c" - + "reate_time\030\003 \001(\0132\032.google.protobuf.Times" - + "tamp\022\020\n\010hostname\030\004 \001(\t\022\016\n\006action\030\005 \001(\t\"\221" - + "\001\n\rInvalidReason\022\036\n\032INVALID_REASON_UNSPE" - + "CIFIED\020\000\022\032\n\026UNKNOWN_INVALID_REASON\020\001\022\r\n\t" - + "MALFORMED\020\002\022\013\n\007EXPIRED\020\003\022\010\n\004DUPE\020\004\022\021\n\rSI" - + "TE_MISMATCH\020\005\022\013\n\007MISSING\020\0062\315\004\n!Recaptcha" - + "EnterpriseServiceV1Beta1\022\335\001\n\020CreateAsses" - + "sment\022A.google.cloud.recaptchaenterprise" - + ".v1beta1.CreateAssessmentRequest\0324.googl" - + "e.cloud.recaptchaenterprise.v1beta1.Asse" - + "ssment\"P\202\323\344\223\0026\"(/v1beta1/{parent=project" - + "s/*}/assessments:\nassessment\332A\021parent,as" - + "sessment\022\357\001\n\022AnnotateAssessment\022C.google" - + ".cloud.recaptchaenterprise.v1beta1.Annot" - + "ateAssessmentRequest\032D.google.cloud.reca" - + "ptchaenterprise.v1beta1.AnnotateAssessme" - + "ntResponse\"N\202\323\344\223\0026\"1/v1beta1/{name=proje" - + "cts/*/assessments/*}:annotate:\001*\332A\017name," - + "annotation\032V\312A\"recaptchaenterprise.googl" - + "eapis.com\322A.https://www.googleapis.com/a" - + "uth/cloud-platformB\376\001\n&com.google.recapt" - + "chaenterprise.v1beta1B\030RecaptchaEnterpri" - + "seProtoP\001Z[google.golang.org/genproto/go" - + "ogleapis/cloud/recaptchaenterprise/v1bet" - + "a1;recaptchaenterprise\242\002\004GCRE\252\002(Google.C" - + "loud.RecaptchaEnterprise.V1Beta1\312\002(Googl" - + "e\\Cloud\\RecaptchaEnterprise\\V1beta1b\006pro" - + "to3" + + "google/api/resource.proto\032\033google/protob" + + "uf/empty.proto\032 google/protobuf/field_ma" + + "sk.proto\032\037google/protobuf/timestamp.prot" + + "o\"\255\001\n\027CreateAssessmentRequest\022C\n\006parent\030" + + "\001 \001(\tB3\340A\002\372A-\n+cloudresourcemanager.goog" + + "leapis.com/Project\022M\n\nassessment\030\002 \001(\01324" + + ".google.cloud.recaptchaenterprise.v1beta" + + "1.AssessmentB\003\340A\002\"\223\002\n\031AnnotateAssessment" + + "Request\022C\n\004name\030\001 \001(\tB5\340A\002\372A/\n-recaptcha" + + "enterprise.googleapis.com/Assessment\022g\n\n" + + "annotation\030\002 \001(\0162N.google.cloud.recaptch" + + "aenterprise.v1beta1.AnnotateAssessmentRe" + + "quest.AnnotationB\003\340A\002\"H\n\nAnnotation\022\032\n\026A" + + "NNOTATION_UNSPECIFIED\020\000\022\016\n\nLEGITIMATE\020\001\022" + + "\016\n\nFRAUDULENT\020\002\"\034\n\032AnnotateAssessmentRes" + + "ponse\"\312\004\n\nAssessment\022\021\n\004name\030\001 \001(\tB\003\340A\003\022" + + ">\n\005event\030\002 \001(\0132/.google.cloud.recaptchae" + + "nterprise.v1beta1.Event\022\022\n\005score\030\003 \001(\002B\003" + + "\340A\003\022X\n\020token_properties\030\004 \001(\01329.google.c" + + "loud.recaptchaenterprise.v1beta1.TokenPr" + + "opertiesB\003\340A\003\022_\n\007reasons\030\005 \003(\0162I.google." + + "cloud.recaptchaenterprise.v1beta1.Assess" + + "ment.ClassificationReasonB\003\340A\003\"\270\001\n\024Class" + + "ificationReason\022%\n!CLASSIFICATION_REASON" + + "_UNSPECIFIED\020\000\022\016\n\nAUTOMATION\020\001\022\032\n\026UNEXPE" + + "CTED_ENVIRONMENT\020\002\022\024\n\020TOO_MUCH_TRAFFIC\020\003" + + "\022\035\n\031UNEXPECTED_USAGE_PATTERNS\020\004\022\030\n\024LOW_C" + + "ONFIDENCE_SCORE\020\005:_\352A\\\n-recaptchaenterpr" + + "ise.googleapis.com/Assessment\022+projects/" + + "{project}/assessments/{assessment}\"\207\001\n\005E" + + "vent\022\022\n\005token\030\001 \001(\tB\003\340A\001\022\025\n\010site_key\030\002 \001" + + "(\tB\003\340A\001\022\027\n\nuser_agent\030\003 \001(\tB\003\340A\001\022\034\n\017user" + + "_ip_address\030\004 \001(\tB\003\340A\001\022\034\n\017expected_actio" + + "n\030\005 \001(\tB\003\340A\001\"\350\002\n\017TokenProperties\022\r\n\005vali" + + "d\030\001 \001(\010\022_\n\016invalid_reason\030\002 \001(\0162G.google" + + ".cloud.recaptchaenterprise.v1beta1.Token" + + "Properties.InvalidReason\022/\n\013create_time\030" + + "\003 \001(\0132\032.google.protobuf.Timestamp\022\020\n\010hos" + + "tname\030\004 \001(\t\022\016\n\006action\030\005 \001(\t\"\221\001\n\rInvalidR" + + "eason\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\004DUPE\020\004\022\021\n\rSITE_MISMATCH" + + "\020\005\022\013\n\007MISSING\020\006\"\230\001\n\020CreateKeyRequest\022C\n\006" + + "parent\030\001 \001(\tB3\340A\002\372A-\n+cloudresourcemanag" + + "er.googleapis.com/Project\022?\n\003key\030\002 \001(\0132-" + + ".google.cloud.recaptchaenterprise.v1beta" + + "1.KeyB\003\340A\002\"\207\001\n\017ListKeysRequest\022C\n\006parent" + + "\030\001 \001(\tB3\340A\002\372A-\n+cloudresourcemanager.goo" + + "gleapis.com/Project\022\026\n\tpage_size\030\002 \001(\005B\003" + + "\340A\001\022\027\n\npage_token\030\003 \001(\tB\003\340A\001\"h\n\020ListKeys" + + "Response\022;\n\004keys\030\001 \003(\0132-.google.cloud.re" + + "captchaenterprise.v1beta1.Key\022\027\n\017next_pa" + + "ge_token\030\002 \001(\t\"M\n\rGetKeyRequest\022<\n\004name\030" + + "\001 \001(\tB.\340A\002\372A(\n&recaptchaenterprise.googl" + + "eapis.com/Key\"\264\001\n\020UpdateKeyRequest\022j\n\003ke" + + "y\030\001 \001(\0132-.google.cloud.recaptchaenterpri" + + "se.v1beta1.KeyB.\340A\002\372A(\n&recaptchaenterpr" + + "ise.googleapis.com/Key\0224\n\013update_mask\030\002 " + + "\001(\0132\032.google.protobuf.FieldMaskB\003\340A\001\"P\n\020" + + "DeleteKeyRequest\022<\n\004name\030\001 \001(\tB.\340A\002\372A(\n&" + + "recaptchaenterprise.googleapis.com/Key\"\210" + + "\003\n\003Key\022\014\n\004name\030\001 \001(\t\022\024\n\014display_name\030\002 \001" + + "(\t\022P\n\014web_settings\030\003 \001(\01328.google.cloud." + + "recaptchaenterprise.v1beta1.WebKeySettin" + + "gsH\000\022X\n\020android_settings\030\004 \001(\0132<.google." + + "cloud.recaptchaenterprise.v1beta1.Androi" + + "dKeySettingsH\000\022P\n\014ios_settings\030\005 \001(\01328.g" + + "oogle.cloud.recaptchaenterprise.v1beta1." + + "IOSKeySettingsH\000:J\352AG\n&recaptchaenterpri" + + "se.googleapis.com/Key\022\035projects/{project" + + "}/keys/{key}B\023\n\021platform_settings\"\272\004\n\016We" + + "bKeySettings\022\037\n\027enforce_allowed_domains\030" + + "\003 \001(\010\022\027\n\017allowed_domains\030\001 \003(\t\022\031\n\021allow_" + + "amp_traffic\030\002 \001(\010\022g\n\020integration_type\030\004 " + + "\001(\0162H.google.cloud.recaptchaenterprise.v" + + "1beta1.WebKeySettings.IntegrationTypeB\003\340" + + "A\002\022{\n\035challenge_security_preference\030\005 \001(" + + "\0162T.google.cloud.recaptchaenterprise.v1b" + + "eta1.WebKeySettings.ChallengeSecurityPre" + + "ference\"t\n\017IntegrationType\022 \n\034INTEGRATIO" + + "N_TYPE_UNSPECIFIED\020\000\022\016\n\nSCORE_ONLY\020\001\022\026\n\022" + + "CHECKBOX_CHALLENGE\020\002\022\027\n\023INVISIBLE_CHALLE" + + "NGE\020\003\"w\n\033ChallengeSecurityPreference\022-\n)" + + "CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIE" + + "D\020\000\022\r\n\tUSABILITY\020\001\022\014\n\010BALANCED\020\002\022\014\n\010SECU" + + "RITY\020\003\"3\n\022AndroidKeySettings\022\035\n\025allowed_" + + "package_names\030\001 \003(\t\",\n\016IOSKeySettings\022\032\n" + + "\022allowed_bundle_ids\030\001 \003(\t2\375\n\n!RecaptchaE" + + "nterpriseServiceV1Beta1\022\335\001\n\020CreateAssess" + + "ment\022A.google.cloud.recaptchaenterprise." + + "v1beta1.CreateAssessmentRequest\0324.google" + + ".cloud.recaptchaenterprise.v1beta1.Asses" + + "sment\"P\202\323\344\223\0026\"(/v1beta1/{parent=projects" + + "/*}/assessments:\nassessment\332A\021parent,ass" + + "essment\022\357\001\n\022AnnotateAssessment\022C.google." + + "cloud.recaptchaenterprise.v1beta1.Annota" + + "teAssessmentRequest\032D.google.cloud.recap" + + "tchaenterprise.v1beta1.AnnotateAssessmen" + + "tResponse\"N\202\323\344\223\0026\"1/v1beta1/{name=projec" + + "ts/*/assessments/*}:annotate:\001*\332A\017name,a" + + "nnotation\022\246\001\n\tCreateKey\022:.google.cloud.r" + + "ecaptchaenterprise.v1beta1.CreateKeyRequ" + + "est\032-.google.cloud.recaptchaenterprise.v" + + "1beta1.Key\".\202\323\344\223\002(\"!/v1beta1/{parent=pro" + + "jects/*}/keys:\003key\022\254\001\n\010ListKeys\0229.google" + + ".cloud.recaptchaenterprise.v1beta1.ListK" + + "eysRequest\032:.google.cloud.recaptchaenter" + + "prise.v1beta1.ListKeysResponse\")\202\323\344\223\002#\022!" + + "/v1beta1/{parent=projects/*}/keys\022\233\001\n\006Ge" + + "tKey\0227.google.cloud.recaptchaenterprise." + + "v1beta1.GetKeyRequest\032-.google.cloud.rec" + + "aptchaenterprise.v1beta1.Key\")\202\323\344\223\002#\022!/v" + + "1beta1/{name=projects/*/keys/*}\022\252\001\n\tUpda" + + "teKey\022:.google.cloud.recaptchaenterprise" + + ".v1beta1.UpdateKeyRequest\032-.google.cloud" + + ".recaptchaenterprise.v1beta1.Key\"2\202\323\344\223\002," + + "2%/v1beta1/{key.name=projects/*/keys/*}:" + + "\003key\022\212\001\n\tDeleteKey\022:.google.cloud.recapt" + + "chaenterprise.v1beta1.DeleteKeyRequest\032\026" + + ".google.protobuf.Empty\")\202\323\344\223\002#*!/v1beta1" + + "/{name=projects/*/keys/*}\032V\312A\"recaptchae" + + "nterprise.googleapis.com\322A.https://www.g" + + "oogleapis.com/auth/cloud-platformB\376\001\n&co" + + "m.google.recaptchaenterprise.v1beta1B\030Re" + + "captchaEnterpriseProtoP\001Z[google.golang." + + "org/genproto/googleapis/cloud/recaptchae" + + "nterprise/v1beta1;recaptchaenterprise\242\002\004" + + "GCRE\252\002(Google.Cloud.RecaptchaEnterprise." + + "V1Beta1\312\002(Google\\Cloud\\RecaptchaEnterpri" + + "se\\V1beta1b\006proto3" }; com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { @@ -142,6 +251,8 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.api.ClientProto.getDescriptor(), com.google.api.FieldBehaviorProto.getDescriptor(), com.google.api.ResourceProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), com.google.protobuf.TimestampProto.getDescriptor(), }, assigner); @@ -181,7 +292,7 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_google_cloud_recaptchaenterprise_v1beta1_Event_descriptor, new java.lang.String[] { - "Token", "SiteKey", + "Token", "SiteKey", "UserAgent", "UserIpAddress", "ExpectedAction", }); internal_static_google_cloud_recaptchaenterprise_v1beta1_TokenProperties_descriptor = getDescriptor().getMessageTypes().get(5); @@ -191,6 +302,95 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( new java.lang.String[] { "Valid", "InvalidReason", "CreateTime", "Hostname", "Action", }); + internal_static_google_cloud_recaptchaenterprise_v1beta1_CreateKeyRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_recaptchaenterprise_v1beta1_CreateKeyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1beta1_CreateKeyRequest_descriptor, + new java.lang.String[] { + "Parent", "Key", + }); + internal_static_google_cloud_recaptchaenterprise_v1beta1_ListKeysRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_recaptchaenterprise_v1beta1_ListKeysRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1beta1_ListKeysRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_recaptchaenterprise_v1beta1_ListKeysResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_recaptchaenterprise_v1beta1_ListKeysResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1beta1_ListKeysResponse_descriptor, + new java.lang.String[] { + "Keys", "NextPageToken", + }); + internal_static_google_cloud_recaptchaenterprise_v1beta1_GetKeyRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_recaptchaenterprise_v1beta1_GetKeyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1beta1_GetKeyRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_recaptchaenterprise_v1beta1_UpdateKeyRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_recaptchaenterprise_v1beta1_UpdateKeyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1beta1_UpdateKeyRequest_descriptor, + new java.lang.String[] { + "Key", "UpdateMask", + }); + internal_static_google_cloud_recaptchaenterprise_v1beta1_DeleteKeyRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_recaptchaenterprise_v1beta1_DeleteKeyRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1beta1_DeleteKeyRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_recaptchaenterprise_v1beta1_Key_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_recaptchaenterprise_v1beta1_Key_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1beta1_Key_descriptor, + new java.lang.String[] { + "Name", + "DisplayName", + "WebSettings", + "AndroidSettings", + "IosSettings", + "PlatformSettings", + }); + internal_static_google_cloud_recaptchaenterprise_v1beta1_WebKeySettings_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_recaptchaenterprise_v1beta1_WebKeySettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1beta1_WebKeySettings_descriptor, + new java.lang.String[] { + "EnforceAllowedDomains", + "AllowedDomains", + "AllowAmpTraffic", + "IntegrationType", + "ChallengeSecurityPreference", + }); + internal_static_google_cloud_recaptchaenterprise_v1beta1_AndroidKeySettings_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_recaptchaenterprise_v1beta1_AndroidKeySettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1beta1_AndroidKeySettings_descriptor, + new java.lang.String[] { + "AllowedPackageNames", + }); + internal_static_google_cloud_recaptchaenterprise_v1beta1_IOSKeySettings_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_recaptchaenterprise_v1beta1_IOSKeySettings_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_recaptchaenterprise_v1beta1_IOSKeySettings_descriptor, + new java.lang.String[] { + "AllowedBundleIds", + }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(com.google.api.ClientProto.defaultHost); @@ -206,6 +406,8 @@ public com.google.protobuf.ExtensionRegistry assignDescriptors( com.google.api.ClientProto.getDescriptor(); com.google.api.FieldBehaviorProto.getDescriptor(); com.google.api.ResourceProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); com.google.protobuf.TimestampProto.getDescriptor(); } diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/UpdateKeyRequest.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/UpdateKeyRequest.java new file mode 100644 index 00000000..59ef61b4 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/UpdateKeyRequest.java @@ -0,0 +1,1025 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +/** + * + * + *
+ * The update key request message.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest} + */ +public final class UpdateKeyRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest) + UpdateKeyRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateKeyRequest.newBuilder() to construct. + private UpdateKeyRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateKeyRequest() {} + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private UpdateKeyRequest( + 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: + { + com.google.recaptchaenterprise.v1beta1.Key.Builder subBuilder = null; + if (key_ != null) { + subBuilder = key_.toBuilder(); + } + key_ = + input.readMessage( + com.google.recaptchaenterprise.v1beta1.Key.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(key_); + key_ = subBuilder.buildPartial(); + } + + break; + } + case 18: + { + com.google.protobuf.FieldMask.Builder subBuilder = null; + if (updateMask_ != null) { + subBuilder = updateMask_.toBuilder(); + } + updateMask_ = + input.readMessage(com.google.protobuf.FieldMask.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(updateMask_); + updateMask_ = 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_UpdateKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_UpdateKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest.class, + com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + private com.google.recaptchaenterprise.v1beta1.Key key_; + /** + * + * + *
+   * Required. The key to update.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public boolean hasKey() { + return key_ != null; + } + /** + * + * + *
+   * Required. The key to update.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public com.google.recaptchaenterprise.v1beta1.Key getKey() { + return key_ == null ? com.google.recaptchaenterprise.v1beta1.Key.getDefaultInstance() : key_; + } + /** + * + * + *
+   * Required. The key to update.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public com.google.recaptchaenterprise.v1beta1.KeyOrBuilder getKeyOrBuilder() { + return getKey(); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 2; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. The mask to control which field of the key get updated. If the mask is not
+   * present, all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Optional. The mask to control which field of the key get updated. If the mask is not
+   * present, all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. The mask to control which field of the key get updated. If the mask is not
+   * present, all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return getUpdateMask(); + } + + 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 (key_ != null) { + output.writeMessage(1, getKey()); + } + if (updateMask_ != null) { + output.writeMessage(2, getUpdateMask()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (key_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getKey()); + } + if (updateMask_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getUpdateMask()); + } + 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.UpdateKeyRequest)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest other = + (com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest) obj; + + if (hasKey() != other.hasKey()) return false; + if (hasKey()) { + if (!getKey().equals(other.getKey())) return false; + } + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) 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(); + if (hasKey()) { + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + } + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest 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.UpdateKeyRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest 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.UpdateKeyRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest 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.UpdateKeyRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest 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.UpdateKeyRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest 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.UpdateKeyRequest 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 update key request message.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest) + com.google.recaptchaenterprise.v1beta1.UpdateKeyRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_UpdateKeyRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_UpdateKeyRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest.class, + com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest.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(); + if (keyBuilder_ == null) { + key_ = null; + } else { + key_ = null; + keyBuilder_ = null; + } + if (updateMaskBuilder_ == null) { + updateMask_ = null; + } else { + updateMask_ = null; + updateMaskBuilder_ = 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_UpdateKeyRequest_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest build() { + com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest buildPartial() { + com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest result = + new com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest(this); + if (keyBuilder_ == null) { + result.key_ = key_; + } else { + result.key_ = keyBuilder_.build(); + } + if (updateMaskBuilder_ == null) { + result.updateMask_ = updateMask_; + } else { + result.updateMask_ = updateMaskBuilder_.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.UpdateKeyRequest) { + return mergeFrom((com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest other) { + if (other == com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest.getDefaultInstance()) + return this; + if (other.hasKey()) { + mergeKey(other.getKey()); + } + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + 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.UpdateKeyRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.recaptchaenterprise.v1beta1.Key key_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.Key, + com.google.recaptchaenterprise.v1beta1.Key.Builder, + com.google.recaptchaenterprise.v1beta1.KeyOrBuilder> + keyBuilder_; + /** + * + * + *
+     * Required. The key to update.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public boolean hasKey() { + return keyBuilder_ != null || key_ != null; + } + /** + * + * + *
+     * Required. The key to update.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public com.google.recaptchaenterprise.v1beta1.Key getKey() { + if (keyBuilder_ == null) { + return key_ == null + ? com.google.recaptchaenterprise.v1beta1.Key.getDefaultInstance() + : key_; + } else { + return keyBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The key to update.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public Builder setKey(com.google.recaptchaenterprise.v1beta1.Key value) { + if (keyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + key_ = value; + onChanged(); + } else { + keyBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Required. The key to update.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public Builder setKey(com.google.recaptchaenterprise.v1beta1.Key.Builder builderForValue) { + if (keyBuilder_ == null) { + key_ = builderForValue.build(); + onChanged(); + } else { + keyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Required. The key to update.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public Builder mergeKey(com.google.recaptchaenterprise.v1beta1.Key value) { + if (keyBuilder_ == null) { + if (key_ != null) { + key_ = + com.google.recaptchaenterprise.v1beta1.Key.newBuilder(key_) + .mergeFrom(value) + .buildPartial(); + } else { + key_ = value; + } + onChanged(); + } else { + keyBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Required. The key to update.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public Builder clearKey() { + if (keyBuilder_ == null) { + key_ = null; + onChanged(); + } else { + key_ = null; + keyBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Required. The key to update.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public com.google.recaptchaenterprise.v1beta1.Key.Builder getKeyBuilder() { + + onChanged(); + return getKeyFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The key to update.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + public com.google.recaptchaenterprise.v1beta1.KeyOrBuilder getKeyOrBuilder() { + if (keyBuilder_ != null) { + return keyBuilder_.getMessageOrBuilder(); + } else { + return key_ == null + ? com.google.recaptchaenterprise.v1beta1.Key.getDefaultInstance() + : key_; + } + } + /** + * + * + *
+     * Required. The key to update.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.Key, + com.google.recaptchaenterprise.v1beta1.Key.Builder, + com.google.recaptchaenterprise.v1beta1.KeyOrBuilder> + getKeyFieldBuilder() { + if (keyBuilder_ == null) { + keyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.recaptchaenterprise.v1beta1.Key, + com.google.recaptchaenterprise.v1beta1.Key.Builder, + com.google.recaptchaenterprise.v1beta1.KeyOrBuilder>( + getKey(), getParentForChildren(), isClean()); + key_ = null; + } + return keyBuilder_; + } + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. The mask to control which field of the key get updated. If the mask is not
+     * present, all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public boolean hasUpdateMask() { + return updateMaskBuilder_ != null || updateMask_ != null; + } + /** + * + * + *
+     * Optional. The mask to control which field of the key get updated. If the mask is not
+     * present, all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The mask to control which field of the key get updated. If the mask is not
+     * present, all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + onChanged(); + } else { + updateMaskBuilder_.setMessage(value); + } + + return this; + } + /** + * + * + *
+     * Optional. The mask to control which field of the key get updated. If the mask is not
+     * present, all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + onChanged(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * + * + *
+     * Optional. The mask to control which field of the key get updated. If the mask is not
+     * present, all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (updateMask_ != null) { + updateMask_ = + com.google.protobuf.FieldMask.newBuilder(updateMask_).mergeFrom(value).buildPartial(); + } else { + updateMask_ = value; + } + onChanged(); + } else { + updateMaskBuilder_.mergeFrom(value); + } + + return this; + } + /** + * + * + *
+     * Optional. The mask to control which field of the key get updated. If the mask is not
+     * present, all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + if (updateMaskBuilder_ == null) { + updateMask_ = null; + onChanged(); + } else { + updateMask_ = null; + updateMaskBuilder_ = null; + } + + return this; + } + /** + * + * + *
+     * Optional. The mask to control which field of the key get updated. If the mask is not
+     * present, all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The mask to control which field of the key get updated. If the mask is not
+     * present, all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. The mask to control which field of the key get updated. If the mask is not
+     * present, all fields will be updated.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + @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.UpdateKeyRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest) + private static final com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest(); + } + + public static com.google.recaptchaenterprise.v1beta1.UpdateKeyRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateKeyRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UpdateKeyRequest(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.UpdateKeyRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/UpdateKeyRequestOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/UpdateKeyRequestOrBuilder.java new file mode 100644 index 00000000..d34571a6 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/UpdateKeyRequestOrBuilder.java @@ -0,0 +1,99 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +public interface UpdateKeyRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1beta1.UpdateKeyRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The key to update.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + boolean hasKey(); + /** + * + * + *
+   * Required. The key to update.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + com.google.recaptchaenterprise.v1beta1.Key getKey(); + /** + * + * + *
+   * Required. The key to update.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.Key key = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + */ + com.google.recaptchaenterprise.v1beta1.KeyOrBuilder getKeyOrBuilder(); + + /** + * + * + *
+   * Optional. The mask to control which field of the key get updated. If the mask is not
+   * present, all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. The mask to control which field of the key get updated. If the mask is not
+   * present, all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. The mask to control which field of the key get updated. If the mask is not
+   * present, all fields will be updated.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); +} diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/WebKeySettings.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/WebKeySettings.java new file mode 100644 index 00000000..38d14d87 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/WebKeySettings.java @@ -0,0 +1,1585 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +/** + * + * + *
+ * Settings specific to keys that can be used by websites.
+ * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.WebKeySettings} + */ +public final class WebKeySettings extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.recaptchaenterprise.v1beta1.WebKeySettings) + WebKeySettingsOrBuilder { + private static final long serialVersionUID = 0L; + // Use WebKeySettings.newBuilder() to construct. + private WebKeySettings(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private WebKeySettings() { + allowedDomains_ = com.google.protobuf.LazyStringArrayList.EMPTY; + integrationType_ = 0; + challengeSecurityPreference_ = 0; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet getUnknownFields() { + return this.unknownFields; + } + + private WebKeySettings( + 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(); + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + allowedDomains_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000002; + } + allowedDomains_.add(s); + break; + } + case 16: + { + allowAmpTraffic_ = input.readBool(); + break; + } + case 24: + { + enforceAllowedDomains_ = input.readBool(); + break; + } + case 32: + { + int rawValue = input.readEnum(); + + integrationType_ = rawValue; + break; + } + case 40: + { + int rawValue = input.readEnum(); + + challengeSecurityPreference_ = 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 { + if (((mutable_bitField0_ & 0x00000002) != 0)) { + allowedDomains_ = allowedDomains_.getUnmodifiableView(); + } + 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_WebKeySettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_WebKeySettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.WebKeySettings.class, + com.google.recaptchaenterprise.v1beta1.WebKeySettings.Builder.class); + } + + /** + * + * + *
+   * Enum that represents the integration types for web keys.
+   * 
+ * + * Protobuf enum {@code google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType} + */ + public enum IntegrationType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default type that indicates this enum hasn't been specified. This is not
+     * a valid IntegrationType, one of the other types must be specified
+     * instead.
+     * 
+ * + * INTEGRATION_TYPE_UNSPECIFIED = 0; + */ + INTEGRATION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Only used to produce scores. It doesn't display the "I'm not a robot"
+     * checkbox and never shows captcha challenges.
+     * 
+ * + * SCORE_ONLY = 1; + */ + SCORE_ONLY(1), + /** + * + * + *
+     * Displays the "I'm not a robot" checkbox and may show captcha challenges
+     * after it is checked.
+     * 
+ * + * CHECKBOX_CHALLENGE = 2; + */ + CHECKBOX_CHALLENGE(2), + /** + * + * + *
+     * Doesn't display the "I'm not a robot" checkbox, but may show captcha
+     * challenges after risk analysis.
+     * 
+ * + * INVISIBLE_CHALLENGE = 3; + */ + INVISIBLE_CHALLENGE(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default type that indicates this enum hasn't been specified. This is not
+     * a valid IntegrationType, one of the other types must be specified
+     * instead.
+     * 
+ * + * INTEGRATION_TYPE_UNSPECIFIED = 0; + */ + public static final int INTEGRATION_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Only used to produce scores. It doesn't display the "I'm not a robot"
+     * checkbox and never shows captcha challenges.
+     * 
+ * + * SCORE_ONLY = 1; + */ + public static final int SCORE_ONLY_VALUE = 1; + /** + * + * + *
+     * Displays the "I'm not a robot" checkbox and may show captcha challenges
+     * after it is checked.
+     * 
+ * + * CHECKBOX_CHALLENGE = 2; + */ + public static final int CHECKBOX_CHALLENGE_VALUE = 2; + /** + * + * + *
+     * Doesn't display the "I'm not a robot" checkbox, but may show captcha
+     * challenges after risk analysis.
+     * 
+ * + * INVISIBLE_CHALLENGE = 3; + */ + public static final int INVISIBLE_CHALLENGE_VALUE = 3; + + 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 IntegrationType valueOf(int value) { + return forNumber(value); + } + + public static IntegrationType forNumber(int value) { + switch (value) { + case 0: + return INTEGRATION_TYPE_UNSPECIFIED; + case 1: + return SCORE_ONLY; + case 2: + return CHECKBOX_CHALLENGE; + case 3: + return INVISIBLE_CHALLENGE; + 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 IntegrationType findValueByNumber(int number) { + return IntegrationType.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.WebKeySettings.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final IntegrationType[] VALUES = values(); + + public static IntegrationType 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 IntegrationType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType) + } + + /** + * + * + *
+   * Enum that represents the possible challenge frequency and difficulty
+   * configurations for a web key.
+   * 
+ * + * Protobuf enum {@code + * google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference} + */ + public enum ChallengeSecurityPreference implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Default type that indicates this enum hasn't been specified.
+     * 
+ * + * CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED = 0; + */ + CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED(0), + /** + * + * + *
+     * Key tends to show fewer and easier challenges.
+     * 
+ * + * USABILITY = 1; + */ + USABILITY(1), + /** + * + * + *
+     * Key tends to show balanced (in amount and difficulty) challenges.
+     * 
+ * + * BALANCED = 2; + */ + BALANCED(2), + /** + * + * + *
+     * Key tends to show more and harder challenges.
+     * 
+ * + * SECURITY = 3; + */ + SECURITY(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Default type that indicates this enum hasn't been specified.
+     * 
+ * + * CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED = 0; + */ + public static final int CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Key tends to show fewer and easier challenges.
+     * 
+ * + * USABILITY = 1; + */ + public static final int USABILITY_VALUE = 1; + /** + * + * + *
+     * Key tends to show balanced (in amount and difficulty) challenges.
+     * 
+ * + * BALANCED = 2; + */ + public static final int BALANCED_VALUE = 2; + /** + * + * + *
+     * Key tends to show more and harder challenges.
+     * 
+ * + * SECURITY = 3; + */ + public static final int SECURITY_VALUE = 3; + + 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 ChallengeSecurityPreference valueOf(int value) { + return forNumber(value); + } + + public static ChallengeSecurityPreference forNumber(int value) { + switch (value) { + case 0: + return CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED; + case 1: + return USABILITY; + case 2: + return BALANCED; + case 3: + return SECURITY; + 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 ChallengeSecurityPreference findValueByNumber(int number) { + return ChallengeSecurityPreference.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.WebKeySettings.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final ChallengeSecurityPreference[] VALUES = values(); + + public static ChallengeSecurityPreference 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 ChallengeSecurityPreference(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference) + } + + private int bitField0_; + public static final int ENFORCE_ALLOWED_DOMAINS_FIELD_NUMBER = 3; + private boolean enforceAllowedDomains_; + /** + * + * + *
+   * Whether allowed_domains is enforced or not.
+   * 
+ * + * bool enforce_allowed_domains = 3; + */ + public boolean getEnforceAllowedDomains() { + return enforceAllowedDomains_; + } + + public static final int ALLOWED_DOMAINS_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList allowedDomains_; + /** + * + * + *
+   * Domains or subdomains of websites allowed to use the key. All subdomains
+   * of an allowed domain are automatically allowed. A valid domain requires a
+   * host and must not include any path, port, query or fragment.
+   * Examples: 'example.com' or 'subdomain.example.com'
+   * 
+ * + * repeated string allowed_domains = 1; + */ + public com.google.protobuf.ProtocolStringList getAllowedDomainsList() { + return allowedDomains_; + } + /** + * + * + *
+   * Domains or subdomains of websites allowed to use the key. All subdomains
+   * of an allowed domain are automatically allowed. A valid domain requires a
+   * host and must not include any path, port, query or fragment.
+   * Examples: 'example.com' or 'subdomain.example.com'
+   * 
+ * + * repeated string allowed_domains = 1; + */ + public int getAllowedDomainsCount() { + return allowedDomains_.size(); + } + /** + * + * + *
+   * Domains or subdomains of websites allowed to use the key. All subdomains
+   * of an allowed domain are automatically allowed. A valid domain requires a
+   * host and must not include any path, port, query or fragment.
+   * Examples: 'example.com' or 'subdomain.example.com'
+   * 
+ * + * repeated string allowed_domains = 1; + */ + public java.lang.String getAllowedDomains(int index) { + return allowedDomains_.get(index); + } + /** + * + * + *
+   * Domains or subdomains of websites allowed to use the key. All subdomains
+   * of an allowed domain are automatically allowed. A valid domain requires a
+   * host and must not include any path, port, query or fragment.
+   * Examples: 'example.com' or 'subdomain.example.com'
+   * 
+ * + * repeated string allowed_domains = 1; + */ + public com.google.protobuf.ByteString getAllowedDomainsBytes(int index) { + return allowedDomains_.getByteString(index); + } + + public static final int ALLOW_AMP_TRAFFIC_FIELD_NUMBER = 2; + private boolean allowAmpTraffic_; + /** + * + * + *
+   * Whether this key can be used on AMP (Accelerated Mobile Pages) websites.
+   * 
+ * + * bool allow_amp_traffic = 2; + */ + public boolean getAllowAmpTraffic() { + return allowAmpTraffic_; + } + + public static final int INTEGRATION_TYPE_FIELD_NUMBER = 4; + private int integrationType_; + /** + * + * + *
+   * Required. Describes how this key is integrated with the website.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType integration_type = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getIntegrationTypeValue() { + return integrationType_; + } + /** + * + * + *
+   * Required. Describes how this key is integrated with the website.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType integration_type = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType + getIntegrationType() { + @SuppressWarnings("deprecation") + com.google.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType result = + com.google.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType.valueOf( + integrationType_); + return result == null + ? com.google.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType.UNRECOGNIZED + : result; + } + + public static final int CHALLENGE_SECURITY_PREFERENCE_FIELD_NUMBER = 5; + private int challengeSecurityPreference_; + /** + * + * + *
+   * Settings for the frequency and difficulty at which this key triggers
+   * captcha challenges. This should only be specified for IntegrationTypes
+   * CHECKBOX_CHALLENGE and INVISIBLE_CHALLENGE.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference challenge_security_preference = 5; + * + */ + public int getChallengeSecurityPreferenceValue() { + return challengeSecurityPreference_; + } + /** + * + * + *
+   * Settings for the frequency and difficulty at which this key triggers
+   * captcha challenges. This should only be specified for IntegrationTypes
+   * CHECKBOX_CHALLENGE and INVISIBLE_CHALLENGE.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference challenge_security_preference = 5; + * + */ + public com.google.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference + getChallengeSecurityPreference() { + @SuppressWarnings("deprecation") + com.google.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference result = + com.google.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference.valueOf( + challengeSecurityPreference_); + return result == null + ? com.google.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference + .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 { + for (int i = 0; i < allowedDomains_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, allowedDomains_.getRaw(i)); + } + if (allowAmpTraffic_ != false) { + output.writeBool(2, allowAmpTraffic_); + } + if (enforceAllowedDomains_ != false) { + output.writeBool(3, enforceAllowedDomains_); + } + if (integrationType_ + != com.google.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType + .INTEGRATION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(4, integrationType_); + } + if (challengeSecurityPreference_ + != com.google.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference + .CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED + .getNumber()) { + output.writeEnum(5, challengeSecurityPreference_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < allowedDomains_.size(); i++) { + dataSize += computeStringSizeNoTag(allowedDomains_.getRaw(i)); + } + size += dataSize; + size += 1 * getAllowedDomainsList().size(); + } + if (allowAmpTraffic_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, allowAmpTraffic_); + } + if (enforceAllowedDomains_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, enforceAllowedDomains_); + } + if (integrationType_ + != com.google.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType + .INTEGRATION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, integrationType_); + } + if (challengeSecurityPreference_ + != com.google.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference + .CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED + .getNumber()) { + size += + com.google.protobuf.CodedOutputStream.computeEnumSize(5, challengeSecurityPreference_); + } + 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.WebKeySettings)) { + return super.equals(obj); + } + com.google.recaptchaenterprise.v1beta1.WebKeySettings other = + (com.google.recaptchaenterprise.v1beta1.WebKeySettings) obj; + + if (getEnforceAllowedDomains() != other.getEnforceAllowedDomains()) return false; + if (!getAllowedDomainsList().equals(other.getAllowedDomainsList())) return false; + if (getAllowAmpTraffic() != other.getAllowAmpTraffic()) return false; + if (integrationType_ != other.integrationType_) return false; + if (challengeSecurityPreference_ != other.challengeSecurityPreference_) 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) + ENFORCE_ALLOWED_DOMAINS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getEnforceAllowedDomains()); + if (getAllowedDomainsCount() > 0) { + hash = (37 * hash) + ALLOWED_DOMAINS_FIELD_NUMBER; + hash = (53 * hash) + getAllowedDomainsList().hashCode(); + } + hash = (37 * hash) + ALLOW_AMP_TRAFFIC_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getAllowAmpTraffic()); + hash = (37 * hash) + INTEGRATION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + integrationType_; + hash = (37 * hash) + CHALLENGE_SECURITY_PREFERENCE_FIELD_NUMBER; + hash = (53 * hash) + challengeSecurityPreference_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.recaptchaenterprise.v1beta1.WebKeySettings parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.WebKeySettings 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.WebKeySettings parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.WebKeySettings 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.WebKeySettings parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.recaptchaenterprise.v1beta1.WebKeySettings parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.recaptchaenterprise.v1beta1.WebKeySettings parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.WebKeySettings 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.WebKeySettings parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.WebKeySettings 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.WebKeySettings parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.recaptchaenterprise.v1beta1.WebKeySettings 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.WebKeySettings 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; + } + /** + * + * + *
+   * Settings specific to keys that can be used by websites.
+   * 
+ * + * Protobuf type {@code google.cloud.recaptchaenterprise.v1beta1.WebKeySettings} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.recaptchaenterprise.v1beta1.WebKeySettings) + com.google.recaptchaenterprise.v1beta1.WebKeySettingsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_WebKeySettings_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.recaptchaenterprise.v1beta1.RecaptchaEnterpriseProto + .internal_static_google_cloud_recaptchaenterprise_v1beta1_WebKeySettings_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.recaptchaenterprise.v1beta1.WebKeySettings.class, + com.google.recaptchaenterprise.v1beta1.WebKeySettings.Builder.class); + } + + // Construct using com.google.recaptchaenterprise.v1beta1.WebKeySettings.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(); + enforceAllowedDomains_ = false; + + allowedDomains_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + allowAmpTraffic_ = false; + + integrationType_ = 0; + + challengeSecurityPreference_ = 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_WebKeySettings_descriptor; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.WebKeySettings getDefaultInstanceForType() { + return com.google.recaptchaenterprise.v1beta1.WebKeySettings.getDefaultInstance(); + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.WebKeySettings build() { + com.google.recaptchaenterprise.v1beta1.WebKeySettings result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.recaptchaenterprise.v1beta1.WebKeySettings buildPartial() { + com.google.recaptchaenterprise.v1beta1.WebKeySettings result = + new com.google.recaptchaenterprise.v1beta1.WebKeySettings(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + result.enforceAllowedDomains_ = enforceAllowedDomains_; + if (((bitField0_ & 0x00000002) != 0)) { + allowedDomains_ = allowedDomains_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.allowedDomains_ = allowedDomains_; + result.allowAmpTraffic_ = allowAmpTraffic_; + result.integrationType_ = integrationType_; + result.challengeSecurityPreference_ = challengeSecurityPreference_; + 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.WebKeySettings) { + return mergeFrom((com.google.recaptchaenterprise.v1beta1.WebKeySettings) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.recaptchaenterprise.v1beta1.WebKeySettings other) { + if (other == com.google.recaptchaenterprise.v1beta1.WebKeySettings.getDefaultInstance()) + return this; + if (other.getEnforceAllowedDomains() != false) { + setEnforceAllowedDomains(other.getEnforceAllowedDomains()); + } + if (!other.allowedDomains_.isEmpty()) { + if (allowedDomains_.isEmpty()) { + allowedDomains_ = other.allowedDomains_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureAllowedDomainsIsMutable(); + allowedDomains_.addAll(other.allowedDomains_); + } + onChanged(); + } + if (other.getAllowAmpTraffic() != false) { + setAllowAmpTraffic(other.getAllowAmpTraffic()); + } + if (other.integrationType_ != 0) { + setIntegrationTypeValue(other.getIntegrationTypeValue()); + } + if (other.challengeSecurityPreference_ != 0) { + setChallengeSecurityPreferenceValue(other.getChallengeSecurityPreferenceValue()); + } + 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.WebKeySettings parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = + (com.google.recaptchaenterprise.v1beta1.WebKeySettings) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int bitField0_; + + private boolean enforceAllowedDomains_; + /** + * + * + *
+     * Whether allowed_domains is enforced or not.
+     * 
+ * + * bool enforce_allowed_domains = 3; + */ + public boolean getEnforceAllowedDomains() { + return enforceAllowedDomains_; + } + /** + * + * + *
+     * Whether allowed_domains is enforced or not.
+     * 
+ * + * bool enforce_allowed_domains = 3; + */ + public Builder setEnforceAllowedDomains(boolean value) { + + enforceAllowedDomains_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether allowed_domains is enforced or not.
+     * 
+ * + * bool enforce_allowed_domains = 3; + */ + public Builder clearEnforceAllowedDomains() { + + enforceAllowedDomains_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList allowedDomains_ = + com.google.protobuf.LazyStringArrayList.EMPTY; + + private void ensureAllowedDomainsIsMutable() { + if (!((bitField0_ & 0x00000002) != 0)) { + allowedDomains_ = new com.google.protobuf.LazyStringArrayList(allowedDomains_); + bitField0_ |= 0x00000002; + } + } + /** + * + * + *
+     * Domains or subdomains of websites allowed to use the key. All subdomains
+     * of an allowed domain are automatically allowed. A valid domain requires a
+     * host and must not include any path, port, query or fragment.
+     * Examples: 'example.com' or 'subdomain.example.com'
+     * 
+ * + * repeated string allowed_domains = 1; + */ + public com.google.protobuf.ProtocolStringList getAllowedDomainsList() { + return allowedDomains_.getUnmodifiableView(); + } + /** + * + * + *
+     * Domains or subdomains of websites allowed to use the key. All subdomains
+     * of an allowed domain are automatically allowed. A valid domain requires a
+     * host and must not include any path, port, query or fragment.
+     * Examples: 'example.com' or 'subdomain.example.com'
+     * 
+ * + * repeated string allowed_domains = 1; + */ + public int getAllowedDomainsCount() { + return allowedDomains_.size(); + } + /** + * + * + *
+     * Domains or subdomains of websites allowed to use the key. All subdomains
+     * of an allowed domain are automatically allowed. A valid domain requires a
+     * host and must not include any path, port, query or fragment.
+     * Examples: 'example.com' or 'subdomain.example.com'
+     * 
+ * + * repeated string allowed_domains = 1; + */ + public java.lang.String getAllowedDomains(int index) { + return allowedDomains_.get(index); + } + /** + * + * + *
+     * Domains or subdomains of websites allowed to use the key. All subdomains
+     * of an allowed domain are automatically allowed. A valid domain requires a
+     * host and must not include any path, port, query or fragment.
+     * Examples: 'example.com' or 'subdomain.example.com'
+     * 
+ * + * repeated string allowed_domains = 1; + */ + public com.google.protobuf.ByteString getAllowedDomainsBytes(int index) { + return allowedDomains_.getByteString(index); + } + /** + * + * + *
+     * Domains or subdomains of websites allowed to use the key. All subdomains
+     * of an allowed domain are automatically allowed. A valid domain requires a
+     * host and must not include any path, port, query or fragment.
+     * Examples: 'example.com' or 'subdomain.example.com'
+     * 
+ * + * repeated string allowed_domains = 1; + */ + public Builder setAllowedDomains(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedDomainsIsMutable(); + allowedDomains_.set(index, value); + onChanged(); + return this; + } + /** + * + * + *
+     * Domains or subdomains of websites allowed to use the key. All subdomains
+     * of an allowed domain are automatically allowed. A valid domain requires a
+     * host and must not include any path, port, query or fragment.
+     * Examples: 'example.com' or 'subdomain.example.com'
+     * 
+ * + * repeated string allowed_domains = 1; + */ + public Builder addAllowedDomains(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureAllowedDomainsIsMutable(); + allowedDomains_.add(value); + onChanged(); + return this; + } + /** + * + * + *
+     * Domains or subdomains of websites allowed to use the key. All subdomains
+     * of an allowed domain are automatically allowed. A valid domain requires a
+     * host and must not include any path, port, query or fragment.
+     * Examples: 'example.com' or 'subdomain.example.com'
+     * 
+ * + * repeated string allowed_domains = 1; + */ + public Builder addAllAllowedDomains(java.lang.Iterable values) { + ensureAllowedDomainsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, allowedDomains_); + onChanged(); + return this; + } + /** + * + * + *
+     * Domains or subdomains of websites allowed to use the key. All subdomains
+     * of an allowed domain are automatically allowed. A valid domain requires a
+     * host and must not include any path, port, query or fragment.
+     * Examples: 'example.com' or 'subdomain.example.com'
+     * 
+ * + * repeated string allowed_domains = 1; + */ + public Builder clearAllowedDomains() { + allowedDomains_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Domains or subdomains of websites allowed to use the key. All subdomains
+     * of an allowed domain are automatically allowed. A valid domain requires a
+     * host and must not include any path, port, query or fragment.
+     * Examples: 'example.com' or 'subdomain.example.com'
+     * 
+ * + * repeated string allowed_domains = 1; + */ + public Builder addAllowedDomainsBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureAllowedDomainsIsMutable(); + allowedDomains_.add(value); + onChanged(); + return this; + } + + private boolean allowAmpTraffic_; + /** + * + * + *
+     * Whether this key can be used on AMP (Accelerated Mobile Pages) websites.
+     * 
+ * + * bool allow_amp_traffic = 2; + */ + public boolean getAllowAmpTraffic() { + return allowAmpTraffic_; + } + /** + * + * + *
+     * Whether this key can be used on AMP (Accelerated Mobile Pages) websites.
+     * 
+ * + * bool allow_amp_traffic = 2; + */ + public Builder setAllowAmpTraffic(boolean value) { + + allowAmpTraffic_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Whether this key can be used on AMP (Accelerated Mobile Pages) websites.
+     * 
+ * + * bool allow_amp_traffic = 2; + */ + public Builder clearAllowAmpTraffic() { + + allowAmpTraffic_ = false; + onChanged(); + return this; + } + + private int integrationType_ = 0; + /** + * + * + *
+     * Required. Describes how this key is integrated with the website.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType integration_type = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getIntegrationTypeValue() { + return integrationType_; + } + /** + * + * + *
+     * Required. Describes how this key is integrated with the website.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType integration_type = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setIntegrationTypeValue(int value) { + integrationType_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Describes how this key is integrated with the website.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType integration_type = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType + getIntegrationType() { + @SuppressWarnings("deprecation") + com.google.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType result = + com.google.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType.valueOf( + integrationType_); + return result == null + ? com.google.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Required. Describes how this key is integrated with the website.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType integration_type = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setIntegrationType( + com.google.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType value) { + if (value == null) { + throw new NullPointerException(); + } + + integrationType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Describes how this key is integrated with the website.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType integration_type = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearIntegrationType() { + + integrationType_ = 0; + onChanged(); + return this; + } + + private int challengeSecurityPreference_ = 0; + /** + * + * + *
+     * Settings for the frequency and difficulty at which this key triggers
+     * captcha challenges. This should only be specified for IntegrationTypes
+     * CHECKBOX_CHALLENGE and INVISIBLE_CHALLENGE.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference challenge_security_preference = 5; + * + */ + public int getChallengeSecurityPreferenceValue() { + return challengeSecurityPreference_; + } + /** + * + * + *
+     * Settings for the frequency and difficulty at which this key triggers
+     * captcha challenges. This should only be specified for IntegrationTypes
+     * CHECKBOX_CHALLENGE and INVISIBLE_CHALLENGE.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference challenge_security_preference = 5; + * + */ + public Builder setChallengeSecurityPreferenceValue(int value) { + challengeSecurityPreference_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Settings for the frequency and difficulty at which this key triggers
+     * captcha challenges. This should only be specified for IntegrationTypes
+     * CHECKBOX_CHALLENGE and INVISIBLE_CHALLENGE.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference challenge_security_preference = 5; + * + */ + public com.google.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference + getChallengeSecurityPreference() { + @SuppressWarnings("deprecation") + com.google.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference result = + com.google.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference.valueOf( + challengeSecurityPreference_); + return result == null + ? com.google.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference + .UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Settings for the frequency and difficulty at which this key triggers
+     * captcha challenges. This should only be specified for IntegrationTypes
+     * CHECKBOX_CHALLENGE and INVISIBLE_CHALLENGE.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference challenge_security_preference = 5; + * + */ + public Builder setChallengeSecurityPreference( + com.google.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference value) { + if (value == null) { + throw new NullPointerException(); + } + + challengeSecurityPreference_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Settings for the frequency and difficulty at which this key triggers
+     * captcha challenges. This should only be specified for IntegrationTypes
+     * CHECKBOX_CHALLENGE and INVISIBLE_CHALLENGE.
+     * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference challenge_security_preference = 5; + * + */ + public Builder clearChallengeSecurityPreference() { + + challengeSecurityPreference_ = 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.WebKeySettings) + } + + // @@protoc_insertion_point(class_scope:google.cloud.recaptchaenterprise.v1beta1.WebKeySettings) + private static final com.google.recaptchaenterprise.v1beta1.WebKeySettings DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.recaptchaenterprise.v1beta1.WebKeySettings(); + } + + public static com.google.recaptchaenterprise.v1beta1.WebKeySettings getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public WebKeySettings parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new WebKeySettings(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.WebKeySettings getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/WebKeySettingsOrBuilder.java b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/WebKeySettingsOrBuilder.java new file mode 100644 index 00000000..3fa9f411 --- /dev/null +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/java/com/google/recaptchaenterprise/v1beta1/WebKeySettingsOrBuilder.java @@ -0,0 +1,155 @@ +/* + * 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. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto + +package com.google.recaptchaenterprise.v1beta1; + +public interface WebKeySettingsOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.recaptchaenterprise.v1beta1.WebKeySettings) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Whether allowed_domains is enforced or not.
+   * 
+ * + * bool enforce_allowed_domains = 3; + */ + boolean getEnforceAllowedDomains(); + + /** + * + * + *
+   * Domains or subdomains of websites allowed to use the key. All subdomains
+   * of an allowed domain are automatically allowed. A valid domain requires a
+   * host and must not include any path, port, query or fragment.
+   * Examples: 'example.com' or 'subdomain.example.com'
+   * 
+ * + * repeated string allowed_domains = 1; + */ + java.util.List getAllowedDomainsList(); + /** + * + * + *
+   * Domains or subdomains of websites allowed to use the key. All subdomains
+   * of an allowed domain are automatically allowed. A valid domain requires a
+   * host and must not include any path, port, query or fragment.
+   * Examples: 'example.com' or 'subdomain.example.com'
+   * 
+ * + * repeated string allowed_domains = 1; + */ + int getAllowedDomainsCount(); + /** + * + * + *
+   * Domains or subdomains of websites allowed to use the key. All subdomains
+   * of an allowed domain are automatically allowed. A valid domain requires a
+   * host and must not include any path, port, query or fragment.
+   * Examples: 'example.com' or 'subdomain.example.com'
+   * 
+ * + * repeated string allowed_domains = 1; + */ + java.lang.String getAllowedDomains(int index); + /** + * + * + *
+   * Domains or subdomains of websites allowed to use the key. All subdomains
+   * of an allowed domain are automatically allowed. A valid domain requires a
+   * host and must not include any path, port, query or fragment.
+   * Examples: 'example.com' or 'subdomain.example.com'
+   * 
+ * + * repeated string allowed_domains = 1; + */ + com.google.protobuf.ByteString getAllowedDomainsBytes(int index); + + /** + * + * + *
+   * Whether this key can be used on AMP (Accelerated Mobile Pages) websites.
+   * 
+ * + * bool allow_amp_traffic = 2; + */ + boolean getAllowAmpTraffic(); + + /** + * + * + *
+   * Required. Describes how this key is integrated with the website.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType integration_type = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getIntegrationTypeValue(); + /** + * + * + *
+   * Required. Describes how this key is integrated with the website.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType integration_type = 4 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.recaptchaenterprise.v1beta1.WebKeySettings.IntegrationType getIntegrationType(); + + /** + * + * + *
+   * Settings for the frequency and difficulty at which this key triggers
+   * captcha challenges. This should only be specified for IntegrationTypes
+   * CHECKBOX_CHALLENGE and INVISIBLE_CHALLENGE.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference challenge_security_preference = 5; + * + */ + int getChallengeSecurityPreferenceValue(); + /** + * + * + *
+   * Settings for the frequency and difficulty at which this key triggers
+   * captcha challenges. This should only be specified for IntegrationTypes
+   * CHECKBOX_CHALLENGE and INVISIBLE_CHALLENGE.
+   * 
+ * + * + * .google.cloud.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference challenge_security_preference = 5; + * + */ + com.google.recaptchaenterprise.v1beta1.WebKeySettings.ChallengeSecurityPreference + getChallengeSecurityPreference(); +} diff --git a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/proto/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/proto/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto index c2025d45..380b42f0 100644 --- a/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/proto/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto +++ b/proto-google-cloud-recaptchaenterprise-v1beta1/src/main/proto/google/cloud/recaptchaenterprise/v1beta1/recaptchaenterprise.proto @@ -21,6 +21,8 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; option csharp_namespace = "Google.Cloud.RecaptchaEnterprise.V1Beta1"; @@ -54,6 +56,43 @@ service RecaptchaEnterpriseServiceV1Beta1 { }; option (google.api.method_signature) = "name,annotation"; } + + // Creates a new reCAPTCHA Enterprise key. + rpc CreateKey(CreateKeyRequest) returns (Key) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*}/keys" + body: "key" + }; + } + + // Returns the list of all keys that belong to a project. + rpc ListKeys(ListKeysRequest) returns (ListKeysResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*}/keys" + }; + } + + // Returns the specified key. + rpc GetKey(GetKeyRequest) returns (Key) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/keys/*}" + }; + } + + // Updates the specified key. + rpc UpdateKey(UpdateKeyRequest) returns (Key) { + option (google.api.http) = { + patch: "/v1beta1/{key.name=projects/*/keys/*}" + body: "key" + }; + } + + // Deletes the specified key. + rpc DeleteKey(DeleteKeyRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/keys/*}" + }; + } } // The create assessment request message. @@ -154,13 +193,25 @@ message Assessment { } message Event { - // Required. The user response token provided by the reCAPTCHA client-side integration + // Optional. The user response token provided by the reCAPTCHA client-side integration // on your site. - string token = 1 [(google.api.field_behavior) = REQUIRED]; + string token = 1 [(google.api.field_behavior) = OPTIONAL]; - // Required. The site key that was used to invoke reCAPTCHA on your site and generate + // Optional. The site key that was used to invoke reCAPTCHA on your site and generate // the token. - string site_key = 2 [(google.api.field_behavior) = REQUIRED]; + string site_key = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The user agent present in the request from the user's device related to + // this event. + string user_agent = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The IP address in the request from the user's device related to this event. + string user_ip_address = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The expected action for this type of event. This should be the same action + // provided at token generation time on client-side platforms already + // integrated with recaptcha enterprise. + string expected_action = 5 [(google.api.field_behavior) = OPTIONAL]; } message TokenProperties { @@ -207,3 +258,189 @@ message TokenProperties { // Action name provided at token generation. string action = 5; } + +// The create key request message. +message CreateKeyRequest { + // Required. The name of the project in which the key will be created, in the + // format "projects/{project_number}". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Required. Information to create a reCAPTCHA Enterprise key. + Key key = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The list keys request message. +message ListKeysRequest { + // Required. The name of the project that contains the keys that will be + // listed, in the format "projects/{project_number}". + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "cloudresourcemanager.googleapis.com/Project" + } + ]; + + // Optional. The maximum number of keys to return. Default is 10. Max limit is + // 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous. + // ListKeysRequest, if any. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response to request to list keys in a project. +message ListKeysResponse { + // Key details. + repeated Key keys = 1; + + // Token to retrieve the next page of results. It is set to empty if no keys + // remain in results. + string next_page_token = 2; +} + +// The get key request message. +message GetKeyRequest { + // Required. The name of the requested key, in the format + // "projects/{project_number}/keys/{key_id}". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recaptchaenterprise.googleapis.com/Key" + } + ]; +} + +// The update key request message. +message UpdateKeyRequest { + // Required. The key to update. + Key key = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recaptchaenterprise.googleapis.com/Key" + } + ]; + + // Optional. The mask to control which field of the key get updated. If the mask is not + // present, all fields will be updated. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// The delete key request message. +message DeleteKeyRequest { + // Required. The name of the key to be deleted, in the format + // "projects/{project_number}/keys/{key_id}". + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "recaptchaenterprise.googleapis.com/Key" + } + ]; +} + +// A key used to identify and configure applications (web and/or mobile) that +// use reCAPTCHA Enterprise. +message Key { + option (google.api.resource) = { + type: "recaptchaenterprise.googleapis.com/Key" + pattern: "projects/{project}/keys/{key}" + }; + + // The resource name for the Key in the format + // "projects/{project_number}/keys/{key_id}". + string name = 1; + + // Human-readable display name of this key. Modifiable by user. + string display_name = 2; + + // Platform specific settings for this key. The key can only be used on one + // platform, the one it has settings for. + oneof platform_settings { + // Settings for keys that can be used by websites. + WebKeySettings web_settings = 3; + + // Settings for keys that can be used by Android apps. + AndroidKeySettings android_settings = 4; + + // Settings for keys that can be used by iOS apps. + IOSKeySettings ios_settings = 5; + } +} + +// Settings specific to keys that can be used by websites. +message WebKeySettings { + // Enum that represents the integration types for web keys. + enum IntegrationType { + // Default type that indicates this enum hasn't been specified. This is not + // a valid IntegrationType, one of the other types must be specified + // instead. + INTEGRATION_TYPE_UNSPECIFIED = 0; + + // Only used to produce scores. It doesn't display the "I'm not a robot" + // checkbox and never shows captcha challenges. + SCORE_ONLY = 1; + + // Displays the "I'm not a robot" checkbox and may show captcha challenges + // after it is checked. + CHECKBOX_CHALLENGE = 2; + + // Doesn't display the "I'm not a robot" checkbox, but may show captcha + // challenges after risk analysis. + INVISIBLE_CHALLENGE = 3; + } + + // Enum that represents the possible challenge frequency and difficulty + // configurations for a web key. + enum ChallengeSecurityPreference { + // Default type that indicates this enum hasn't been specified. + CHALLENGE_SECURITY_PREFERENCE_UNSPECIFIED = 0; + + // Key tends to show fewer and easier challenges. + USABILITY = 1; + + // Key tends to show balanced (in amount and difficulty) challenges. + BALANCED = 2; + + // Key tends to show more and harder challenges. + SECURITY = 3; + } + + // Whether allowed_domains is enforced or not. + bool enforce_allowed_domains = 3; + + // Domains or subdomains of websites allowed to use the key. All subdomains + // of an allowed domain are automatically allowed. A valid domain requires a + // host and must not include any path, port, query or fragment. + // Examples: 'example.com' or 'subdomain.example.com' + repeated string allowed_domains = 1; + + // Whether this key can be used on AMP (Accelerated Mobile Pages) websites. + bool allow_amp_traffic = 2; + + // Required. Describes how this key is integrated with the website. + IntegrationType integration_type = 4 [(google.api.field_behavior) = REQUIRED]; + + // Settings for the frequency and difficulty at which this key triggers + // captcha challenges. This should only be specified for IntegrationTypes + // CHECKBOX_CHALLENGE and INVISIBLE_CHALLENGE. + ChallengeSecurityPreference challenge_security_preference = 5; +} + +// Settings specific to keys that can be used by Android apps. +message AndroidKeySettings { + // Android package names of apps allowed to use the key. + // Example: 'com.companyname.appname' + repeated string allowed_package_names = 1; +} + +// Settings specific to keys that can be used by iOS apps. +message IOSKeySettings { + // iOS bundle ids of apps allowed to use the key. + // Example: 'com.companyname.productname.appname' + repeated string allowed_bundle_ids = 1; +} diff --git a/synth.metadata b/synth.metadata index 12afe062..6d0be98c 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-11-21T18:15:03.057228Z", + "updateTime": "2019-11-30T08:51:47.173480Z", "sources": [ { "generator": { @@ -19,8 +19,8 @@ "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "902b51f2073e9958a2aba441f7f7ac54ea00966d", - "internalRef": "281769522" + "sha": "6ab0171e3688bfdcf3dbc4056e2df6345e843565", + "internalRef": "283066965" } }, {