@BetaApi @Generated(value="by gapic-generator-java") public class PlaybooksClient 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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
Playbook playbook = Playbook.newBuilder().build();
Playbook response = playbooksClient.createPlaybook(parent, playbook);
}
Note: close() needs to be called on the PlaybooksClient 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 |
|---|---|---|
CreatePlaybook |
Creates a playbook in a specified agent. |
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.
|
DeletePlaybook |
Deletes a specified playbook. |
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.
|
ListPlaybooks |
Returns a list of playbooks in the specified agent. |
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.
|
GetPlaybook |
Retrieves the specified Playbook. |
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.
|
UpdatePlaybook |
Updates the specified Playbook. |
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.
|
CreatePlaybookVersion |
Creates a version for the specified Playbook. |
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.
|
GetPlaybookVersion |
Retrieves the specified version of the Playbook. |
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.
|
ListPlaybookVersions |
Lists versions for the specified Playbook. |
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.
|
DeletePlaybookVersion |
Deletes the specified version of the Playbook. |
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.
|
ListLocations |
Lists information about the supported locations for this service. |
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.
|
GetLocation |
Gets information about a location. |
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.
|
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 PlaybooksSettings 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
PlaybooksSettings playbooksSettings =
PlaybooksSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
PlaybooksClient playbooksClient = PlaybooksClient.create(playbooksSettings);
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
PlaybooksSettings playbooksSettings =
PlaybooksSettings.newBuilder().setEndpoint(myEndpoint).build();
PlaybooksClient playbooksClient = PlaybooksClient.create(playbooksSettings);
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
PlaybooksSettings playbooksSettings = PlaybooksSettings.newHttpJsonBuilder().build();
PlaybooksClient playbooksClient = PlaybooksClient.create(playbooksSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
PlaybooksClient.ListLocationsFixedSizeCollection |
static class |
PlaybooksClient.ListLocationsPage |
static class |
PlaybooksClient.ListLocationsPagedResponse |
static class |
PlaybooksClient.ListPlaybooksFixedSizeCollection |
static class |
PlaybooksClient.ListPlaybooksPage |
static class |
PlaybooksClient.ListPlaybooksPagedResponse |
static class |
PlaybooksClient.ListPlaybookVersionsFixedSizeCollection |
static class |
PlaybooksClient.ListPlaybookVersionsPage |
static class |
PlaybooksClient.ListPlaybookVersionsPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
PlaybooksClient(PlaybooksSettings settings)
Constructs an instance of PlaybooksClient, using the given settings.
|
protected |
PlaybooksClient(PlaybooksStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static PlaybooksClient |
create()
Constructs an instance of PlaybooksClient with default settings.
|
static PlaybooksClient |
create(PlaybooksSettings settings)
Constructs an instance of PlaybooksClient, using the given settings.
|
static PlaybooksClient |
create(PlaybooksStub stub)
Constructs an instance of PlaybooksClient, using the given stub for making calls.
|
Playbook |
createPlaybook(AgentName parent,
Playbook playbook)
Creates a playbook in a specified agent.
|
Playbook |
createPlaybook(CreatePlaybookRequest request)
Creates a playbook in a specified agent.
|
Playbook |
createPlaybook(String parent,
Playbook playbook)
Creates a playbook in a specified agent.
|
com.google.api.gax.rpc.UnaryCallable<CreatePlaybookRequest,Playbook> |
createPlaybookCallable()
Creates a playbook in a specified agent.
|
PlaybookVersion |
createPlaybookVersion(CreatePlaybookVersionRequest request)
Creates a version for the specified Playbook.
|
PlaybookVersion |
createPlaybookVersion(PlaybookName parent,
PlaybookVersion playbookVersion)
Creates a version for the specified Playbook.
|
PlaybookVersion |
createPlaybookVersion(String parent,
PlaybookVersion playbookVersion)
Creates a version for the specified Playbook.
|
com.google.api.gax.rpc.UnaryCallable<CreatePlaybookVersionRequest,PlaybookVersion> |
createPlaybookVersionCallable()
Creates a version for the specified Playbook.
|
void |
deletePlaybook(DeletePlaybookRequest request)
Deletes a specified playbook.
|
void |
deletePlaybook(PlaybookName name)
Deletes a specified playbook.
|
void |
deletePlaybook(String name)
Deletes a specified playbook.
|
com.google.api.gax.rpc.UnaryCallable<DeletePlaybookRequest,com.google.protobuf.Empty> |
deletePlaybookCallable()
Deletes a specified playbook.
|
void |
deletePlaybookVersion(DeletePlaybookVersionRequest request)
Deletes the specified version of the Playbook.
|
void |
deletePlaybookVersion(PlaybookVersionName name)
Deletes the specified version of the Playbook.
|
void |
deletePlaybookVersion(String name)
Deletes the specified version of the Playbook.
|
com.google.api.gax.rpc.UnaryCallable<DeletePlaybookVersionRequest,com.google.protobuf.Empty> |
deletePlaybookVersionCallable()
Deletes the specified version of the Playbook.
|
com.google.cloud.location.Location |
getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
getLocationCallable()
Gets information about a location.
|
Playbook |
getPlaybook(GetPlaybookRequest request)
Retrieves the specified Playbook.
|
Playbook |
getPlaybook(PlaybookName name)
Retrieves the specified Playbook.
|
Playbook |
getPlaybook(String name)
Retrieves the specified Playbook.
|
com.google.api.gax.rpc.UnaryCallable<GetPlaybookRequest,Playbook> |
getPlaybookCallable()
Retrieves the specified Playbook.
|
PlaybookVersion |
getPlaybookVersion(GetPlaybookVersionRequest request)
Retrieves the specified version of the Playbook.
|
PlaybookVersion |
getPlaybookVersion(PlaybookVersionName name)
Retrieves the specified version of the Playbook.
|
PlaybookVersion |
getPlaybookVersion(String name)
Retrieves the specified version of the Playbook.
|
com.google.api.gax.rpc.UnaryCallable<GetPlaybookVersionRequest,PlaybookVersion> |
getPlaybookVersionCallable()
Retrieves the specified version of the Playbook.
|
PlaybooksSettings |
getSettings() |
PlaybooksStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
PlaybooksClient.ListLocationsPagedResponse |
listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
listLocationsCallable()
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,PlaybooksClient.ListLocationsPagedResponse> |
listLocationsPagedCallable()
Lists information about the supported locations for this service.
|
PlaybooksClient.ListPlaybooksPagedResponse |
listPlaybooks(AgentName parent)
Returns a list of playbooks in the specified agent.
|
PlaybooksClient.ListPlaybooksPagedResponse |
listPlaybooks(ListPlaybooksRequest request)
Returns a list of playbooks in the specified agent.
|
PlaybooksClient.ListPlaybooksPagedResponse |
listPlaybooks(String parent)
Returns a list of playbooks in the specified agent.
|
com.google.api.gax.rpc.UnaryCallable<ListPlaybooksRequest,ListPlaybooksResponse> |
listPlaybooksCallable()
Returns a list of playbooks in the specified agent.
|
com.google.api.gax.rpc.UnaryCallable<ListPlaybooksRequest,PlaybooksClient.ListPlaybooksPagedResponse> |
listPlaybooksPagedCallable()
Returns a list of playbooks in the specified agent.
|
PlaybooksClient.ListPlaybookVersionsPagedResponse |
listPlaybookVersions(ListPlaybookVersionsRequest request)
Lists versions for the specified Playbook.
|
PlaybooksClient.ListPlaybookVersionsPagedResponse |
listPlaybookVersions(PlaybookName parent)
Lists versions for the specified Playbook.
|
PlaybooksClient.ListPlaybookVersionsPagedResponse |
listPlaybookVersions(String parent)
Lists versions for the specified Playbook.
|
com.google.api.gax.rpc.UnaryCallable<ListPlaybookVersionsRequest,ListPlaybookVersionsResponse> |
listPlaybookVersionsCallable()
Lists versions for the specified Playbook.
|
com.google.api.gax.rpc.UnaryCallable<ListPlaybookVersionsRequest,PlaybooksClient.ListPlaybookVersionsPagedResponse> |
listPlaybookVersionsPagedCallable()
Lists versions for the specified Playbook.
|
void |
shutdown() |
void |
shutdownNow() |
Playbook |
updatePlaybook(Playbook playbook,
com.google.protobuf.FieldMask updateMask)
Updates the specified Playbook.
|
Playbook |
updatePlaybook(UpdatePlaybookRequest request)
Updates the specified Playbook.
|
com.google.api.gax.rpc.UnaryCallable<UpdatePlaybookRequest,Playbook> |
updatePlaybookCallable()
Updates the specified Playbook.
|
protected PlaybooksClient(PlaybooksSettings settings) throws IOException
IOExceptionprotected PlaybooksClient(PlaybooksStub stub)
public static final PlaybooksClient create() throws IOException
IOExceptionpublic static final PlaybooksClient create(PlaybooksSettings settings) throws IOException
IOExceptionpublic static final PlaybooksClient create(PlaybooksStub stub)
public final PlaybooksSettings getSettings()
public PlaybooksStub getStub()
public final Playbook createPlaybook(AgentName parent, Playbook playbook)
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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
Playbook playbook = Playbook.newBuilder().build();
Playbook response = playbooksClient.createPlaybook(parent, playbook);
}
parent - Required. The agent to create a playbook for. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.playbook - Required. The playbook to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Playbook createPlaybook(String parent, Playbook playbook)
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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString();
Playbook playbook = Playbook.newBuilder().build();
Playbook response = playbooksClient.createPlaybook(parent, playbook);
}
parent - Required. The agent to create a playbook for. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.playbook - Required. The playbook to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Playbook createPlaybook(CreatePlaybookRequest 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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
CreatePlaybookRequest request =
CreatePlaybookRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setPlaybook(Playbook.newBuilder().build())
.build();
Playbook response = playbooksClient.createPlaybook(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<CreatePlaybookRequest,Playbook> createPlaybookCallable()
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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
CreatePlaybookRequest request =
CreatePlaybookRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setPlaybook(Playbook.newBuilder().build())
.build();
ApiFuture<Playbook> future = playbooksClient.createPlaybookCallable().futureCall(request);
// Do something.
Playbook response = future.get();
}
public final void deletePlaybook(PlaybookName 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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
PlaybookName name = PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]");
playbooksClient.deletePlaybook(name);
}
name - Required. The name of the playbook to delete. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deletePlaybook(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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
String name = PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString();
playbooksClient.deletePlaybook(name);
}
name - Required. The name of the playbook to delete. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deletePlaybook(DeletePlaybookRequest 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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
DeletePlaybookRequest request =
DeletePlaybookRequest.newBuilder()
.setName(
PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
.build();
playbooksClient.deletePlaybook(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<DeletePlaybookRequest,com.google.protobuf.Empty> deletePlaybookCallable()
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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
DeletePlaybookRequest request =
DeletePlaybookRequest.newBuilder()
.setName(
PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
.build();
ApiFuture<Empty> future = playbooksClient.deletePlaybookCallable().futureCall(request);
// Do something.
future.get();
}
public final PlaybooksClient.ListPlaybooksPagedResponse listPlaybooks(AgentName 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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
for (Playbook element : playbooksClient.listPlaybooks(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The agent to list playbooks from. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final PlaybooksClient.ListPlaybooksPagedResponse listPlaybooks(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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString();
for (Playbook element : playbooksClient.listPlaybooks(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The agent to list playbooks from. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final PlaybooksClient.ListPlaybooksPagedResponse listPlaybooks(ListPlaybooksRequest 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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
ListPlaybooksRequest request =
ListPlaybooksRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Playbook element : playbooksClient.listPlaybooks(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<ListPlaybooksRequest,PlaybooksClient.ListPlaybooksPagedResponse> listPlaybooksPagedCallable()
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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
ListPlaybooksRequest request =
ListPlaybooksRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Playbook> future = playbooksClient.listPlaybooksPagedCallable().futureCall(request);
// Do something.
for (Playbook element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListPlaybooksRequest,ListPlaybooksResponse> listPlaybooksCallable()
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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
ListPlaybooksRequest request =
ListPlaybooksRequest.newBuilder()
.setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListPlaybooksResponse response = playbooksClient.listPlaybooksCallable().call(request);
for (Playbook element : response.getPlaybooksList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final Playbook getPlaybook(PlaybookName 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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
PlaybookName name = PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]");
Playbook response = playbooksClient.getPlaybook(name);
}
name - Required. The name of the playbook. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Playbook getPlaybook(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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
String name = PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString();
Playbook response = playbooksClient.getPlaybook(name);
}
name - Required. The name of the playbook. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final Playbook getPlaybook(GetPlaybookRequest 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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
GetPlaybookRequest request =
GetPlaybookRequest.newBuilder()
.setName(
PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
.build();
Playbook response = playbooksClient.getPlaybook(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<GetPlaybookRequest,Playbook> getPlaybookCallable()
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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
GetPlaybookRequest request =
GetPlaybookRequest.newBuilder()
.setName(
PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
.build();
ApiFuture<Playbook> future = playbooksClient.getPlaybookCallable().futureCall(request);
// Do something.
Playbook response = future.get();
}
public final Playbook updatePlaybook(Playbook playbook, 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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
Playbook playbook = Playbook.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Playbook response = playbooksClient.updatePlaybook(playbook, updateMask);
}
playbook - Required. The playbook to update.updateMask - The mask to control which fields 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 Playbook updatePlaybook(UpdatePlaybookRequest 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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
UpdatePlaybookRequest request =
UpdatePlaybookRequest.newBuilder()
.setPlaybook(Playbook.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Playbook response = playbooksClient.updatePlaybook(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<UpdatePlaybookRequest,Playbook> updatePlaybookCallable()
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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
UpdatePlaybookRequest request =
UpdatePlaybookRequest.newBuilder()
.setPlaybook(Playbook.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Playbook> future = playbooksClient.updatePlaybookCallable().futureCall(request);
// Do something.
Playbook response = future.get();
}
public final PlaybookVersion createPlaybookVersion(PlaybookName parent, PlaybookVersion playbookVersion)
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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
PlaybookName parent = PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]");
PlaybookVersion playbookVersion = PlaybookVersion.newBuilder().build();
PlaybookVersion response = playbooksClient.createPlaybookVersion(parent, playbookVersion);
}
parent - Required. The playbook to create a version for. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>`.playbookVersion - Required. The playbook version to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final PlaybookVersion createPlaybookVersion(String parent, PlaybookVersion playbookVersion)
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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
String parent =
PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString();
PlaybookVersion playbookVersion = PlaybookVersion.newBuilder().build();
PlaybookVersion response = playbooksClient.createPlaybookVersion(parent, playbookVersion);
}
parent - Required. The playbook to create a version for. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>`.playbookVersion - Required. The playbook version to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final PlaybookVersion createPlaybookVersion(CreatePlaybookVersionRequest 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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
CreatePlaybookVersionRequest request =
CreatePlaybookVersionRequest.newBuilder()
.setParent(
PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
.setPlaybookVersion(PlaybookVersion.newBuilder().build())
.build();
PlaybookVersion response = playbooksClient.createPlaybookVersion(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<CreatePlaybookVersionRequest,PlaybookVersion> createPlaybookVersionCallable()
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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
CreatePlaybookVersionRequest request =
CreatePlaybookVersionRequest.newBuilder()
.setParent(
PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
.setPlaybookVersion(PlaybookVersion.newBuilder().build())
.build();
ApiFuture<PlaybookVersion> future =
playbooksClient.createPlaybookVersionCallable().futureCall(request);
// Do something.
PlaybookVersion response = future.get();
}
public final PlaybookVersion getPlaybookVersion(PlaybookVersionName 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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
PlaybookVersionName name =
PlaybookVersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]");
PlaybookVersion response = playbooksClient.getPlaybookVersion(name);
}
name - Required. The name of the playbook version. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>/versions/<VersionID>`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final PlaybookVersion getPlaybookVersion(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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
String name =
PlaybookVersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]")
.toString();
PlaybookVersion response = playbooksClient.getPlaybookVersion(name);
}
name - Required. The name of the playbook version. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>/versions/<VersionID>`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final PlaybookVersion getPlaybookVersion(GetPlaybookVersionRequest 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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
GetPlaybookVersionRequest request =
GetPlaybookVersionRequest.newBuilder()
.setName(
PlaybookVersionName.of(
"[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]")
.toString())
.build();
PlaybookVersion response = playbooksClient.getPlaybookVersion(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<GetPlaybookVersionRequest,PlaybookVersion> getPlaybookVersionCallable()
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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
GetPlaybookVersionRequest request =
GetPlaybookVersionRequest.newBuilder()
.setName(
PlaybookVersionName.of(
"[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]")
.toString())
.build();
ApiFuture<PlaybookVersion> future =
playbooksClient.getPlaybookVersionCallable().futureCall(request);
// Do something.
PlaybookVersion response = future.get();
}
public final PlaybooksClient.ListPlaybookVersionsPagedResponse listPlaybookVersions(PlaybookName 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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
PlaybookName parent = PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]");
for (PlaybookVersion element : playbooksClient.listPlaybookVersions(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The playbook to list versions for. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final PlaybooksClient.ListPlaybookVersionsPagedResponse listPlaybookVersions(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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
String parent =
PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString();
for (PlaybookVersion element : playbooksClient.listPlaybookVersions(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The playbook to list versions for. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final PlaybooksClient.ListPlaybookVersionsPagedResponse listPlaybookVersions(ListPlaybookVersionsRequest 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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
ListPlaybookVersionsRequest request =
ListPlaybookVersionsRequest.newBuilder()
.setParent(
PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (PlaybookVersion element : playbooksClient.listPlaybookVersions(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<ListPlaybookVersionsRequest,PlaybooksClient.ListPlaybookVersionsPagedResponse> listPlaybookVersionsPagedCallable()
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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
ListPlaybookVersionsRequest request =
ListPlaybookVersionsRequest.newBuilder()
.setParent(
PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<PlaybookVersion> future =
playbooksClient.listPlaybookVersionsPagedCallable().futureCall(request);
// Do something.
for (PlaybookVersion element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListPlaybookVersionsRequest,ListPlaybookVersionsResponse> listPlaybookVersionsCallable()
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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
ListPlaybookVersionsRequest request =
ListPlaybookVersionsRequest.newBuilder()
.setParent(
PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListPlaybookVersionsResponse response =
playbooksClient.listPlaybookVersionsCallable().call(request);
for (PlaybookVersion element : response.getPlaybookVersionsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final void deletePlaybookVersion(PlaybookVersionName 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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
PlaybookVersionName name =
PlaybookVersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]");
playbooksClient.deletePlaybookVersion(name);
}
name - Required. The name of the playbook version to delete. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>/versions/<VersionID>`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deletePlaybookVersion(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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
String name =
PlaybookVersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]")
.toString();
playbooksClient.deletePlaybookVersion(name);
}
name - Required. The name of the playbook version to delete. Format:
`projects/<ProjectID>/locations/<LocationID>/agents/<AgentID>/playbooks/<PlaybookID>/versions/<VersionID>`.com.google.api.gax.rpc.ApiException - if the remote call failspublic final void deletePlaybookVersion(DeletePlaybookVersionRequest 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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
DeletePlaybookVersionRequest request =
DeletePlaybookVersionRequest.newBuilder()
.setName(
PlaybookVersionName.of(
"[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]")
.toString())
.build();
playbooksClient.deletePlaybookVersion(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<DeletePlaybookVersionRequest,com.google.protobuf.Empty> deletePlaybookVersionCallable()
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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
DeletePlaybookVersionRequest request =
DeletePlaybookVersionRequest.newBuilder()
.setName(
PlaybookVersionName.of(
"[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]")
.toString())
.build();
ApiFuture<Empty> future = playbooksClient.deletePlaybookVersionCallable().futureCall(request);
// Do something.
future.get();
}
public final PlaybooksClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest 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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : playbooksClient.listLocations(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<com.google.cloud.location.ListLocationsRequest,PlaybooksClient.ListLocationsPagedResponse> listLocationsPagedCallable()
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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future = playbooksClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for (Location element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response = playbooksClient.listLocationsCallable().call(request);
for (Location element : response.getLocationsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest 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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = playbooksClient.getLocation(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<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
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 (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future = playbooksClient.getLocationCallable().futureCall(request);
// Do something.
Location response = future.get();
}
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 © 2025 Google LLC. All rights reserved.