@Generated(value="by gapic-generator-java") public class RecaptchaEnterpriseServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
Assessment assessment = Assessment.newBuilder().build();
Assessment response = recaptchaEnterpriseServiceClient.createAssessment(parent, assessment);
}
Note: close() needs to be called on the RecaptchaEnterpriseServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
CreateAssessment |
Creates an Assessment of the likelihood an event is legitimate. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
AnnotateAssessment |
Annotates a previously created Assessment to provide additional information on whether the event turned out to be authentic or fraudulent. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateKey |
Creates a new reCAPTCHA Enterprise key. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListKeys |
Returns the list of all keys that belong to a project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
RetrieveLegacySecretKey |
Returns the secret key related to the specified public key. You must use the legacy secret key only in a 3rd party integration with legacy reCAPTCHA. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetKey |
Returns the specified key. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateKey |
Updates the specified key. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteKey |
Deletes the specified key. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
MigrateKey |
Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise. Once a key is migrated, it can be used from either product. SiteVerify requests are billed as CreateAssessment calls. You must be authenticated as one of the current owners of the reCAPTCHA Key, and your user must have the reCAPTCHA Enterprise Admin IAM role in the destination project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetMetrics |
Get some aggregated metrics for a Key. This data can be used to build dashboards. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateFirewallPolicy |
Creates a new FirewallPolicy, specifying conditions at which reCAPTCHA Enterprise actions can be executed. A project may have a maximum of 1000 policies. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListFirewallPolicies |
Returns the list of all firewall policies that belong to a project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetFirewallPolicy |
Returns the specified firewall policy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateFirewallPolicy |
Updates the specified firewall policy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteFirewallPolicy |
Deletes the specified firewall policy. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ReorderFirewallPolicies |
Reorders all firewall policies. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListRelatedAccountGroups |
List groups of related accounts. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListRelatedAccountGroupMemberships |
Get memberships in a group of related accounts. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SearchRelatedAccountGroupMemberships |
Search group memberships related to a given account. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of RecaptchaEnterpriseServiceSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
RecaptchaEnterpriseServiceSettings recaptchaEnterpriseServiceSettings =
RecaptchaEnterpriseServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create(recaptchaEnterpriseServiceSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
RecaptchaEnterpriseServiceSettings recaptchaEnterpriseServiceSettings =
RecaptchaEnterpriseServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create(recaptchaEnterpriseServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier | Constructor and Description |
|---|---|
protected |
RecaptchaEnterpriseServiceClient(RecaptchaEnterpriseServiceSettings settings)
Constructs an instance of RecaptchaEnterpriseServiceClient, using the given settings.
|
protected |
RecaptchaEnterpriseServiceClient(RecaptchaEnterpriseServiceStub stub) |
| Modifier and Type | Method and Description |
|---|---|
AnnotateAssessmentResponse |
annotateAssessment(AnnotateAssessmentRequest request)
Annotates a previously created Assessment to provide additional information on whether the
event turned out to be authentic or fraudulent.
|
AnnotateAssessmentResponse |
annotateAssessment(AssessmentName name,
AnnotateAssessmentRequest.Annotation annotation)
Annotates a previously created Assessment to provide additional information on whether the
event turned out to be authentic or fraudulent.
|
AnnotateAssessmentResponse |
annotateAssessment(String name,
AnnotateAssessmentRequest.Annotation annotation)
Annotates a previously created Assessment to provide additional information on whether the
event turned out to be authentic or fraudulent.
|
com.google.api.gax.rpc.UnaryCallable<AnnotateAssessmentRequest,AnnotateAssessmentResponse> |
annotateAssessmentCallable()
Annotates a previously created Assessment to provide additional information on whether the
event turned out to be authentic or fraudulent.
|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static RecaptchaEnterpriseServiceClient |
create()
Constructs an instance of RecaptchaEnterpriseServiceClient with default settings.
|
static RecaptchaEnterpriseServiceClient |
create(RecaptchaEnterpriseServiceSettings settings)
Constructs an instance of RecaptchaEnterpriseServiceClient, using the given settings.
|
static RecaptchaEnterpriseServiceClient |
create(RecaptchaEnterpriseServiceStub stub)
Constructs an instance of RecaptchaEnterpriseServiceClient, using the given stub for making
calls.
|
Assessment |
createAssessment(CreateAssessmentRequest request)
Creates an Assessment of the likelihood an event is legitimate.
|
Assessment |
createAssessment(ProjectName parent,
Assessment assessment)
Creates an Assessment of the likelihood an event is legitimate.
|
Assessment |
createAssessment(String parent,
Assessment assessment)
Creates an Assessment of the likelihood an event is legitimate.
|
com.google.api.gax.rpc.UnaryCallable<CreateAssessmentRequest,Assessment> |
createAssessmentCallable()
Creates an Assessment of the likelihood an event is legitimate.
|
FirewallPolicy |
createFirewallPolicy(CreateFirewallPolicyRequest request)
Creates a new FirewallPolicy, specifying conditions at which reCAPTCHA Enterprise actions can
be executed.
|
FirewallPolicy |
createFirewallPolicy(ProjectName parent,
FirewallPolicy firewallPolicy)
Creates a new FirewallPolicy, specifying conditions at which reCAPTCHA Enterprise actions can
be executed.
|
FirewallPolicy |
createFirewallPolicy(String parent,
FirewallPolicy firewallPolicy)
Creates a new FirewallPolicy, specifying conditions at which reCAPTCHA Enterprise actions can
be executed.
|
com.google.api.gax.rpc.UnaryCallable<CreateFirewallPolicyRequest,FirewallPolicy> |
createFirewallPolicyCallable()
Creates a new FirewallPolicy, specifying conditions at which reCAPTCHA Enterprise actions can
be executed.
|
Key |
createKey(CreateKeyRequest request)
Creates a new reCAPTCHA Enterprise key.
|
Key |
createKey(ProjectName parent,
Key key)
Creates a new reCAPTCHA Enterprise key.
|
Key |
createKey(String parent,
Key key)
Creates a new reCAPTCHA Enterprise key.
|
com.google.api.gax.rpc.UnaryCallable<CreateKeyRequest,Key> |
createKeyCallable()
Creates a new reCAPTCHA Enterprise key.
|
void |
deleteFirewallPolicy(DeleteFirewallPolicyRequest request)
Deletes the specified firewall policy.
|
void |
deleteFirewallPolicy(FirewallPolicyName name)
Deletes the specified firewall policy.
|
void |
deleteFirewallPolicy(String name)
Deletes the specified firewall policy.
|
com.google.api.gax.rpc.UnaryCallable<DeleteFirewallPolicyRequest,com.google.protobuf.Empty> |
deleteFirewallPolicyCallable()
Deletes the specified firewall policy.
|
void |
deleteKey(DeleteKeyRequest request)
Deletes the specified key.
|
void |
deleteKey(KeyName name)
Deletes the specified key.
|
void |
deleteKey(String name)
Deletes the specified key.
|
com.google.api.gax.rpc.UnaryCallable<DeleteKeyRequest,com.google.protobuf.Empty> |
deleteKeyCallable()
Deletes the specified key.
|
FirewallPolicy |
getFirewallPolicy(FirewallPolicyName name)
Returns the specified firewall policy.
|
FirewallPolicy |
getFirewallPolicy(GetFirewallPolicyRequest request)
Returns the specified firewall policy.
|
FirewallPolicy |
getFirewallPolicy(String name)
Returns the specified firewall policy.
|
com.google.api.gax.rpc.UnaryCallable<GetFirewallPolicyRequest,FirewallPolicy> |
getFirewallPolicyCallable()
Returns the specified firewall policy.
|
Key |
getKey(GetKeyRequest request)
Returns the specified key.
|
Key |
getKey(KeyName name)
Returns the specified key.
|
Key |
getKey(String name)
Returns the specified key.
|
com.google.api.gax.rpc.UnaryCallable<GetKeyRequest,Key> |
getKeyCallable()
Returns the specified key.
|
Metrics |
getMetrics(GetMetricsRequest request)
Get some aggregated metrics for a Key.
|
Metrics |
getMetrics(MetricsName name)
Get some aggregated metrics for a Key.
|
Metrics |
getMetrics(String name)
Get some aggregated metrics for a Key.
|
com.google.api.gax.rpc.UnaryCallable<GetMetricsRequest,Metrics> |
getMetricsCallable()
Get some aggregated metrics for a Key.
|
RecaptchaEnterpriseServiceSettings |
getSettings() |
RecaptchaEnterpriseServiceStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
RecaptchaEnterpriseServiceClient.ListFirewallPoliciesPagedResponse |
listFirewallPolicies(ListFirewallPoliciesRequest request)
Returns the list of all firewall policies that belong to a project.
|
RecaptchaEnterpriseServiceClient.ListFirewallPoliciesPagedResponse |
listFirewallPolicies(ProjectName parent)
Returns the list of all firewall policies that belong to a project.
|
RecaptchaEnterpriseServiceClient.ListFirewallPoliciesPagedResponse |
listFirewallPolicies(String parent)
Returns the list of all firewall policies that belong to a project.
|
com.google.api.gax.rpc.UnaryCallable<ListFirewallPoliciesRequest,ListFirewallPoliciesResponse> |
listFirewallPoliciesCallable()
Returns the list of all firewall policies that belong to a project.
|
com.google.api.gax.rpc.UnaryCallable<ListFirewallPoliciesRequest,RecaptchaEnterpriseServiceClient.ListFirewallPoliciesPagedResponse> |
listFirewallPoliciesPagedCallable()
Returns the list of all firewall policies that belong to a project.
|
RecaptchaEnterpriseServiceClient.ListKeysPagedResponse |
listKeys(ListKeysRequest request)
Returns the list of all keys that belong to a project.
|
RecaptchaEnterpriseServiceClient.ListKeysPagedResponse |
listKeys(ProjectName parent)
Returns the list of all keys that belong to a project.
|
RecaptchaEnterpriseServiceClient.ListKeysPagedResponse |
listKeys(String parent)
Returns the list of all keys that belong to a project.
|
com.google.api.gax.rpc.UnaryCallable<ListKeysRequest,ListKeysResponse> |
listKeysCallable()
Returns the list of all keys that belong to a project.
|
com.google.api.gax.rpc.UnaryCallable<ListKeysRequest,RecaptchaEnterpriseServiceClient.ListKeysPagedResponse> |
listKeysPagedCallable()
Returns the list of all keys that belong to a project.
|
RecaptchaEnterpriseServiceClient.ListRelatedAccountGroupMembershipsPagedResponse |
listRelatedAccountGroupMemberships(ListRelatedAccountGroupMembershipsRequest request)
Get memberships in a group of related accounts.
|
RecaptchaEnterpriseServiceClient.ListRelatedAccountGroupMembershipsPagedResponse |
listRelatedAccountGroupMemberships(RelatedAccountGroupName parent)
Get memberships in a group of related accounts.
|
RecaptchaEnterpriseServiceClient.ListRelatedAccountGroupMembershipsPagedResponse |
listRelatedAccountGroupMemberships(String parent)
Get memberships in a group of related accounts.
|
com.google.api.gax.rpc.UnaryCallable<ListRelatedAccountGroupMembershipsRequest,ListRelatedAccountGroupMembershipsResponse> |
listRelatedAccountGroupMembershipsCallable()
Get memberships in a group of related accounts.
|
com.google.api.gax.rpc.UnaryCallable<ListRelatedAccountGroupMembershipsRequest,RecaptchaEnterpriseServiceClient.ListRelatedAccountGroupMembershipsPagedResponse> |
listRelatedAccountGroupMembershipsPagedCallable()
Get memberships in a group of related accounts.
|
RecaptchaEnterpriseServiceClient.ListRelatedAccountGroupsPagedResponse |
listRelatedAccountGroups(ListRelatedAccountGroupsRequest request)
List groups of related accounts.
|
RecaptchaEnterpriseServiceClient.ListRelatedAccountGroupsPagedResponse |
listRelatedAccountGroups(ProjectName parent)
List groups of related accounts.
|
RecaptchaEnterpriseServiceClient.ListRelatedAccountGroupsPagedResponse |
listRelatedAccountGroups(String parent)
List groups of related accounts.
|
com.google.api.gax.rpc.UnaryCallable<ListRelatedAccountGroupsRequest,ListRelatedAccountGroupsResponse> |
listRelatedAccountGroupsCallable()
List groups of related accounts.
|
com.google.api.gax.rpc.UnaryCallable<ListRelatedAccountGroupsRequest,RecaptchaEnterpriseServiceClient.ListRelatedAccountGroupsPagedResponse> |
listRelatedAccountGroupsPagedCallable()
List groups of related accounts.
|
Key |
migrateKey(MigrateKeyRequest request)
Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise.
|
com.google.api.gax.rpc.UnaryCallable<MigrateKeyRequest,Key> |
migrateKeyCallable()
Migrates an existing key from reCAPTCHA to reCAPTCHA Enterprise.
|
ReorderFirewallPoliciesResponse |
reorderFirewallPolicies(ProjectName parent,
List<String> names)
Reorders all firewall policies.
|
ReorderFirewallPoliciesResponse |
reorderFirewallPolicies(ReorderFirewallPoliciesRequest request)
Reorders all firewall policies.
|
ReorderFirewallPoliciesResponse |
reorderFirewallPolicies(String parent,
List<String> names)
Reorders all firewall policies.
|
com.google.api.gax.rpc.UnaryCallable<ReorderFirewallPoliciesRequest,ReorderFirewallPoliciesResponse> |
reorderFirewallPoliciesCallable()
Reorders all firewall policies.
|
RetrieveLegacySecretKeyResponse |
retrieveLegacySecretKey(KeyName key)
Returns the secret key related to the specified public key.
|
RetrieveLegacySecretKeyResponse |
retrieveLegacySecretKey(RetrieveLegacySecretKeyRequest request)
Returns the secret key related to the specified public key.
|
RetrieveLegacySecretKeyResponse |
retrieveLegacySecretKey(String key)
Returns the secret key related to the specified public key.
|
com.google.api.gax.rpc.UnaryCallable<RetrieveLegacySecretKeyRequest,RetrieveLegacySecretKeyResponse> |
retrieveLegacySecretKeyCallable()
Returns the secret key related to the specified public key.
|
RecaptchaEnterpriseServiceClient.SearchRelatedAccountGroupMembershipsPagedResponse |
searchRelatedAccountGroupMemberships(RelatedAccountGroupName project,
com.google.protobuf.ByteString hashedAccountId)
Search group memberships related to a given account.
|
RecaptchaEnterpriseServiceClient.SearchRelatedAccountGroupMembershipsPagedResponse |
searchRelatedAccountGroupMemberships(SearchRelatedAccountGroupMembershipsRequest request)
Search group memberships related to a given account.
|
RecaptchaEnterpriseServiceClient.SearchRelatedAccountGroupMembershipsPagedResponse |
searchRelatedAccountGroupMemberships(String project,
com.google.protobuf.ByteString hashedAccountId)
Search group memberships related to a given account.
|
com.google.api.gax.rpc.UnaryCallable<SearchRelatedAccountGroupMembershipsRequest,SearchRelatedAccountGroupMembershipsResponse> |
searchRelatedAccountGroupMembershipsCallable()
Search group memberships related to a given account.
|
com.google.api.gax.rpc.UnaryCallable<SearchRelatedAccountGroupMembershipsRequest,RecaptchaEnterpriseServiceClient.SearchRelatedAccountGroupMembershipsPagedResponse> |
searchRelatedAccountGroupMembershipsPagedCallable()
Search group memberships related to a given account.
|
void |
shutdown() |
void |
shutdownNow() |
FirewallPolicy |
updateFirewallPolicy(FirewallPolicy firewallPolicy,
com.google.protobuf.FieldMask updateMask)
Updates the specified firewall policy.
|
FirewallPolicy |
updateFirewallPolicy(UpdateFirewallPolicyRequest request)
Updates the specified firewall policy.
|
com.google.api.gax.rpc.UnaryCallable<UpdateFirewallPolicyRequest,FirewallPolicy> |
updateFirewallPolicyCallable()
Updates the specified firewall policy.
|
Key |
updateKey(Key key,
com.google.protobuf.FieldMask updateMask)
Updates the specified key.
|
Key |
updateKey(UpdateKeyRequest request)
Updates the specified key.
|
com.google.api.gax.rpc.UnaryCallable<UpdateKeyRequest,Key> |
updateKeyCallable()
Updates the specified key.
|
protected RecaptchaEnterpriseServiceClient(RecaptchaEnterpriseServiceSettings settings) throws IOException
IOExceptionprotected RecaptchaEnterpriseServiceClient(RecaptchaEnterpriseServiceStub stub)
public static final RecaptchaEnterpriseServiceClient create() throws IOException
IOExceptionpublic static final RecaptchaEnterpriseServiceClient create(RecaptchaEnterpriseServiceSettings settings) throws IOException
IOExceptionpublic static final RecaptchaEnterpriseServiceClient create(RecaptchaEnterpriseServiceStub stub)
public final RecaptchaEnterpriseServiceSettings getSettings()
public RecaptchaEnterpriseServiceStub getStub()
public final Assessment createAssessment(ProjectName parent, Assessment assessment)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
Assessment assessment = Assessment.newBuilder().build();
Assessment response = recaptchaEnterpriseServiceClient.createAssessment(parent, assessment);
}
parent - Required. The name of the project in which the assessment will be created, in the
format `projects/{project}`.assessment - Required. The assessment details.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Assessment createAssessment(String parent, Assessment assessment)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
Assessment assessment = Assessment.newBuilder().build();
Assessment response = recaptchaEnterpriseServiceClient.createAssessment(parent, assessment);
}
parent - Required. The name of the project in which the assessment will be created, in the
format `projects/{project}`.assessment - Required. The assessment details.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Assessment createAssessment(CreateAssessmentRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
CreateAssessmentRequest request =
CreateAssessmentRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setAssessment(Assessment.newBuilder().build())
.build();
Assessment response = recaptchaEnterpriseServiceClient.createAssessment(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateAssessmentRequest,Assessment> createAssessmentCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
CreateAssessmentRequest request =
CreateAssessmentRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setAssessment(Assessment.newBuilder().build())
.build();
ApiFuture<Assessment> future =
recaptchaEnterpriseServiceClient.createAssessmentCallable().futureCall(request);
// Do something.
Assessment response = future.get();
}
public final AnnotateAssessmentResponse annotateAssessment(AssessmentName name, AnnotateAssessmentRequest.Annotation annotation)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
AssessmentName name = AssessmentName.of("[PROJECT]", "[ASSESSMENT]");
AnnotateAssessmentRequest.Annotation annotation =
AnnotateAssessmentRequest.Annotation.forNumber(0);
AnnotateAssessmentResponse response =
recaptchaEnterpriseServiceClient.annotateAssessment(name, annotation);
}
name - Required. The resource name of the Assessment, in the format
`projects/{project}/assessments/{assessment}`.annotation - Optional. The annotation that will be assigned to the Event. This field can
be left empty to provide reasons that apply to an event without concluding whether the
event is legitimate or fraudulent.com.google.api.gax.rpc.ApiException - if the remote call failspublic final AnnotateAssessmentResponse annotateAssessment(String name, AnnotateAssessmentRequest.Annotation annotation)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
String name = AssessmentName.of("[PROJECT]", "[ASSESSMENT]").toString();
AnnotateAssessmentRequest.Annotation annotation =
AnnotateAssessmentRequest.Annotation.forNumber(0);
AnnotateAssessmentResponse response =
recaptchaEnterpriseServiceClient.annotateAssessment(name, annotation);
}
name - Required. The resource name of the Assessment, in the format
`projects/{project}/assessments/{assessment}`.annotation - Optional. The annotation that will be assigned to the Event. This field can
be left empty to provide reasons that apply to an event without concluding whether the
event is legitimate or fraudulent.com.google.api.gax.rpc.ApiException - if the remote call failspublic final AnnotateAssessmentResponse annotateAssessment(AnnotateAssessmentRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
AnnotateAssessmentRequest request =
AnnotateAssessmentRequest.newBuilder()
.setName(AssessmentName.of("[PROJECT]", "[ASSESSMENT]").toString())
.addAllReasons(new ArrayList<AnnotateAssessmentRequest.Reason>())
.setAccountId("accountId-1827029976")
.setHashedAccountId(ByteString.EMPTY)
.setTransactionEvent(TransactionEvent.newBuilder().build())
.build();
AnnotateAssessmentResponse response =
recaptchaEnterpriseServiceClient.annotateAssessment(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<AnnotateAssessmentRequest,AnnotateAssessmentResponse> annotateAssessmentCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
AnnotateAssessmentRequest request =
AnnotateAssessmentRequest.newBuilder()
.setName(AssessmentName.of("[PROJECT]", "[ASSESSMENT]").toString())
.addAllReasons(new ArrayList<AnnotateAssessmentRequest.Reason>())
.setAccountId("accountId-1827029976")
.setHashedAccountId(ByteString.EMPTY)
.setTransactionEvent(TransactionEvent.newBuilder().build())
.build();
ApiFuture<AnnotateAssessmentResponse> future =
recaptchaEnterpriseServiceClient.annotateAssessmentCallable().futureCall(request);
// Do something.
AnnotateAssessmentResponse response = future.get();
}
public final Key createKey(ProjectName parent, Key key)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
Key key = Key.newBuilder().build();
Key response = recaptchaEnterpriseServiceClient.createKey(parent, key);
}
parent - Required. The name of the project in which the key will be created, in the format
`projects/{project}`.key - Required. Information to create a reCAPTCHA Enterprise key.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Key createKey(String parent, Key key)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
Key key = Key.newBuilder().build();
Key response = recaptchaEnterpriseServiceClient.createKey(parent, key);
}
parent - Required. The name of the project in which the key will be created, in the format
`projects/{project}`.key - Required. Information to create a reCAPTCHA Enterprise key.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Key createKey(CreateKeyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
CreateKeyRequest request =
CreateKeyRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setKey(Key.newBuilder().build())
.build();
Key response = recaptchaEnterpriseServiceClient.createKey(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateKeyRequest,Key> createKeyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
CreateKeyRequest request =
CreateKeyRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setKey(Key.newBuilder().build())
.build();
ApiFuture<Key> future =
recaptchaEnterpriseServiceClient.createKeyCallable().futureCall(request);
// Do something.
Key response = future.get();
}
public final RecaptchaEnterpriseServiceClient.ListKeysPagedResponse listKeys(ProjectName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
for (Key element : recaptchaEnterpriseServiceClient.listKeys(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the project that contains the keys that will be listed, in
the format `projects/{project}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RecaptchaEnterpriseServiceClient.ListKeysPagedResponse listKeys(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
for (Key element : recaptchaEnterpriseServiceClient.listKeys(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the project that contains the keys that will be listed, in
the format `projects/{project}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RecaptchaEnterpriseServiceClient.ListKeysPagedResponse listKeys(ListKeysRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ListKeysRequest request =
ListKeysRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Key element : recaptchaEnterpriseServiceClient.listKeys(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListKeysRequest,RecaptchaEnterpriseServiceClient.ListKeysPagedResponse> listKeysPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ListKeysRequest request =
ListKeysRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Key> future =
recaptchaEnterpriseServiceClient.listKeysPagedCallable().futureCall(request);
// Do something.
for (Key element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListKeysRequest,ListKeysResponse> listKeysCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ListKeysRequest request =
ListKeysRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListKeysResponse response =
recaptchaEnterpriseServiceClient.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 RetrieveLegacySecretKeyResponse retrieveLegacySecretKey(KeyName key)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
KeyName key = KeyName.of("[PROJECT]", "[KEY]");
RetrieveLegacySecretKeyResponse response =
recaptchaEnterpriseServiceClient.retrieveLegacySecretKey(key);
}
key - Required. The public key name linked to the requested secret key in the format
`projects/{project}/keys/{key}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RetrieveLegacySecretKeyResponse retrieveLegacySecretKey(String key)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
String key = KeyName.of("[PROJECT]", "[KEY]").toString();
RetrieveLegacySecretKeyResponse response =
recaptchaEnterpriseServiceClient.retrieveLegacySecretKey(key);
}
key - Required. The public key name linked to the requested secret key in the format
`projects/{project}/keys/{key}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RetrieveLegacySecretKeyResponse retrieveLegacySecretKey(RetrieveLegacySecretKeyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
RetrieveLegacySecretKeyRequest request =
RetrieveLegacySecretKeyRequest.newBuilder()
.setKey(KeyName.of("[PROJECT]", "[KEY]").toString())
.build();
RetrieveLegacySecretKeyResponse response =
recaptchaEnterpriseServiceClient.retrieveLegacySecretKey(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<RetrieveLegacySecretKeyRequest,RetrieveLegacySecretKeyResponse> retrieveLegacySecretKeyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
RetrieveLegacySecretKeyRequest request =
RetrieveLegacySecretKeyRequest.newBuilder()
.setKey(KeyName.of("[PROJECT]", "[KEY]").toString())
.build();
ApiFuture<RetrieveLegacySecretKeyResponse> future =
recaptchaEnterpriseServiceClient.retrieveLegacySecretKeyCallable().futureCall(request);
// Do something.
RetrieveLegacySecretKeyResponse response = future.get();
}
public final Key getKey(KeyName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
KeyName name = KeyName.of("[PROJECT]", "[KEY]");
Key response = recaptchaEnterpriseServiceClient.getKey(name);
}
name - Required. The name of the requested key, in the format
`projects/{project}/keys/{key}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Key getKey(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
String name = KeyName.of("[PROJECT]", "[KEY]").toString();
Key response = recaptchaEnterpriseServiceClient.getKey(name);
}
name - Required. The name of the requested key, in the format
`projects/{project}/keys/{key}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Key getKey(GetKeyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
GetKeyRequest request =
GetKeyRequest.newBuilder().setName(KeyName.of("[PROJECT]", "[KEY]").toString()).build();
Key response = recaptchaEnterpriseServiceClient.getKey(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetKeyRequest,Key> getKeyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
GetKeyRequest request =
GetKeyRequest.newBuilder().setName(KeyName.of("[PROJECT]", "[KEY]").toString()).build();
ApiFuture<Key> future = recaptchaEnterpriseServiceClient.getKeyCallable().futureCall(request);
// Do something.
Key response = future.get();
}
public final Key updateKey(Key key, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
Key key = Key.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Key response = recaptchaEnterpriseServiceClient.updateKey(key, updateMask);
}
key - Required. The key to update.updateMask - Optional. The mask to control which fields of the key get updated. If the
mask is not present, all fields will be updated.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Key updateKey(UpdateKeyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
UpdateKeyRequest request =
UpdateKeyRequest.newBuilder()
.setKey(Key.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Key response = recaptchaEnterpriseServiceClient.updateKey(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateKeyRequest,Key> updateKeyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
UpdateKeyRequest request =
UpdateKeyRequest.newBuilder()
.setKey(Key.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Key> future =
recaptchaEnterpriseServiceClient.updateKeyCallable().futureCall(request);
// Do something.
Key response = future.get();
}
public final void deleteKey(KeyName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
KeyName name = KeyName.of("[PROJECT]", "[KEY]");
recaptchaEnterpriseServiceClient.deleteKey(name);
}
name - Required. The name of the key to be deleted, in the format
`projects/{project}/keys/{key}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteKey(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
String name = KeyName.of("[PROJECT]", "[KEY]").toString();
recaptchaEnterpriseServiceClient.deleteKey(name);
}
name - Required. The name of the key to be deleted, in the format
`projects/{project}/keys/{key}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteKey(DeleteKeyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
DeleteKeyRequest request =
DeleteKeyRequest.newBuilder()
.setName(KeyName.of("[PROJECT]", "[KEY]").toString())
.build();
recaptchaEnterpriseServiceClient.deleteKey(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteKeyRequest,com.google.protobuf.Empty> deleteKeyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
DeleteKeyRequest request =
DeleteKeyRequest.newBuilder()
.setName(KeyName.of("[PROJECT]", "[KEY]").toString())
.build();
ApiFuture<Empty> future =
recaptchaEnterpriseServiceClient.deleteKeyCallable().futureCall(request);
// Do something.
future.get();
}
public final Key migrateKey(MigrateKeyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
MigrateKeyRequest request =
MigrateKeyRequest.newBuilder()
.setName(KeyName.of("[PROJECT]", "[KEY]").toString())
.setSkipBillingCheck(true)
.build();
Key response = recaptchaEnterpriseServiceClient.migrateKey(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<MigrateKeyRequest,Key> migrateKeyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
MigrateKeyRequest request =
MigrateKeyRequest.newBuilder()
.setName(KeyName.of("[PROJECT]", "[KEY]").toString())
.setSkipBillingCheck(true)
.build();
ApiFuture<Key> future =
recaptchaEnterpriseServiceClient.migrateKeyCallable().futureCall(request);
// Do something.
Key response = future.get();
}
public final Metrics getMetrics(MetricsName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
MetricsName name = MetricsName.of("[PROJECT]", "[KEY]");
Metrics response = recaptchaEnterpriseServiceClient.getMetrics(name);
}
name - Required. The name of the requested metrics, in the format
`projects/{project}/keys/{key}/metrics`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Metrics getMetrics(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
String name = MetricsName.of("[PROJECT]", "[KEY]").toString();
Metrics response = recaptchaEnterpriseServiceClient.getMetrics(name);
}
name - Required. The name of the requested metrics, in the format
`projects/{project}/keys/{key}/metrics`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Metrics getMetrics(GetMetricsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
GetMetricsRequest request =
GetMetricsRequest.newBuilder()
.setName(MetricsName.of("[PROJECT]", "[KEY]").toString())
.build();
Metrics response = recaptchaEnterpriseServiceClient.getMetrics(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetMetricsRequest,Metrics> getMetricsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
GetMetricsRequest request =
GetMetricsRequest.newBuilder()
.setName(MetricsName.of("[PROJECT]", "[KEY]").toString())
.build();
ApiFuture<Metrics> future =
recaptchaEnterpriseServiceClient.getMetricsCallable().futureCall(request);
// Do something.
Metrics response = future.get();
}
public final FirewallPolicy createFirewallPolicy(ProjectName parent, FirewallPolicy firewallPolicy)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
FirewallPolicy firewallPolicy = FirewallPolicy.newBuilder().build();
FirewallPolicy response =
recaptchaEnterpriseServiceClient.createFirewallPolicy(parent, firewallPolicy);
}
parent - Required. The name of the project this policy will apply to, in the format
`projects/{project}`.firewallPolicy - Required. Information to create the policy.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FirewallPolicy createFirewallPolicy(String parent, FirewallPolicy firewallPolicy)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
FirewallPolicy firewallPolicy = FirewallPolicy.newBuilder().build();
FirewallPolicy response =
recaptchaEnterpriseServiceClient.createFirewallPolicy(parent, firewallPolicy);
}
parent - Required. The name of the project this policy will apply to, in the format
`projects/{project}`.firewallPolicy - Required. Information to create the policy.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FirewallPolicy createFirewallPolicy(CreateFirewallPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
CreateFirewallPolicyRequest request =
CreateFirewallPolicyRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setFirewallPolicy(FirewallPolicy.newBuilder().build())
.build();
FirewallPolicy response = recaptchaEnterpriseServiceClient.createFirewallPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<CreateFirewallPolicyRequest,FirewallPolicy> createFirewallPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
CreateFirewallPolicyRequest request =
CreateFirewallPolicyRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setFirewallPolicy(FirewallPolicy.newBuilder().build())
.build();
ApiFuture<FirewallPolicy> future =
recaptchaEnterpriseServiceClient.createFirewallPolicyCallable().futureCall(request);
// Do something.
FirewallPolicy response = future.get();
}
public final RecaptchaEnterpriseServiceClient.ListFirewallPoliciesPagedResponse listFirewallPolicies(ProjectName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
for (FirewallPolicy element :
recaptchaEnterpriseServiceClient.listFirewallPolicies(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the project to list the policies for, in the format
`projects/{project}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RecaptchaEnterpriseServiceClient.ListFirewallPoliciesPagedResponse listFirewallPolicies(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
for (FirewallPolicy element :
recaptchaEnterpriseServiceClient.listFirewallPolicies(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the project to list the policies for, in the format
`projects/{project}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RecaptchaEnterpriseServiceClient.ListFirewallPoliciesPagedResponse listFirewallPolicies(ListFirewallPoliciesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ListFirewallPoliciesRequest request =
ListFirewallPoliciesRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (FirewallPolicy element :
recaptchaEnterpriseServiceClient.listFirewallPolicies(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListFirewallPoliciesRequest,RecaptchaEnterpriseServiceClient.ListFirewallPoliciesPagedResponse> listFirewallPoliciesPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ListFirewallPoliciesRequest request =
ListFirewallPoliciesRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<FirewallPolicy> future =
recaptchaEnterpriseServiceClient.listFirewallPoliciesPagedCallable().futureCall(request);
// Do something.
for (FirewallPolicy element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListFirewallPoliciesRequest,ListFirewallPoliciesResponse> listFirewallPoliciesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ListFirewallPoliciesRequest request =
ListFirewallPoliciesRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListFirewallPoliciesResponse response =
recaptchaEnterpriseServiceClient.listFirewallPoliciesCallable().call(request);
for (FirewallPolicy element : response.getFirewallPoliciesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final FirewallPolicy getFirewallPolicy(FirewallPolicyName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
FirewallPolicyName name = FirewallPolicyName.of("[PROJECT]", "[FIREWALLPOLICY]");
FirewallPolicy response = recaptchaEnterpriseServiceClient.getFirewallPolicy(name);
}
name - Required. The name of the requested policy, in the format
`projects/{project}/firewallpolicies/{firewallpolicy}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FirewallPolicy getFirewallPolicy(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
String name = FirewallPolicyName.of("[PROJECT]", "[FIREWALLPOLICY]").toString();
FirewallPolicy response = recaptchaEnterpriseServiceClient.getFirewallPolicy(name);
}
name - Required. The name of the requested policy, in the format
`projects/{project}/firewallpolicies/{firewallpolicy}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FirewallPolicy getFirewallPolicy(GetFirewallPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
GetFirewallPolicyRequest request =
GetFirewallPolicyRequest.newBuilder()
.setName(FirewallPolicyName.of("[PROJECT]", "[FIREWALLPOLICY]").toString())
.build();
FirewallPolicy response = recaptchaEnterpriseServiceClient.getFirewallPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetFirewallPolicyRequest,FirewallPolicy> getFirewallPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
GetFirewallPolicyRequest request =
GetFirewallPolicyRequest.newBuilder()
.setName(FirewallPolicyName.of("[PROJECT]", "[FIREWALLPOLICY]").toString())
.build();
ApiFuture<FirewallPolicy> future =
recaptchaEnterpriseServiceClient.getFirewallPolicyCallable().futureCall(request);
// Do something.
FirewallPolicy response = future.get();
}
public final FirewallPolicy updateFirewallPolicy(FirewallPolicy firewallPolicy, com.google.protobuf.FieldMask updateMask)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
FirewallPolicy firewallPolicy = FirewallPolicy.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
FirewallPolicy response =
recaptchaEnterpriseServiceClient.updateFirewallPolicy(firewallPolicy, updateMask);
}
firewallPolicy - Required. The policy to update.updateMask - Optional. The mask to control which fields of the policy get updated. If the
mask is not present, all fields will be updated.com.google.api.gax.rpc.ApiException - if the remote call failspublic final FirewallPolicy updateFirewallPolicy(UpdateFirewallPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
UpdateFirewallPolicyRequest request =
UpdateFirewallPolicyRequest.newBuilder()
.setFirewallPolicy(FirewallPolicy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
FirewallPolicy response = recaptchaEnterpriseServiceClient.updateFirewallPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UpdateFirewallPolicyRequest,FirewallPolicy> updateFirewallPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
UpdateFirewallPolicyRequest request =
UpdateFirewallPolicyRequest.newBuilder()
.setFirewallPolicy(FirewallPolicy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<FirewallPolicy> future =
recaptchaEnterpriseServiceClient.updateFirewallPolicyCallable().futureCall(request);
// Do something.
FirewallPolicy response = future.get();
}
public final void deleteFirewallPolicy(FirewallPolicyName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
FirewallPolicyName name = FirewallPolicyName.of("[PROJECT]", "[FIREWALLPOLICY]");
recaptchaEnterpriseServiceClient.deleteFirewallPolicy(name);
}
name - Required. The name of the policy to be deleted, in the format
`projects/{project}/firewallpolicies/{firewallpolicy}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteFirewallPolicy(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
String name = FirewallPolicyName.of("[PROJECT]", "[FIREWALLPOLICY]").toString();
recaptchaEnterpriseServiceClient.deleteFirewallPolicy(name);
}
name - Required. The name of the policy to be deleted, in the format
`projects/{project}/firewallpolicies/{firewallpolicy}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deleteFirewallPolicy(DeleteFirewallPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
DeleteFirewallPolicyRequest request =
DeleteFirewallPolicyRequest.newBuilder()
.setName(FirewallPolicyName.of("[PROJECT]", "[FIREWALLPOLICY]").toString())
.build();
recaptchaEnterpriseServiceClient.deleteFirewallPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<DeleteFirewallPolicyRequest,com.google.protobuf.Empty> deleteFirewallPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
DeleteFirewallPolicyRequest request =
DeleteFirewallPolicyRequest.newBuilder()
.setName(FirewallPolicyName.of("[PROJECT]", "[FIREWALLPOLICY]").toString())
.build();
ApiFuture<Empty> future =
recaptchaEnterpriseServiceClient.deleteFirewallPolicyCallable().futureCall(request);
// Do something.
future.get();
}
public final ReorderFirewallPoliciesResponse reorderFirewallPolicies(ProjectName parent, List<String> names)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
List<String> names = new ArrayList<>();
ReorderFirewallPoliciesResponse response =
recaptchaEnterpriseServiceClient.reorderFirewallPolicies(parent, names);
}
parent - Required. The name of the project to list the policies for, in the format
`projects/{project}`.names - Required. A list containing all policy names, in the new order. Each name is in
the format `projects/{project}/firewallpolicies/{firewallpolicy}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ReorderFirewallPoliciesResponse reorderFirewallPolicies(String parent, List<String> names)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
List<String> names = new ArrayList<>();
ReorderFirewallPoliciesResponse response =
recaptchaEnterpriseServiceClient.reorderFirewallPolicies(parent, names);
}
parent - Required. The name of the project to list the policies for, in the format
`projects/{project}`.names - Required. A list containing all policy names, in the new order. Each name is in
the format `projects/{project}/firewallpolicies/{firewallpolicy}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final ReorderFirewallPoliciesResponse reorderFirewallPolicies(ReorderFirewallPoliciesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ReorderFirewallPoliciesRequest request =
ReorderFirewallPoliciesRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.addAllNames(new ArrayList<String>())
.build();
ReorderFirewallPoliciesResponse response =
recaptchaEnterpriseServiceClient.reorderFirewallPolicies(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ReorderFirewallPoliciesRequest,ReorderFirewallPoliciesResponse> reorderFirewallPoliciesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ReorderFirewallPoliciesRequest request =
ReorderFirewallPoliciesRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.addAllNames(new ArrayList<String>())
.build();
ApiFuture<ReorderFirewallPoliciesResponse> future =
recaptchaEnterpriseServiceClient.reorderFirewallPoliciesCallable().futureCall(request);
// Do something.
ReorderFirewallPoliciesResponse response = future.get();
}
public final RecaptchaEnterpriseServiceClient.ListRelatedAccountGroupsPagedResponse listRelatedAccountGroups(ProjectName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
for (RelatedAccountGroup element :
recaptchaEnterpriseServiceClient.listRelatedAccountGroups(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the project to list related account groups from, in the
format `projects/{project}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RecaptchaEnterpriseServiceClient.ListRelatedAccountGroupsPagedResponse listRelatedAccountGroups(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
for (RelatedAccountGroup element :
recaptchaEnterpriseServiceClient.listRelatedAccountGroups(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The name of the project to list related account groups from, in the
format `projects/{project}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RecaptchaEnterpriseServiceClient.ListRelatedAccountGroupsPagedResponse listRelatedAccountGroups(ListRelatedAccountGroupsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ListRelatedAccountGroupsRequest request =
ListRelatedAccountGroupsRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (RelatedAccountGroup element :
recaptchaEnterpriseServiceClient.listRelatedAccountGroups(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListRelatedAccountGroupsRequest,RecaptchaEnterpriseServiceClient.ListRelatedAccountGroupsPagedResponse> listRelatedAccountGroupsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ListRelatedAccountGroupsRequest request =
ListRelatedAccountGroupsRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<RelatedAccountGroup> future =
recaptchaEnterpriseServiceClient
.listRelatedAccountGroupsPagedCallable()
.futureCall(request);
// Do something.
for (RelatedAccountGroup element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListRelatedAccountGroupsRequest,ListRelatedAccountGroupsResponse> listRelatedAccountGroupsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ListRelatedAccountGroupsRequest request =
ListRelatedAccountGroupsRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListRelatedAccountGroupsResponse response =
recaptchaEnterpriseServiceClient.listRelatedAccountGroupsCallable().call(request);
for (RelatedAccountGroup element : response.getRelatedAccountGroupsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final RecaptchaEnterpriseServiceClient.ListRelatedAccountGroupMembershipsPagedResponse listRelatedAccountGroupMemberships(RelatedAccountGroupName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
RelatedAccountGroupName parent =
RelatedAccountGroupName.of("[PROJECT]", "[RELATEDACCOUNTGROUP]");
for (RelatedAccountGroupMembership element :
recaptchaEnterpriseServiceClient
.listRelatedAccountGroupMemberships(parent)
.iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name for the related account group in the format
`projects/{project}/relatedaccountgroups/{relatedaccountgroup}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RecaptchaEnterpriseServiceClient.ListRelatedAccountGroupMembershipsPagedResponse listRelatedAccountGroupMemberships(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
String parent = RelatedAccountGroupName.of("[PROJECT]", "[RELATEDACCOUNTGROUP]").toString();
for (RelatedAccountGroupMembership element :
recaptchaEnterpriseServiceClient
.listRelatedAccountGroupMemberships(parent)
.iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name for the related account group in the format
`projects/{project}/relatedaccountgroups/{relatedaccountgroup}`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RecaptchaEnterpriseServiceClient.ListRelatedAccountGroupMembershipsPagedResponse listRelatedAccountGroupMemberships(ListRelatedAccountGroupMembershipsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ListRelatedAccountGroupMembershipsRequest request =
ListRelatedAccountGroupMembershipsRequest.newBuilder()
.setParent(
RelatedAccountGroupName.of("[PROJECT]", "[RELATEDACCOUNTGROUP]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (RelatedAccountGroupMembership element :
recaptchaEnterpriseServiceClient
.listRelatedAccountGroupMemberships(request)
.iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListRelatedAccountGroupMembershipsRequest,RecaptchaEnterpriseServiceClient.ListRelatedAccountGroupMembershipsPagedResponse> listRelatedAccountGroupMembershipsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ListRelatedAccountGroupMembershipsRequest request =
ListRelatedAccountGroupMembershipsRequest.newBuilder()
.setParent(
RelatedAccountGroupName.of("[PROJECT]", "[RELATEDACCOUNTGROUP]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<RelatedAccountGroupMembership> future =
recaptchaEnterpriseServiceClient
.listRelatedAccountGroupMembershipsPagedCallable()
.futureCall(request);
// Do something.
for (RelatedAccountGroupMembership element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListRelatedAccountGroupMembershipsRequest,ListRelatedAccountGroupMembershipsResponse> listRelatedAccountGroupMembershipsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
ListRelatedAccountGroupMembershipsRequest request =
ListRelatedAccountGroupMembershipsRequest.newBuilder()
.setParent(
RelatedAccountGroupName.of("[PROJECT]", "[RELATEDACCOUNTGROUP]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListRelatedAccountGroupMembershipsResponse response =
recaptchaEnterpriseServiceClient
.listRelatedAccountGroupMembershipsCallable()
.call(request);
for (RelatedAccountGroupMembership element :
response.getRelatedAccountGroupMembershipsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final RecaptchaEnterpriseServiceClient.SearchRelatedAccountGroupMembershipsPagedResponse searchRelatedAccountGroupMemberships(RelatedAccountGroupName project, com.google.protobuf.ByteString hashedAccountId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
RelatedAccountGroupName project =
RelatedAccountGroupName.of("[PROJECT]", "[RELATEDACCOUNTGROUP]");
ByteString hashedAccountId = ByteString.EMPTY;
for (RelatedAccountGroupMembership element :
recaptchaEnterpriseServiceClient
.searchRelatedAccountGroupMemberships(project, hashedAccountId)
.iterateAll()) {
// doThingsWith(element);
}
}
project - Required. The name of the project to search related account group memberships
from. Specify the project name in the following format: `projects/{project}`.hashedAccountId - Optional. Deprecated: use `account_id` instead. The unique stable hashed
account identifier used to search connections. The identifier should correspond to a
`hashed_account_id` provided in a previous `CreateAssessment` or `AnnotateAssessment` call.
Either hashed_account_id or account_id must be set, but not both.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RecaptchaEnterpriseServiceClient.SearchRelatedAccountGroupMembershipsPagedResponse searchRelatedAccountGroupMemberships(String project, com.google.protobuf.ByteString hashedAccountId)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
String project = RelatedAccountGroupName.of("[PROJECT]", "[RELATEDACCOUNTGROUP]").toString();
ByteString hashedAccountId = ByteString.EMPTY;
for (RelatedAccountGroupMembership element :
recaptchaEnterpriseServiceClient
.searchRelatedAccountGroupMemberships(project, hashedAccountId)
.iterateAll()) {
// doThingsWith(element);
}
}
project - Required. The name of the project to search related account group memberships
from. Specify the project name in the following format: `projects/{project}`.hashedAccountId - Optional. Deprecated: use `account_id` instead. The unique stable hashed
account identifier used to search connections. The identifier should correspond to a
`hashed_account_id` provided in a previous `CreateAssessment` or `AnnotateAssessment` call.
Either hashed_account_id or account_id must be set, but not both.com.google.api.gax.rpc.ApiException - if the remote call failspublic final RecaptchaEnterpriseServiceClient.SearchRelatedAccountGroupMembershipsPagedResponse searchRelatedAccountGroupMemberships(SearchRelatedAccountGroupMembershipsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
SearchRelatedAccountGroupMembershipsRequest request =
SearchRelatedAccountGroupMembershipsRequest.newBuilder()
.setProject(
RelatedAccountGroupName.of("[PROJECT]", "[RELATEDACCOUNTGROUP]").toString())
.setAccountId("accountId-1827029976")
.setHashedAccountId(ByteString.EMPTY)
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (RelatedAccountGroupMembership element :
recaptchaEnterpriseServiceClient
.searchRelatedAccountGroupMemberships(request)
.iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<SearchRelatedAccountGroupMembershipsRequest,RecaptchaEnterpriseServiceClient.SearchRelatedAccountGroupMembershipsPagedResponse> searchRelatedAccountGroupMembershipsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
SearchRelatedAccountGroupMembershipsRequest request =
SearchRelatedAccountGroupMembershipsRequest.newBuilder()
.setProject(
RelatedAccountGroupName.of("[PROJECT]", "[RELATEDACCOUNTGROUP]").toString())
.setAccountId("accountId-1827029976")
.setHashedAccountId(ByteString.EMPTY)
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<RelatedAccountGroupMembership> future =
recaptchaEnterpriseServiceClient
.searchRelatedAccountGroupMembershipsPagedCallable()
.futureCall(request);
// Do something.
for (RelatedAccountGroupMembership element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<SearchRelatedAccountGroupMembershipsRequest,SearchRelatedAccountGroupMembershipsResponse> searchRelatedAccountGroupMembershipsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (RecaptchaEnterpriseServiceClient recaptchaEnterpriseServiceClient =
RecaptchaEnterpriseServiceClient.create()) {
SearchRelatedAccountGroupMembershipsRequest request =
SearchRelatedAccountGroupMembershipsRequest.newBuilder()
.setProject(
RelatedAccountGroupName.of("[PROJECT]", "[RELATEDACCOUNTGROUP]").toString())
.setAccountId("accountId-1827029976")
.setHashedAccountId(ByteString.EMPTY)
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
SearchRelatedAccountGroupMembershipsResponse response =
recaptchaEnterpriseServiceClient
.searchRelatedAccountGroupMembershipsCallable()
.call(request);
for (RelatedAccountGroupMembership element :
response.getRelatedAccountGroupMembershipsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2024 Google LLC. All rights reserved.