Class ExamplesClient (0.52.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
MethodDescriptionMethod 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
TypeDescription
ExamplesClient
Exceptions
TypeDescription
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
NameDescription
settingsExamplesSettings
Returns
TypeDescription
ExamplesClient
Exceptions
TypeDescription
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
NameDescription
stubExamplesStub
Returns
TypeDescription
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
NameDescription
settingsExamplesSettings

ExamplesClient(ExamplesStub stub)

protected ExamplesClient(ExamplesStub stub)
Parameter
NameDescription
stubExamplesStub

Methods

awaitTermination(long duration, TimeUnit unit)

public boolean awaitTermination(long duration, TimeUnit unit)
Parameters
NameDescription
durationlong
unitTimeUnit
Returns
TypeDescription
boolean
Exceptions
TypeDescription
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
NameDescription
requestCreateExampleRequest

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

Returns
TypeDescription
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
NameDescription
parentPlaybookName

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

exampleExample

Required. The example to create.

Returns
TypeDescription
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
NameDescription
parentString

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

exampleExample

Required. The example to create.

Returns
TypeDescription
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
TypeDescription
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
NameDescription
requestDeleteExampleRequest

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
NameDescription
nameExampleName

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
NameDescription
nameString

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
TypeDescription
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
NameDescription
nameExampleName

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

Returns
TypeDescription
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
NameDescription
requestGetExampleRequest

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

Returns
TypeDescription
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
NameDescription
nameString

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

Returns
TypeDescription
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
TypeDescription
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
NameDescription
requestcom.google.cloud.location.GetLocationRequest

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

Returns
TypeDescription
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
TypeDescription
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>

getSettings()

public final ExamplesSettings getSettings()
Returns
TypeDescription
ExamplesSettings

getStub()

public ExamplesStub getStub()
Returns
TypeDescription
ExamplesStub

isShutdown()

public boolean isShutdown()
Returns
TypeDescription
boolean

isTerminated()

public boolean isTerminated()
Returns
TypeDescription
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
NameDescription
requestListExamplesRequest

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

Returns
TypeDescription
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
NameDescription
parentPlaybookName

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

Returns
TypeDescription
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
NameDescription
parentString

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

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
requestcom.google.cloud.location.ListLocationsRequest

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

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
exampleExample

Required. The example to update.

updateMaskFieldMask

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

Returns
TypeDescription
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
NameDescription
requestUpdateExampleRequest

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

Returns
TypeDescription
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
TypeDescription
UnaryCallable<UpdateExampleRequest,Example>