Class ExamplesClient (0.53.0)

GitHub RepositoryProduct ReferenceREST DocumentationRPC Documentation

Service Description: Service for managing Examples.

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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   PlaybookName parent = PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]");
   Example example = Example.newBuilder().build();
   Example response = examplesClient.createExample(parent, example);
 }
 

Note: close() needs to be called on the ExamplesClient 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

CreateExample

Creates an example in the specified playbook.

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

  • createExample(CreateExampleRequest request)

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

  • createExample(PlaybookName parent, Example example)

  • createExample(String parent, Example example)

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

  • createExampleCallable()

DeleteExample

Deletes the specified example.

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

  • deleteExample(DeleteExampleRequest request)

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

  • deleteExample(ExampleName name)

  • deleteExample(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.

  • deleteExampleCallable()

ListExamples

Returns a list of examples in the specified playbook.

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

  • listExamples(ListExamplesRequest request)

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

  • listExamples(PlaybookName parent)

  • listExamples(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.

  • listExamplesPagedCallable()

  • listExamplesCallable()

GetExample

Retrieves the specified example.

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

  • getExample(GetExampleRequest request)

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

  • getExample(ExampleName name)

  • getExample(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.

  • getExampleCallable()

UpdateExample

Update the specified example.

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

  • updateExample(UpdateExampleRequest request)

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

  • updateExample(Example example, 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.

  • updateExampleCallable()

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 ExamplesSettings 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
 ExamplesSettings examplesSettings =
     ExamplesSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 ExamplesClient examplesClient = ExamplesClient.create(examplesSettings);
 

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
 ExamplesSettings examplesSettings =
     ExamplesSettings.newBuilder().setEndpoint(myEndpoint).build();
 ExamplesClient examplesClient = ExamplesClient.create(examplesSettings);
 

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
 ExamplesSettings examplesSettings = ExamplesSettings.newHttpJsonBuilder().build();
 ExamplesClient examplesClient = ExamplesClient.create(examplesSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

Inheritance

java.lang.Object > ExamplesClient

Static Methods

create()

public static final ExamplesClient create()

Constructs an instance of ExamplesClient with default settings.

Returns
Type Description
ExamplesClient
Exceptions
Type Description
IOException

create(ExamplesSettings settings)

public static final ExamplesClient create(ExamplesSettings settings)

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

create(ExamplesStub stub)

public static final ExamplesClient create(ExamplesStub stub)

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

Parameter
Name Description
stub ExamplesStub
Returns
Type Description
ExamplesClient

Constructors

ExamplesClient(ExamplesSettings settings)

protected ExamplesClient(ExamplesSettings settings)

Constructs an instance of ExamplesClient, 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 ExamplesSettings

ExamplesClient(ExamplesStub stub)

protected ExamplesClient(ExamplesStub stub)
Parameter
Name Description
stub ExamplesStub

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

createExample(CreateExampleRequest request)

public final Example createExample(CreateExampleRequest request)

Creates an example in 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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   CreateExampleRequest request =
       CreateExampleRequest.newBuilder()
           .setParent(
               PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
           .setExample(Example.newBuilder().build())
           .build();
   Example response = examplesClient.createExample(request);
 }
 
Parameter
Name Description
request CreateExampleRequest

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

Returns
Type Description
Example

createExample(PlaybookName parent, Example example)

public final Example createExample(PlaybookName parent, Example example)

Creates an example in 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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   PlaybookName parent = PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]");
   Example example = Example.newBuilder().build();
   Example response = examplesClient.createExample(parent, example);
 }
 
Parameters
Name Description
parent PlaybookName

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

example Example

Required. The example to create.

Returns
Type Description
Example

createExample(String parent, Example example)

public final Example createExample(String parent, Example example)

Creates an example in 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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   String parent =
       PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString();
   Example example = Example.newBuilder().build();
   Example response = examplesClient.createExample(parent, example);
 }
 
Parameters
Name Description
parent String

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

example Example

Required. The example to create.

Returns
Type Description
Example

createExampleCallable()

public final UnaryCallable<CreateExampleRequest,Example> createExampleCallable()

Creates an example in 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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   CreateExampleRequest request =
       CreateExampleRequest.newBuilder()
           .setParent(
               PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
           .setExample(Example.newBuilder().build())
           .build();
   ApiFuture<Example> future = examplesClient.createExampleCallable().futureCall(request);
   // Do something.
   Example response = future.get();
 }
 
Returns
Type Description
UnaryCallable<CreateExampleRequest,Example>

deleteExample(DeleteExampleRequest request)

public final void deleteExample(DeleteExampleRequest request)

Deletes the specified example.

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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   DeleteExampleRequest request =
       DeleteExampleRequest.newBuilder()
           .setName(
               ExampleName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[EXAMPLE]")
                   .toString())
           .build();
   examplesClient.deleteExample(request);
 }
 
Parameter
Name Description
request DeleteExampleRequest

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

deleteExample(ExampleName name)

public final void deleteExample(ExampleName name)

Deletes the specified example.

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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   ExampleName name =
       ExampleName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[EXAMPLE]");
   examplesClient.deleteExample(name);
 }
 
Parameter
Name Description
name ExampleName

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

deleteExample(String name)

public final void deleteExample(String name)

Deletes the specified example.

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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   String name =
       ExampleName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[EXAMPLE]")
           .toString();
   examplesClient.deleteExample(name);
 }
 
Parameter
Name Description
name String

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

deleteExampleCallable()

public final UnaryCallable<DeleteExampleRequest,Empty> deleteExampleCallable()

Deletes the specified example.

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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   DeleteExampleRequest request =
       DeleteExampleRequest.newBuilder()
           .setName(
               ExampleName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[EXAMPLE]")
                   .toString())
           .build();
   ApiFuture<Empty> future = examplesClient.deleteExampleCallable().futureCall(request);
   // Do something.
   future.get();
 }
 
Returns
Type Description
UnaryCallable<DeleteExampleRequest,Empty>

getExample(ExampleName name)

public final Example getExample(ExampleName name)

Retrieves the specified example.

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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   ExampleName name =
       ExampleName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[EXAMPLE]");
   Example response = examplesClient.getExample(name);
 }
 
Parameter
Name Description
name ExampleName

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

Returns
Type Description
Example

getExample(GetExampleRequest request)

public final Example getExample(GetExampleRequest request)

Retrieves the specified example.

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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   GetExampleRequest request =
       GetExampleRequest.newBuilder()
           .setName(
               ExampleName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[EXAMPLE]")
                   .toString())
           .build();
   Example response = examplesClient.getExample(request);
 }
 
Parameter
Name Description
request GetExampleRequest

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

Returns
Type Description
Example

getExample(String name)

public final Example getExample(String name)

Retrieves the specified example.

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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   String name =
       ExampleName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[EXAMPLE]")
           .toString();
   Example response = examplesClient.getExample(name);
 }
 
Parameter
Name Description
name String

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

Returns
Type Description
Example

getExampleCallable()

public final UnaryCallable<GetExampleRequest,Example> getExampleCallable()

Retrieves the specified example.

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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   GetExampleRequest request =
       GetExampleRequest.newBuilder()
           .setName(
               ExampleName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[EXAMPLE]")
                   .toString())
           .build();
   ApiFuture<Example> future = examplesClient.getExampleCallable().futureCall(request);
   // Do something.
   Example response = future.get();
 }
 
Returns
Type Description
UnaryCallable<GetExampleRequest,Example>

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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   Location response = examplesClient.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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
   ApiFuture<Location> future = examplesClient.getLocationCallable().futureCall(request);
   // Do something.
   Location response = future.get();
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>

getSettings()

public final ExamplesSettings getSettings()
Returns
Type Description
ExamplesSettings

getStub()

public ExamplesStub getStub()
Returns
Type Description
ExamplesStub

isShutdown()

public boolean isShutdown()
Returns
Type Description
boolean

isTerminated()

public boolean isTerminated()
Returns
Type Description
boolean

listExamples(ListExamplesRequest request)

public final ExamplesClient.ListExamplesPagedResponse listExamples(ListExamplesRequest request)

Returns a list of examples in 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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   ListExamplesRequest request =
       ListExamplesRequest.newBuilder()
           .setParent(
               PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setLanguageCode("languageCode-2092349083")
           .build();
   for (Example element : examplesClient.listExamples(request).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
request ListExamplesRequest

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

Returns
Type Description
ExamplesClient.ListExamplesPagedResponse

listExamples(PlaybookName parent)

public final ExamplesClient.ListExamplesPagedResponse listExamples(PlaybookName parent)

Returns a list of examples in 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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   PlaybookName parent = PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]");
   for (Example element : examplesClient.listExamples(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent PlaybookName

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

Returns
Type Description
ExamplesClient.ListExamplesPagedResponse

listExamples(String parent)

public final ExamplesClient.ListExamplesPagedResponse listExamples(String parent)

Returns a list of examples in 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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   String parent =
       PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString();
   for (Example element : examplesClient.listExamples(parent).iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Parameter
Name Description
parent String

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

Returns
Type Description
ExamplesClient.ListExamplesPagedResponse

listExamplesCallable()

public final UnaryCallable<ListExamplesRequest,ListExamplesResponse> listExamplesCallable()

Returns a list of examples in 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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   ListExamplesRequest request =
       ListExamplesRequest.newBuilder()
           .setParent(
               PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setLanguageCode("languageCode-2092349083")
           .build();
   while (true) {
     ListExamplesResponse response = examplesClient.listExamplesCallable().call(request);
     for (Example element : response.getExamplesList()) {
       // doThingsWith(element);
     }
     String nextPageToken = response.getNextPageToken();
     if (!Strings.isNullOrEmpty(nextPageToken)) {
       request = request.toBuilder().setPageToken(nextPageToken).build();
     } else {
       break;
     }
   }
 }
 
Returns
Type Description
UnaryCallable<ListExamplesRequest,ListExamplesResponse>

listExamplesPagedCallable()

public final UnaryCallable<ListExamplesRequest,ExamplesClient.ListExamplesPagedResponse> listExamplesPagedCallable()

Returns a list of examples in 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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   ListExamplesRequest request =
       ListExamplesRequest.newBuilder()
           .setParent(
               PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .setLanguageCode("languageCode-2092349083")
           .build();
   ApiFuture<Example> future = examplesClient.listExamplesPagedCallable().futureCall(request);
   // Do something.
   for (Example element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<ListExamplesRequest,ListExamplesPagedResponse>

listLocations(ListLocationsRequest request)

public final ExamplesClient.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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   for (Location element : examplesClient.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
ExamplesClient.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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   while (true) {
     ListLocationsResponse response = examplesClient.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,ExamplesClient.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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   ListLocationsRequest request =
       ListLocationsRequest.newBuilder()
           .setName("name3373707")
           .setFilter("filter-1274492040")
           .setPageSize(883849137)
           .setPageToken("pageToken873572522")
           .build();
   ApiFuture<Location> future = examplesClient.listLocationsPagedCallable().futureCall(request);
   // Do something.
   for (Location element : future.get().iterateAll()) {
     // doThingsWith(element);
   }
 }
 
Returns
Type Description
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse>

shutdown()

public void shutdown()

shutdownNow()

public void shutdownNow()

updateExample(Example example, FieldMask updateMask)

public final Example updateExample(Example example, FieldMask updateMask)

Update the specified example.

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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   Example example = Example.newBuilder().build();
   FieldMask updateMask = FieldMask.newBuilder().build();
   Example response = examplesClient.updateExample(example, updateMask);
 }
 
Parameters
Name Description
example Example

Required. The example to update.

updateMask FieldMask

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

Returns
Type Description
Example

updateExample(UpdateExampleRequest request)

public final Example updateExample(UpdateExampleRequest request)

Update the specified example.

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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   UpdateExampleRequest request =
       UpdateExampleRequest.newBuilder()
           .setExample(Example.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   Example response = examplesClient.updateExample(request);
 }
 
Parameter
Name Description
request UpdateExampleRequest

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

Returns
Type Description
Example

updateExampleCallable()

public final UnaryCallable<UpdateExampleRequest,Example> updateExampleCallable()

Update the specified example.

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 (ExamplesClient examplesClient = ExamplesClient.create()) {
   UpdateExampleRequest request =
       UpdateExampleRequest.newBuilder()
           .setExample(Example.newBuilder().build())
           .setUpdateMask(FieldMask.newBuilder().build())
           .build();
   ApiFuture<Example> future = examplesClient.updateExampleCallable().futureCall(request);
   // Do something.
   Example response = future.get();
 }
 
Returns
Type Description
UnaryCallable<UpdateExampleRequest,Example>