- 0.64.0 (latest)
- 0.63.0
- 0.62.0
- 0.60.0
- 0.59.0
- 0.58.0
- 0.57.0
- 0.56.0
- 0.55.0
- 0.54.0
- 0.53.0
- 0.52.0
- 0.51.0
- 0.50.0
- 0.48.0
- 0.47.0
- 0.46.0
- 0.45.0
- 0.44.0
- 0.43.0
- 0.42.0
- 0.41.0
- 0.40.0
- 0.39.0
- 0.38.0
- 0.35.0
- 0.34.0
- 0.33.0
- 0.32.0
- 0.31.0
- 0.30.0
- 0.29.0
- 0.28.0
- 0.27.0
- 0.26.0
- 0.25.0
- 0.24.0
- 0.23.0
- 0.22.0
- 0.20.0
- 0.19.0
- 0.18.0
- 0.17.0
- 0.16.0
- 0.15.0
- 0.14.7
- 0.13.1
- 0.12.1
- 0.11.5
GitHub Repository | Product Reference | REST Documentation | RPC 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().
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteExample |
Deletes the specified example. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetExample |
Retrieves the specified example. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateExample |
Update the specified example. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of 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.
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: |
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: |
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: |
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: |
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: |
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: |
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: |
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: |
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> |