Class PlaybooksClient (0.55.0)

GitHub RepositoryProduct ReferenceREST DocumentationRPC Documentation

Service Description: Service for managing Playbooks.

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().

Methods
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.

  • createPlaybook(CreatePlaybookRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createPlaybook(AgentName parent, Playbook playbook)

  • createPlaybook(String parent, Playbook playbook)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createPlaybookCallable()

DeletePlaybook

Deletes a specified playbook.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • deletePlaybook(DeletePlaybookRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deletePlaybook(PlaybookName name)

  • deletePlaybook(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deletePlaybookCallable()

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.

  • listPlaybooks(ListPlaybooksRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listPlaybooks(AgentName parent)

  • listPlaybooks(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listPlaybooksPagedCallable()

  • listPlaybooksCallable()

GetPlaybook

Retrieves the specified Playbook.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getPlaybook(GetPlaybookRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getPlaybook(PlaybookName name)

  • getPlaybook(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getPlaybookCallable()

UpdatePlaybook

Updates the specified Playbook.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • updatePlaybook(UpdatePlaybookRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • updatePlaybook(Playbook playbook, FieldMask updateMask)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • updatePlaybookCallable()

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.

  • createPlaybookVersion(CreatePlaybookVersionRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • createPlaybookVersion(PlaybookName parent, PlaybookVersion playbookVersion)

  • createPlaybookVersion(String parent, PlaybookVersion playbookVersion)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • createPlaybookVersionCallable()

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.

  • getPlaybookVersion(GetPlaybookVersionRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • getPlaybookVersion(PlaybookVersionName name)

  • getPlaybookVersion(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getPlaybookVersionCallable()

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.

  • listPlaybookVersions(ListPlaybookVersionsRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • listPlaybookVersions(PlaybookName parent)

  • listPlaybookVersions(String parent)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listPlaybookVersionsPagedCallable()

  • listPlaybookVersionsCallable()

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.

  • deletePlaybookVersion(DeletePlaybookVersionRequest request)

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

  • deletePlaybookVersion(PlaybookVersionName name)

  • deletePlaybookVersion(String name)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • deletePlaybookVersionCallable()

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.

  • listLocations(ListLocationsRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • listLocationsPagedCallable()

  • listLocationsCallable()

GetLocation

Gets information about a location.

Request object method variants only take one parameter, a request object, which must be constructed before the call.

  • getLocation(GetLocationRequest request)

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

  • getLocationCallable()

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.

Inheritance

java.lang.Object > PlaybooksClient

Static Methods

create()

public static final PlaybooksClient create()

Constructs an instance of PlaybooksClient with default settings.

Returns
Type Description
PlaybooksClient
Exceptions
Type Description
IOException

create(PlaybooksSettings settings)

public static final PlaybooksClient create(PlaybooksSettings settings)

Constructs an instance of PlaybooksClient, 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 PlaybooksSettings
Returns
Type Description
PlaybooksClient
Exceptions
Type Description
IOException

create(PlaybooksStub stub)

public static final PlaybooksClient create(PlaybooksStub stub)

Constructs an instance of PlaybooksClient, using the given stub for making calls. This is for advanced usage - prefer using create(PlaybooksSettings).

Parameter
Name Description
stub PlaybooksStub
Returns
Type Description
PlaybooksClient

Constructors

PlaybooksClient(PlaybooksSettings settings)

protected PlaybooksClient(PlaybooksSettings settings)

Constructs an instance of PlaybooksClient, 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 PlaybooksSettings

PlaybooksClient(PlaybooksStub stub)

protected PlaybooksClient(PlaybooksStub stub)
Parameter
Name Description
stub PlaybooksStub

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()

createPlaybook(AgentName parent, Playbook playbook)

public final Playbook createPlaybook(AgentName parent, Playbook playbook)

Creates a playbook in a specified agent.

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);
 }
 
Parameters
Name Description
parent AgentName

Required. The agent to create a playbook for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>.

playbook Playbook

Required. The playbook to create.

Returns
Type Description
Playbook

createPlaybook(CreatePlaybookRequest request)

public final Playbook createPlaybook(CreatePlaybookRequest request)

Creates a playbook in a specified agent.

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);
 }
 
Parameter
Name Description
request CreatePlaybookRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Playbook

createPlaybook(String parent, Playbook playbook)

public final Playbook createPlaybook(String parent, Playbook playbook)

Creates a playbook in a specified agent.

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);
 }
 
Parameters
Name Description
parent String

Required. The agent to create a playbook for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>.

playbook Playbook

Required. The playbook to create.

Returns
Type Description
Playbook

createPlaybookCallable()

public final UnaryCallable<CreatePlaybookRequest,Playbook> createPlaybookCallable()

Creates a playbook in a specified agent.

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();
 }
 
Returns
Type Description
UnaryCallable<CreatePlaybookRequest,Playbook>

createPlaybookVersion(CreatePlaybookVersionRequest request)

public final PlaybookVersion createPlaybookVersion(CreatePlaybookVersionRequest request)

Creates a version for the specified 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()) {
   CreatePlaybookVersionRequest request =
       CreatePlaybookVersionRequest.newBuilder()
           .setParent(
               PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
           .setPlaybookVersion(PlaybookVersion.newBuilder().build())
           .build();
   PlaybookVersion response = playbooksClient.createPlaybookVersion(request);
 }
 
Parameter
Name Description
request CreatePlaybookVersionRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
PlaybookVersion

createPlaybookVersion(PlaybookName parent, PlaybookVersion playbookVersion)

public final PlaybookVersion createPlaybookVersion(PlaybookName parent, PlaybookVersion playbookVersion)

Creates a version for the specified 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()) {
   PlaybookName parent = PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]");
   PlaybookVersion playbookVersion = PlaybookVersion.newBuilder().build();
   PlaybookVersion response = playbooksClient.createPlaybookVersion(parent, playbookVersion);
 }
 
Parameters
Name Description
parent PlaybookName

Required. The playbook to create a version for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook ID>.

playbookVersion PlaybookVersion

Required. The playbook version to create.

Returns
Type Description
PlaybookVersion

createPlaybookVersion(String parent, PlaybookVersion playbookVersion)

public final PlaybookVersion createPlaybookVersion(String parent, PlaybookVersion playbookVersion)

Creates a version for the specified 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 =
       PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString();
   PlaybookVersion playbookVersion = PlaybookVersion.newBuilder().build();
   PlaybookVersion response = playbooksClient.createPlaybookVersion(parent, playbookVersion);
 }
 
Parameters
Name Description
parent String

Required. The playbook to create a version for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook ID>.

playbookVersion PlaybookVersion

Required. The playbook version to create.

Returns
Type Description
PlaybookVersion

createPlaybookVersionCallable()

public final UnaryCallable<CreatePlaybookVersionRequest,PlaybookVersion> createPlaybookVersionCallable()

Creates a version for the specified 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()) {
   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();
 }
 
Returns
Type Description
UnaryCallable<CreatePlaybookVersionRequest,PlaybookVersion>

deletePlaybook(DeletePlaybookRequest request)

public final void deletePlaybook(DeletePlaybookRequest request)

Deletes a specified 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()) {
   DeletePlaybookRequest request =
       DeletePlaybookRequest.newBuilder()
           .setName(
               PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
           .build();
   playbooksClient.deletePlaybook(request);
 }
 
Parameter
Name Description
request DeletePlaybookRequest

The request object containing all of the parameters for the API call.

deletePlaybook(PlaybookName name)

public final void deletePlaybook(PlaybookName name)

Deletes a specified 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()) {
   PlaybookName name = PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]");
   playbooksClient.deletePlaybook(name);
 }
 
Parameter
Name Description
name PlaybookName

Required. The name of the playbook to delete. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook ID>.

deletePlaybook(String name)

public final void deletePlaybook(String name)

Deletes a specified 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 name = PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString();
   playbooksClient.deletePlaybook(name);
 }
 
Parameter
Name Description
name String

Required. The name of the playbook to delete. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook ID>.

deletePlaybookCallable()

public final UnaryCallable<DeletePlaybookRequest,Empty> deletePlaybookCallable()

Deletes a specified 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()) {
   DeletePlaybookRequest request =
       DeletePlaybookRequest.newBuilder()
           .setName(
               PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
           .build();
   ApiFuture<Empty> future = playbooksClient.deletePlaybookCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeletePlaybookRequest,Empty>

deletePlaybookVersion(DeletePlaybookVersionRequest request)

public final void deletePlaybookVersion(DeletePlaybookVersionRequest request)

Deletes the specified version of the 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()) {
   DeletePlaybookVersionRequest request =
       DeletePlaybookVersionRequest.newBuilder()
           .setName(
               PlaybookVersionName.of(
                       "[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]")
                   .toString())
           .build();
   playbooksClient.deletePlaybookVersion(request);
 }
 
Parameter
Name Description
request DeletePlaybookVersionRequest

The request object containing all of the parameters for the API call.

deletePlaybookVersion(PlaybookVersionName name)

public final void deletePlaybookVersion(PlaybookVersionName name)

Deletes the specified version of the 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()) {
   PlaybookVersionName name =
       PlaybookVersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]");
   playbooksClient.deletePlaybookVersion(name);
 }
 
Parameter
Name Description
name PlaybookVersionName

Required. The name of the playbook version to delete. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook ID>/versions/<Version ID>.

deletePlaybookVersion(String name)

public final void deletePlaybookVersion(String name)

Deletes the specified version of the 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 name =
       PlaybookVersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]")
           .toString();
   playbooksClient.deletePlaybookVersion(name);
 }
 
Parameter
Name Description
name String

Required. The name of the playbook version to delete. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook ID>/versions/<Version ID>.

deletePlaybookVersionCallable()

public final UnaryCallable<DeletePlaybookVersionRequest,Empty> deletePlaybookVersionCallable()

Deletes the specified version of the 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()) {
   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();
 }
 
Returns
Type Description
UnaryCallable<DeletePlaybookVersionRequest,Empty>

getLocation(GetLocationRequest request)

public final Location getLocation(GetLocationRequest request)

Gets information about a location.

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);
 }
 
Parameter
Name Description
request com.google.cloud.location.GetLocationRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
com.google.cloud.location.Location

getLocationCallable()

public final UnaryCallable<GetLocationRequest,Location> getLocationCallable()

Gets information about a location.

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();
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>

getPlaybook(GetPlaybookRequest request)

public final Playbook getPlaybook(GetPlaybookRequest request)

Retrieves the specified 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()) {
   GetPlaybookRequest request =
       GetPlaybookRequest.newBuilder()
           .setName(
               PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
           .build();
   Playbook response = playbooksClient.getPlaybook(request);
 }
 
Parameter
Name Description
request GetPlaybookRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Playbook

getPlaybook(PlaybookName name)

public final Playbook getPlaybook(PlaybookName name)

Retrieves the specified 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()) {
   PlaybookName name = PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]");
   Playbook response = playbooksClient.getPlaybook(name);
 }
 
Parameter
Name Description
name PlaybookName

Required. The name of the playbook. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook ID>.

Returns
Type Description
Playbook

getPlaybook(String name)

public final Playbook getPlaybook(String name)

Retrieves the specified 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 name = PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString();
   Playbook response = playbooksClient.getPlaybook(name);
 }
 
Parameter
Name Description
name String

Required. The name of the playbook. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook ID>.

Returns
Type Description
Playbook

getPlaybookCallable()

public final UnaryCallable<GetPlaybookRequest,Playbook> getPlaybookCallable()

Retrieves the specified 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()) {
   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();
 }
 
Returns
Type Description
UnaryCallable<GetPlaybookRequest,Playbook>

getPlaybookVersion(GetPlaybookVersionRequest request)

public final PlaybookVersion getPlaybookVersion(GetPlaybookVersionRequest request)

Retrieves the specified version of the 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()) {
   GetPlaybookVersionRequest request =
       GetPlaybookVersionRequest.newBuilder()
           .setName(
               PlaybookVersionName.of(
                       "[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]")
                   .toString())
           .build();
   PlaybookVersion response = playbooksClient.getPlaybookVersion(request);
 }
 
Parameter
Name Description
request GetPlaybookVersionRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
PlaybookVersion

getPlaybookVersion(PlaybookVersionName name)

public final PlaybookVersion getPlaybookVersion(PlaybookVersionName name)

Retrieves the specified version of the 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()) {
   PlaybookVersionName name =
       PlaybookVersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]");
   PlaybookVersion response = playbooksClient.getPlaybookVersion(name);
 }
 
Parameter
Name Description
name PlaybookVersionName

Required. The name of the playbook version. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook ID>/versions/<Version ID>.

Returns
Type Description
PlaybookVersion

getPlaybookVersion(String name)

public final PlaybookVersion getPlaybookVersion(String name)

Retrieves the specified version of the 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 name =
       PlaybookVersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]")
           .toString();
   PlaybookVersion response = playbooksClient.getPlaybookVersion(name);
 }
 
Parameter
Name Description
name String

Required. The name of the playbook version. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook ID>/versions/<Version ID>.

Returns
Type Description
PlaybookVersion

getPlaybookVersionCallable()

public final UnaryCallable<GetPlaybookVersionRequest,PlaybookVersion> getPlaybookVersionCallable()

Retrieves the specified version of the 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()) {
   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();
 }
 
Returns
Type Description
UnaryCallable<GetPlaybookVersionRequest,PlaybookVersion>

getSettings()

public final PlaybooksSettings getSettings()
Returns
Type Description
PlaybooksSettings

getStub()

public PlaybooksStub getStub()
Returns
Type Description
PlaybooksStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listLocations(ListLocationsRequest request)

public final PlaybooksClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request)

Lists information about the supported locations for this service.

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);
   }
 }
 
Parameter
Name Description
request com.google.cloud.location.ListLocationsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
PlaybooksClient.ListLocationsPagedResponse

listLocationsCallable()

public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> listLocationsCallable()

Lists information about the supported locations for this service.

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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>

listLocationsPagedCallable()

public final UnaryCallable<ListLocationsRequest,PlaybooksClient.ListLocationsPagedResponse> listLocationsPagedCallable()

Lists information about the supported locations for this service.

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);
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse>

listPlaybookVersions(ListPlaybookVersionsRequest request)

public final PlaybooksClient.ListPlaybookVersionsPagedResponse listPlaybookVersions(ListPlaybookVersionsRequest request)

Lists versions for the specified 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()) {
   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);
   }
 }
 
Parameter
Name Description
request ListPlaybookVersionsRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
PlaybooksClient.ListPlaybookVersionsPagedResponse

listPlaybookVersions(PlaybookName parent)

public final PlaybooksClient.ListPlaybookVersionsPagedResponse listPlaybookVersions(PlaybookName parent)

Lists versions for the specified 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()) {
   PlaybookName parent = PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]");
   for (PlaybookVersion element : playbooksClient.listPlaybookVersions(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent PlaybookName

Required. The playbook to list versions for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook ID>.

Returns
Type Description
PlaybooksClient.ListPlaybookVersionsPagedResponse

listPlaybookVersions(String parent)

public final PlaybooksClient.ListPlaybookVersionsPagedResponse listPlaybookVersions(String parent)

Lists versions for the specified 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 =
       PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString();
   for (PlaybookVersion element : playbooksClient.listPlaybookVersions(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

Required. The playbook to list versions for. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook ID>.

Returns
Type Description
PlaybooksClient.ListPlaybookVersionsPagedResponse

listPlaybookVersionsCallable()

public final UnaryCallable<ListPlaybookVersionsRequest,ListPlaybookVersionsResponse> listPlaybookVersionsCallable()

Lists versions for the specified 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()) {
   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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListPlaybookVersionsRequest,ListPlaybookVersionsResponse>

listPlaybookVersionsPagedCallable()

public final UnaryCallable<ListPlaybookVersionsRequest,PlaybooksClient.ListPlaybookVersionsPagedResponse> listPlaybookVersionsPagedCallable()

Lists versions for the specified 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()) {
   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);
   }
 }
 
Returns
Type Description
UnaryCallable<ListPlaybookVersionsRequest,ListPlaybookVersionsPagedResponse>

listPlaybooks(AgentName parent)

public final PlaybooksClient.ListPlaybooksPagedResponse listPlaybooks(AgentName parent)

Returns a list of playbooks in the specified agent.

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);
   }
 }
 
Parameter
Name Description
parent AgentName

Required. The agent to list playbooks from. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>.

Returns
Type Description
PlaybooksClient.ListPlaybooksPagedResponse

listPlaybooks(ListPlaybooksRequest request)

public final PlaybooksClient.ListPlaybooksPagedResponse listPlaybooks(ListPlaybooksRequest request)

Returns a list of playbooks in the specified agent.

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);
   }
 }
 
Parameter
Name Description
request ListPlaybooksRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
PlaybooksClient.ListPlaybooksPagedResponse

listPlaybooks(String parent)

public final PlaybooksClient.ListPlaybooksPagedResponse listPlaybooks(String parent)

Returns a list of playbooks in the specified agent.

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);
   }
 }
 
Parameter
Name Description
parent String

Required. The agent to list playbooks from. Format: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>.

Returns
Type Description
PlaybooksClient.ListPlaybooksPagedResponse

listPlaybooksCallable()

public final UnaryCallable<ListPlaybooksRequest,ListPlaybooksResponse> listPlaybooksCallable()

Returns a list of playbooks in the specified agent.

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;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListPlaybooksRequest,ListPlaybooksResponse>

listPlaybooksPagedCallable()

public final UnaryCallable<ListPlaybooksRequest,PlaybooksClient.ListPlaybooksPagedResponse> listPlaybooksPagedCallable()

Returns a list of playbooks in the specified agent.

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);
   }
 }
 
Returns
Type Description
UnaryCallable<ListPlaybooksRequest,ListPlaybooksPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updatePlaybook(Playbook playbook, FieldMask updateMask)

public final Playbook updatePlaybook(Playbook playbook, FieldMask updateMask)

Updates the specified 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()) {
   Playbook playbook = Playbook.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Playbook response = playbooksClient.updatePlaybook(playbook, updateMask);
 }
 
Parameters
Name Description
playbook Playbook

Required. The playbook to update.

updateMask FieldMask

The mask to control which fields get updated. If the mask is not present, all fields will be updated.

Returns
Type Description
Playbook

updatePlaybook(UpdatePlaybookRequest request)

public final Playbook updatePlaybook(UpdatePlaybookRequest request)

Updates the specified 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()) {
   UpdatePlaybookRequest request =
       UpdatePlaybookRequest.newBuilder()
           .setPlaybook(Playbook.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Playbook response = playbooksClient.updatePlaybook(request);
 }
 
Parameter
Name Description
request UpdatePlaybookRequest

The request object containing all of the parameters for the API call.

Returns
Type Description
Playbook

updatePlaybookCallable()

public final UnaryCallable<UpdatePlaybookRequest,Playbook> updatePlaybookCallable()

Updates the specified 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()) {
   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();
 }
 
Returns
Type Description
UnaryCallable<UpdatePlaybookRequest,Playbook>