GitHub Repository | Product Reference |
Service Description: RuleService provides interface for user-created rules.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
Rule rule = Rule.newBuilder().build();
Rule response = ruleServiceClient.createRule(parent, rule);
}
Note: close() needs to be called on the RuleServiceClient 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 |
---|---|---|
CreateRule |
Creates a new Rule. |
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.
|
GetRule |
Gets a Rule. |
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.
|
ListRules |
Lists Rules. |
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.
|
UpdateRule |
Updates a Rule. |
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.
|
DeleteRule |
Deletes a Rule. |
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.
|
ListRuleRevisions |
Lists all revisions of the rule. |
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.
|
CreateRetrohunt |
Create a Retrohunt. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetRetrohunt |
Get a Retrohunt. |
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.
|
ListRetrohunts |
List Retrohunts. |
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.
|
GetRuleDeployment |
Gets a RuleDeployment. |
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.
|
ListRuleDeployments |
Lists RuleDeployments across all Rules. |
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.
|
UpdateRuleDeployment |
Updates a RuleDeployment. Failures are not necessarily atomic. If there is a request to update multiple fields, and any update to a single field fails, an error will be returned, but other fields may remain successfully updated. |
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 RuleServiceSettings 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
RuleServiceSettings ruleServiceSettings =
RuleServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
RuleServiceClient ruleServiceClient = RuleServiceClient.create(ruleServiceSettings);
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
RuleServiceSettings ruleServiceSettings =
RuleServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
RuleServiceClient ruleServiceClient = RuleServiceClient.create(ruleServiceSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// 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
RuleServiceSettings ruleServiceSettings = RuleServiceSettings.newHttpJsonBuilder().build();
RuleServiceClient ruleServiceClient = RuleServiceClient.create(ruleServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Static Methods
create()
public static final RuleServiceClient create()
Constructs an instance of RuleServiceClient with default settings.
Returns | |
---|---|
Type | Description |
RuleServiceClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(RuleServiceSettings settings)
public static final RuleServiceClient create(RuleServiceSettings settings)
Constructs an instance of RuleServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
Parameter | |
---|---|
Name | Description |
settings |
RuleServiceSettings |
Returns | |
---|---|
Type | Description |
RuleServiceClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(RuleServiceStub stub)
public static final RuleServiceClient create(RuleServiceStub stub)
Constructs an instance of RuleServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(RuleServiceSettings).
Parameter | |
---|---|
Name | Description |
stub |
RuleServiceStub |
Returns | |
---|---|
Type | Description |
RuleServiceClient |
Constructors
RuleServiceClient(RuleServiceSettings settings)
protected RuleServiceClient(RuleServiceSettings settings)
Constructs an instance of RuleServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
Parameter | |
---|---|
Name | Description |
settings |
RuleServiceSettings |
RuleServiceClient(RuleServiceStub stub)
protected RuleServiceClient(RuleServiceStub stub)
Parameter | |
---|---|
Name | Description |
stub |
RuleServiceStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Parameters | |
---|---|
Name | Description |
duration |
long |
unit |
TimeUnit |
Returns | |
---|---|
Type | Description |
boolean |
Exceptions | |
---|---|
Type | Description |
InterruptedException |
close()
public final void close()
createRetrohuntAsync(CreateRetrohuntRequest request)
public final OperationFuture<Retrohunt,RetrohuntMetadata> createRetrohuntAsync(CreateRetrohuntRequest request)
Create a Retrohunt.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
CreateRetrohuntRequest request =
CreateRetrohuntRequest.newBuilder()
.setParent(RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString())
.setRetrohunt(Retrohunt.newBuilder().build())
.build();
Retrohunt response = ruleServiceClient.createRetrohuntAsync(request).get();
}
Parameter | |
---|---|
Name | Description |
request |
CreateRetrohuntRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Retrohunt,RetrohuntMetadata> |
createRetrohuntAsync(RuleName parent, Retrohunt retrohunt)
public final OperationFuture<Retrohunt,RetrohuntMetadata> createRetrohuntAsync(RuleName parent, Retrohunt retrohunt)
Create a Retrohunt.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
RuleName parent = RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]");
Retrohunt retrohunt = Retrohunt.newBuilder().build();
Retrohunt response = ruleServiceClient.createRetrohuntAsync(parent, retrohunt).get();
}
Parameters | |
---|---|
Name | Description |
parent |
RuleName Required. The parent of retrohunt, which is a rule. Format:
|
retrohunt |
Retrohunt Required. The retrohunt to create. |
Returns | |
---|---|
Type | Description |
OperationFuture<Retrohunt,RetrohuntMetadata> |
createRetrohuntAsync(String parent, Retrohunt retrohunt)
public final OperationFuture<Retrohunt,RetrohuntMetadata> createRetrohuntAsync(String parent, Retrohunt retrohunt)
Create a Retrohunt.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
String parent = RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString();
Retrohunt retrohunt = Retrohunt.newBuilder().build();
Retrohunt response = ruleServiceClient.createRetrohuntAsync(parent, retrohunt).get();
}
Parameters | |
---|---|
Name | Description |
parent |
String Required. The parent of retrohunt, which is a rule. Format:
|
retrohunt |
Retrohunt Required. The retrohunt to create. |
Returns | |
---|---|
Type | Description |
OperationFuture<Retrohunt,RetrohuntMetadata> |
createRetrohuntCallable()
public final UnaryCallable<CreateRetrohuntRequest,Operation> createRetrohuntCallable()
Create a Retrohunt.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
CreateRetrohuntRequest request =
CreateRetrohuntRequest.newBuilder()
.setParent(RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString())
.setRetrohunt(Retrohunt.newBuilder().build())
.build();
ApiFuture<Operation> future = ruleServiceClient.createRetrohuntCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<CreateRetrohuntRequest,Operation> |
createRetrohuntOperationCallable()
public final OperationCallable<CreateRetrohuntRequest,Retrohunt,RetrohuntMetadata> createRetrohuntOperationCallable()
Create a Retrohunt.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
CreateRetrohuntRequest request =
CreateRetrohuntRequest.newBuilder()
.setParent(RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString())
.setRetrohunt(Retrohunt.newBuilder().build())
.build();
OperationFuture<Retrohunt, RetrohuntMetadata> future =
ruleServiceClient.createRetrohuntOperationCallable().futureCall(request);
// Do something.
Retrohunt response = future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<CreateRetrohuntRequest,Retrohunt,RetrohuntMetadata> |
createRule(CreateRuleRequest request)
public final Rule createRule(CreateRuleRequest request)
Creates a new Rule.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
CreateRuleRequest request =
CreateRuleRequest.newBuilder()
.setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
.setRule(Rule.newBuilder().build())
.build();
Rule response = ruleServiceClient.createRule(request);
}
Parameter | |
---|---|
Name | Description |
request |
CreateRuleRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
Rule |
createRule(InstanceName parent, Rule rule)
public final Rule createRule(InstanceName parent, Rule rule)
Creates a new Rule.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
Rule rule = Rule.newBuilder().build();
Rule response = ruleServiceClient.createRule(parent, rule);
}
Parameters | |
---|---|
Name | Description |
parent |
InstanceName Required. The parent resource where this rule will be created. Format:
|
rule |
Rule Required. The rule to create. |
Returns | |
---|---|
Type | Description |
Rule |
createRule(String parent, Rule rule)
public final Rule createRule(String parent, Rule rule)
Creates a new Rule.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
String parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
Rule rule = Rule.newBuilder().build();
Rule response = ruleServiceClient.createRule(parent, rule);
}
Parameters | |
---|---|
Name | Description |
parent |
String Required. The parent resource where this rule will be created. Format:
|
rule |
Rule Required. The rule to create. |
Returns | |
---|---|
Type | Description |
Rule |
createRuleCallable()
public final UnaryCallable<CreateRuleRequest,Rule> createRuleCallable()
Creates a new Rule.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
CreateRuleRequest request =
CreateRuleRequest.newBuilder()
.setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
.setRule(Rule.newBuilder().build())
.build();
ApiFuture<Rule> future = ruleServiceClient.createRuleCallable().futureCall(request);
// Do something.
Rule response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<CreateRuleRequest,Rule> |
deleteRule(DeleteRuleRequest request)
public final void deleteRule(DeleteRuleRequest request)
Deletes a Rule.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
DeleteRuleRequest request =
DeleteRuleRequest.newBuilder()
.setName(RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString())
.setForce(true)
.build();
ruleServiceClient.deleteRule(request);
}
Parameter | |
---|---|
Name | Description |
request |
DeleteRuleRequest The request object containing all of the parameters for the API call. |
deleteRule(RuleName name)
public final void deleteRule(RuleName name)
Deletes a Rule.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
RuleName name = RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]");
ruleServiceClient.deleteRule(name);
}
Parameter | |
---|---|
Name | Description |
name |
RuleName Required. The name of the rule to delete. A rule revision timestamp cannot be
specified as part of the name, as deleting specific revisions is not supported. Format:
|
deleteRule(String name)
public final void deleteRule(String name)
Deletes a Rule.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
String name = RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString();
ruleServiceClient.deleteRule(name);
}
Parameter | |
---|---|
Name | Description |
name |
String Required. The name of the rule to delete. A rule revision timestamp cannot be
specified as part of the name, as deleting specific revisions is not supported. Format:
|
deleteRuleCallable()
public final UnaryCallable<DeleteRuleRequest,Empty> deleteRuleCallable()
Deletes a Rule.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
DeleteRuleRequest request =
DeleteRuleRequest.newBuilder()
.setName(RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString())
.setForce(true)
.build();
ApiFuture<Empty> future = ruleServiceClient.deleteRuleCallable().futureCall(request);
// Do something.
future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<DeleteRuleRequest,Empty> |
getHttpJsonOperationsClient()
public final OperationsClient getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
Returns | |
---|---|
Type | Description |
OperationsClient |
getOperationsClient()
public final OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
Returns | |
---|---|
Type | Description |
OperationsClient |
getRetrohunt(GetRetrohuntRequest request)
public final Retrohunt getRetrohunt(GetRetrohuntRequest request)
Get a Retrohunt.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
GetRetrohuntRequest request =
GetRetrohuntRequest.newBuilder()
.setName(
RetrohuntName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]", "[RETROHUNT]")
.toString())
.build();
Retrohunt response = ruleServiceClient.getRetrohunt(request);
}
Parameter | |
---|---|
Name | Description |
request |
GetRetrohuntRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
Retrohunt |
getRetrohunt(RetrohuntName name)
public final Retrohunt getRetrohunt(RetrohuntName name)
Get a Retrohunt.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
RetrohuntName name =
RetrohuntName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]", "[RETROHUNT]");
Retrohunt response = ruleServiceClient.getRetrohunt(name);
}
Parameter | |
---|---|
Name | Description |
name |
RetrohuntName Required. The name of the retrohunt to retrieve. Format:
|
Returns | |
---|---|
Type | Description |
Retrohunt |
getRetrohunt(String name)
public final Retrohunt getRetrohunt(String name)
Get a Retrohunt.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
String name =
RetrohuntName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]", "[RETROHUNT]")
.toString();
Retrohunt response = ruleServiceClient.getRetrohunt(name);
}
Parameter | |
---|---|
Name | Description |
name |
String Required. The name of the retrohunt to retrieve. Format:
|
Returns | |
---|---|
Type | Description |
Retrohunt |
getRetrohuntCallable()
public final UnaryCallable<GetRetrohuntRequest,Retrohunt> getRetrohuntCallable()
Get a Retrohunt.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
GetRetrohuntRequest request =
GetRetrohuntRequest.newBuilder()
.setName(
RetrohuntName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]", "[RETROHUNT]")
.toString())
.build();
ApiFuture<Retrohunt> future = ruleServiceClient.getRetrohuntCallable().futureCall(request);
// Do something.
Retrohunt response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetRetrohuntRequest,Retrohunt> |
getRule(GetRuleRequest request)
public final Rule getRule(GetRuleRequest request)
Gets a Rule.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
GetRuleRequest request =
GetRuleRequest.newBuilder()
.setName(RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString())
.setView(RuleView.forNumber(0))
.build();
Rule response = ruleServiceClient.getRule(request);
}
Parameter | |
---|---|
Name | Description |
request |
GetRuleRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
Rule |
getRule(RuleName name)
public final Rule getRule(RuleName name)
Gets a Rule.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
RuleName name = RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]");
Rule response = ruleServiceClient.getRule(name);
}
Parameter | |
---|---|
Name | Description |
name |
RuleName Required. The name of the rule to retrieve. Format:
|
Returns | |
---|---|
Type | Description |
Rule |
getRule(String name)
public final Rule getRule(String name)
Gets a Rule.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
String name = RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString();
Rule response = ruleServiceClient.getRule(name);
}
Parameter | |
---|---|
Name | Description |
name |
String Required. The name of the rule to retrieve. Format:
|
Returns | |
---|---|
Type | Description |
Rule |
getRuleCallable()
public final UnaryCallable<GetRuleRequest,Rule> getRuleCallable()
Gets a Rule.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
GetRuleRequest request =
GetRuleRequest.newBuilder()
.setName(RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString())
.setView(RuleView.forNumber(0))
.build();
ApiFuture<Rule> future = ruleServiceClient.getRuleCallable().futureCall(request);
// Do something.
Rule response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetRuleRequest,Rule> |
getRuleDeployment(GetRuleDeploymentRequest request)
public final RuleDeployment getRuleDeployment(GetRuleDeploymentRequest request)
Gets a RuleDeployment.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
GetRuleDeploymentRequest request =
GetRuleDeploymentRequest.newBuilder()
.setName(
RuleDeploymentName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]")
.toString())
.build();
RuleDeployment response = ruleServiceClient.getRuleDeployment(request);
}
Parameter | |
---|---|
Name | Description |
request |
GetRuleDeploymentRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
RuleDeployment |
getRuleDeployment(RuleDeploymentName name)
public final RuleDeployment getRuleDeployment(RuleDeploymentName name)
Gets a RuleDeployment.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
RuleDeploymentName name =
RuleDeploymentName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]");
RuleDeployment response = ruleServiceClient.getRuleDeployment(name);
}
Parameter | |
---|---|
Name | Description |
name |
RuleDeploymentName Required. The name of the rule deployment to retrieve. Format:
|
Returns | |
---|---|
Type | Description |
RuleDeployment |
getRuleDeployment(String name)
public final RuleDeployment getRuleDeployment(String name)
Gets a RuleDeployment.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
String name =
RuleDeploymentName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString();
RuleDeployment response = ruleServiceClient.getRuleDeployment(name);
}
Parameter | |
---|---|
Name | Description |
name |
String Required. The name of the rule deployment to retrieve. Format:
|
Returns | |
---|---|
Type | Description |
RuleDeployment |
getRuleDeploymentCallable()
public final UnaryCallable<GetRuleDeploymentRequest,RuleDeployment> getRuleDeploymentCallable()
Gets a RuleDeployment.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
GetRuleDeploymentRequest request =
GetRuleDeploymentRequest.newBuilder()
.setName(
RuleDeploymentName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]")
.toString())
.build();
ApiFuture<RuleDeployment> future =
ruleServiceClient.getRuleDeploymentCallable().futureCall(request);
// Do something.
RuleDeployment response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetRuleDeploymentRequest,RuleDeployment> |
getSettings()
public final RuleServiceSettings getSettings()
Returns | |
---|---|
Type | Description |
RuleServiceSettings |
getStub()
public RuleServiceStub getStub()
Returns | |
---|---|
Type | Description |
RuleServiceStub |
isShutdown()
public boolean isShutdown()
Returns | |
---|---|
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Returns | |
---|---|
Type | Description |
boolean |
listRetrohunts(ListRetrohuntsRequest request)
public final RuleServiceClient.ListRetrohuntsPagedResponse listRetrohunts(ListRetrohuntsRequest request)
List Retrohunts.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
ListRetrohuntsRequest request =
ListRetrohuntsRequest.newBuilder()
.setParent(RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
for (Retrohunt element : ruleServiceClient.listRetrohunts(request).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
request |
ListRetrohuntsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
RuleServiceClient.ListRetrohuntsPagedResponse |
listRetrohunts(RuleName parent)
public final RuleServiceClient.ListRetrohuntsPagedResponse listRetrohunts(RuleName parent)
List Retrohunts.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
RuleName parent = RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]");
for (Retrohunt element : ruleServiceClient.listRetrohunts(parent).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
parent |
RuleName Required. The rule that the retrohunts belong to. Format:
|
Returns | |
---|---|
Type | Description |
RuleServiceClient.ListRetrohuntsPagedResponse |
listRetrohunts(String parent)
public final RuleServiceClient.ListRetrohuntsPagedResponse listRetrohunts(String parent)
List Retrohunts.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
String parent = RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString();
for (Retrohunt element : ruleServiceClient.listRetrohunts(parent).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
parent |
String Required. The rule that the retrohunts belong to. Format:
|
Returns | |
---|---|
Type | Description |
RuleServiceClient.ListRetrohuntsPagedResponse |
listRetrohuntsCallable()
public final UnaryCallable<ListRetrohuntsRequest,ListRetrohuntsResponse> listRetrohuntsCallable()
List Retrohunts.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
ListRetrohuntsRequest request =
ListRetrohuntsRequest.newBuilder()
.setParent(RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
while (true) {
ListRetrohuntsResponse response = ruleServiceClient.listRetrohuntsCallable().call(request);
for (Retrohunt element : response.getRetrohuntsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListRetrohuntsRequest,ListRetrohuntsResponse> |
listRetrohuntsPagedCallable()
public final UnaryCallable<ListRetrohuntsRequest,RuleServiceClient.ListRetrohuntsPagedResponse> listRetrohuntsPagedCallable()
List Retrohunts.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
ListRetrohuntsRequest request =
ListRetrohuntsRequest.newBuilder()
.setParent(RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
ApiFuture<Retrohunt> future =
ruleServiceClient.listRetrohuntsPagedCallable().futureCall(request);
// Do something.
for (Retrohunt element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListRetrohuntsRequest,ListRetrohuntsPagedResponse> |
listRuleDeployments(ListRuleDeploymentsRequest request)
public final RuleServiceClient.ListRuleDeploymentsPagedResponse listRuleDeployments(ListRuleDeploymentsRequest request)
Lists RuleDeployments across all Rules.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
ListRuleDeploymentsRequest request =
ListRuleDeploymentsRequest.newBuilder()
.setParent(RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
for (RuleDeployment element : ruleServiceClient.listRuleDeployments(request).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
request |
ListRuleDeploymentsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
RuleServiceClient.ListRuleDeploymentsPagedResponse |
listRuleDeployments(RuleName parent)
public final RuleServiceClient.ListRuleDeploymentsPagedResponse listRuleDeployments(RuleName parent)
Lists RuleDeployments across all Rules.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
RuleName parent = RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]");
for (RuleDeployment element : ruleServiceClient.listRuleDeployments(parent).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
parent |
RuleName Required. The collection of all parents which own all rule deployments. The "-"
wildcard token must be used as the rule identifier in the resource path. Format:
|
Returns | |
---|---|
Type | Description |
RuleServiceClient.ListRuleDeploymentsPagedResponse |
listRuleDeployments(String parent)
public final RuleServiceClient.ListRuleDeploymentsPagedResponse listRuleDeployments(String parent)
Lists RuleDeployments across all Rules.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
String parent = RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString();
for (RuleDeployment element : ruleServiceClient.listRuleDeployments(parent).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
parent |
String Required. The collection of all parents which own all rule deployments. The "-"
wildcard token must be used as the rule identifier in the resource path. Format:
|
Returns | |
---|---|
Type | Description |
RuleServiceClient.ListRuleDeploymentsPagedResponse |
listRuleDeploymentsCallable()
public final UnaryCallable<ListRuleDeploymentsRequest,ListRuleDeploymentsResponse> listRuleDeploymentsCallable()
Lists RuleDeployments across all Rules.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
ListRuleDeploymentsRequest request =
ListRuleDeploymentsRequest.newBuilder()
.setParent(RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
while (true) {
ListRuleDeploymentsResponse response =
ruleServiceClient.listRuleDeploymentsCallable().call(request);
for (RuleDeployment element : response.getRuleDeploymentsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListRuleDeploymentsRequest,ListRuleDeploymentsResponse> |
listRuleDeploymentsPagedCallable()
public final UnaryCallable<ListRuleDeploymentsRequest,RuleServiceClient.ListRuleDeploymentsPagedResponse> listRuleDeploymentsPagedCallable()
Lists RuleDeployments across all Rules.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
ListRuleDeploymentsRequest request =
ListRuleDeploymentsRequest.newBuilder()
.setParent(RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setFilter("filter-1274492040")
.build();
ApiFuture<RuleDeployment> future =
ruleServiceClient.listRuleDeploymentsPagedCallable().futureCall(request);
// Do something.
for (RuleDeployment element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListRuleDeploymentsRequest,ListRuleDeploymentsPagedResponse> |
listRuleRevisions(ListRuleRevisionsRequest request)
public final RuleServiceClient.ListRuleRevisionsPagedResponse listRuleRevisions(ListRuleRevisionsRequest request)
Lists all revisions of the rule.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
ListRuleRevisionsRequest request =
ListRuleRevisionsRequest.newBuilder()
.setName(RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setView(RuleView.forNumber(0))
.build();
for (Rule element : ruleServiceClient.listRuleRevisions(request).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
request |
ListRuleRevisionsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
RuleServiceClient.ListRuleRevisionsPagedResponse |
listRuleRevisions(RuleName name)
public final RuleServiceClient.ListRuleRevisionsPagedResponse listRuleRevisions(RuleName name)
Lists all revisions of the rule.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
RuleName name = RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]");
for (Rule element : ruleServiceClient.listRuleRevisions(name).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
name |
RuleName Required. The name of the rule to list revisions for. Format:
|
Returns | |
---|---|
Type | Description |
RuleServiceClient.ListRuleRevisionsPagedResponse |
listRuleRevisions(String name)
public final RuleServiceClient.ListRuleRevisionsPagedResponse listRuleRevisions(String name)
Lists all revisions of the rule.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
String name = RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString();
for (Rule element : ruleServiceClient.listRuleRevisions(name).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
name |
String Required. The name of the rule to list revisions for. Format:
|
Returns | |
---|---|
Type | Description |
RuleServiceClient.ListRuleRevisionsPagedResponse |
listRuleRevisionsCallable()
public final UnaryCallable<ListRuleRevisionsRequest,ListRuleRevisionsResponse> listRuleRevisionsCallable()
Lists all revisions of the rule.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
ListRuleRevisionsRequest request =
ListRuleRevisionsRequest.newBuilder()
.setName(RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setView(RuleView.forNumber(0))
.build();
while (true) {
ListRuleRevisionsResponse response =
ruleServiceClient.listRuleRevisionsCallable().call(request);
for (Rule element : response.getRulesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListRuleRevisionsRequest,ListRuleRevisionsResponse> |
listRuleRevisionsPagedCallable()
public final UnaryCallable<ListRuleRevisionsRequest,RuleServiceClient.ListRuleRevisionsPagedResponse> listRuleRevisionsPagedCallable()
Lists all revisions of the rule.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
ListRuleRevisionsRequest request =
ListRuleRevisionsRequest.newBuilder()
.setName(RuleName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]", "[RULE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setView(RuleView.forNumber(0))
.build();
ApiFuture<Rule> future =
ruleServiceClient.listRuleRevisionsPagedCallable().futureCall(request);
// Do something.
for (Rule element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListRuleRevisionsRequest,ListRuleRevisionsPagedResponse> |
listRules(InstanceName parent)
public final RuleServiceClient.ListRulesPagedResponse listRules(InstanceName parent)
Lists Rules.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
InstanceName parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
for (Rule element : ruleServiceClient.listRules(parent).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
parent |
InstanceName Required. The parent, which owns this collection of rules. Format:
|
Returns | |
---|---|
Type | Description |
RuleServiceClient.ListRulesPagedResponse |
listRules(ListRulesRequest request)
public final RuleServiceClient.ListRulesPagedResponse listRules(ListRulesRequest request)
Lists Rules.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
ListRulesRequest request =
ListRulesRequest.newBuilder()
.setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setView(RuleView.forNumber(0))
.setFilter("filter-1274492040")
.build();
for (Rule element : ruleServiceClient.listRules(request).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
request |
ListRulesRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
RuleServiceClient.ListRulesPagedResponse |
listRules(String parent)
public final RuleServiceClient.ListRulesPagedResponse listRules(String parent)
Lists Rules.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
String parent = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
for (Rule element : ruleServiceClient.listRules(parent).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
parent |
String Required. The parent, which owns this collection of rules. Format:
|
Returns | |
---|---|
Type | Description |
RuleServiceClient.ListRulesPagedResponse |
listRulesCallable()
public final UnaryCallable<ListRulesRequest,ListRulesResponse> listRulesCallable()
Lists Rules.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
ListRulesRequest request =
ListRulesRequest.newBuilder()
.setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setView(RuleView.forNumber(0))
.setFilter("filter-1274492040")
.build();
while (true) {
ListRulesResponse response = ruleServiceClient.listRulesCallable().call(request);
for (Rule element : response.getRulesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListRulesRequest,ListRulesResponse> |
listRulesPagedCallable()
public final UnaryCallable<ListRulesRequest,RuleServiceClient.ListRulesPagedResponse> listRulesPagedCallable()
Lists Rules.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
ListRulesRequest request =
ListRulesRequest.newBuilder()
.setParent(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.setView(RuleView.forNumber(0))
.setFilter("filter-1274492040")
.build();
ApiFuture<Rule> future = ruleServiceClient.listRulesPagedCallable().futureCall(request);
// Do something.
for (Rule element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListRulesRequest,ListRulesPagedResponse> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()
updateRule(Rule rule, FieldMask updateMask)
public final Rule updateRule(Rule rule, FieldMask updateMask)
Updates a Rule.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
Rule rule = Rule.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Rule response = ruleServiceClient.updateRule(rule, updateMask);
}
Parameters | |
---|---|
Name | Description |
rule |
Rule Required. The rule to update. The rule's |
updateMask |
FieldMask The list of fields to update. If not included, all fields with a non-empty value will be overwritten. |
Returns | |
---|---|
Type | Description |
Rule |
updateRule(UpdateRuleRequest request)
public final Rule updateRule(UpdateRuleRequest request)
Updates a Rule.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
UpdateRuleRequest request =
UpdateRuleRequest.newBuilder()
.setRule(Rule.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Rule response = ruleServiceClient.updateRule(request);
}
Parameter | |
---|---|
Name | Description |
request |
UpdateRuleRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
Rule |
updateRuleCallable()
public final UnaryCallable<UpdateRuleRequest,Rule> updateRuleCallable()
Updates a Rule.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
UpdateRuleRequest request =
UpdateRuleRequest.newBuilder()
.setRule(Rule.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Rule> future = ruleServiceClient.updateRuleCallable().futureCall(request);
// Do something.
Rule response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<UpdateRuleRequest,Rule> |
updateRuleDeployment(RuleDeployment ruleDeployment, FieldMask updateMask)
public final RuleDeployment updateRuleDeployment(RuleDeployment ruleDeployment, FieldMask updateMask)
Updates a RuleDeployment. Failures are not necessarily atomic. If there is a request to update multiple fields, and any update to a single field fails, an error will be returned, but other fields may remain successfully updated.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
RuleDeployment ruleDeployment = RuleDeployment.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
RuleDeployment response = ruleServiceClient.updateRuleDeployment(ruleDeployment, updateMask);
}
Parameters | |
---|---|
Name | Description |
ruleDeployment |
RuleDeployment Required. The rule deployment to update. The rule deployment's |
updateMask |
FieldMask Required. The list of fields to update. |
Returns | |
---|---|
Type | Description |
RuleDeployment |
updateRuleDeployment(UpdateRuleDeploymentRequest request)
public final RuleDeployment updateRuleDeployment(UpdateRuleDeploymentRequest request)
Updates a RuleDeployment. Failures are not necessarily atomic. If there is a request to update multiple fields, and any update to a single field fails, an error will be returned, but other fields may remain successfully updated.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
UpdateRuleDeploymentRequest request =
UpdateRuleDeploymentRequest.newBuilder()
.setRuleDeployment(RuleDeployment.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
RuleDeployment response = ruleServiceClient.updateRuleDeployment(request);
}
Parameter | |
---|---|
Name | Description |
request |
UpdateRuleDeploymentRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
RuleDeployment |
updateRuleDeploymentCallable()
public final UnaryCallable<UpdateRuleDeploymentRequest,RuleDeployment> updateRuleDeploymentCallable()
Updates a RuleDeployment. Failures are not necessarily atomic. If there is a request to update multiple fields, and any update to a single field fails, an error will be returned, but other fields may remain successfully updated.
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 (RuleServiceClient ruleServiceClient = RuleServiceClient.create()) {
UpdateRuleDeploymentRequest request =
UpdateRuleDeploymentRequest.newBuilder()
.setRuleDeployment(RuleDeployment.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<RuleDeployment> future =
ruleServiceClient.updateRuleDeploymentCallable().futureCall(request);
// Do something.
RuleDeployment response = future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<UpdateRuleDeploymentRequest,RuleDeployment> |