diff --git a/java-dialogflow-cx/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClient.java b/java-dialogflow-cx/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClient.java index 929943b2ce5b..eeead6d9f668 100644 --- a/java-dialogflow-cx/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClient.java +++ b/java-dialogflow-cx/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3/EntityTypesClient.java @@ -18,10 +18,14 @@ import com.google.api.core.ApiFuture; import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; import com.google.api.gax.paging.AbstractFixedSizeCollection; import com.google.api.gax.paging.AbstractPage; import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; import com.google.api.gax.rpc.PageContext; import com.google.api.gax.rpc.UnaryCallable; import com.google.cloud.dialogflow.cx.v3.stub.EntityTypesStub; @@ -31,6 +35,7 @@ import com.google.cloud.location.ListLocationsResponse; import com.google.cloud.location.Location; import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; import com.google.protobuf.Empty; import com.google.protobuf.FieldMask; import java.io.IOException; @@ -168,6 +173,36 @@ * * *
ExportEntityTypes
Exports the selected entity types.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *exportEntityTypesAsync(ExportEntityTypesRequest request) + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *exportEntityTypesOperationCallable() + *
exportEntityTypesCallable() + *
ImportEntityTypes
Imports the specified entitytypes into the agent.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *importEntityTypesAsync(ImportEntityTypesRequest request) + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *importEntityTypesOperationCallable() + *
importEntityTypesCallable() + *
ListLocations
Lists information about the supported locations for this service.
Sample code: + * + *
{@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 (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { + * ExportEntityTypesRequest request = + * ExportEntityTypesRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .addAllEntityTypes(new ArrayList+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture()) + * .setLanguageCode("languageCode-2092349083") + * .build(); + * ExportEntityTypesResponse response = entityTypesClient.exportEntityTypesAsync(request).get(); + * } + * }
Sample code: + * + *
{@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 (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { + * ExportEntityTypesRequest request = + * ExportEntityTypesRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .addAllEntityTypes(new ArrayList+ */ + public final OperationCallable< + ExportEntityTypesRequest, ExportEntityTypesResponse, ExportEntityTypesMetadata> + exportEntityTypesOperationCallable() { + return stub.exportEntityTypesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Exports the selected entity types. + * + *()) + * .setLanguageCode("languageCode-2092349083") + * .build(); + * OperationFuture future = + * entityTypesClient.exportEntityTypesOperationCallable().futureCall(request); + * // Do something. + * ExportEntityTypesResponse response = future.get(); + * } + * }
Sample code: + * + *
{@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 (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { + * ExportEntityTypesRequest request = + * ExportEntityTypesRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .addAllEntityTypes(new ArrayList+ */ + public final UnaryCallable()) + * .setLanguageCode("languageCode-2092349083") + * .build(); + * ApiFuture future = + * entityTypesClient.exportEntityTypesCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@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 (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { + * ImportEntityTypesRequest request = + * ImportEntityTypesRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .setTargetEntityType( + * EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]") + * .toString()) + * .build(); + * ImportEntityTypesResponse response = entityTypesClient.importEntityTypesAsync(request).get(); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@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 (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { + * ImportEntityTypesRequest request = + * ImportEntityTypesRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .setTargetEntityType( + * EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]") + * .toString()) + * .build(); + * OperationFuture+ */ + public final OperationCallable< + ImportEntityTypesRequest, ImportEntityTypesResponse, ImportEntityTypesMetadata> + importEntityTypesOperationCallable() { + return stub.importEntityTypesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Imports the specified entitytypes into the agent. + * + *future = + * entityTypesClient.importEntityTypesOperationCallable().futureCall(request); + * // Do something. + * ImportEntityTypesResponse response = future.get(); + * } + * }
Sample code: + * + *
{@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 (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { + * ImportEntityTypesRequest request = + * ImportEntityTypesRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .setTargetEntityType( + * EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]") + * .toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * entityTypesClient.importEntityTypesCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
ServerStreamingDetectIntent
Processes a natural language query and returns structured, actionable data as a result through server-side streaming. Server-side streaming allows Dialogflow to send [partial responses](https://cloud.google.com/dialogflow/cx/docs/concept/fulfillment#partial-response) earlier in a single request.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *serverStreamingDetectIntentCallable() + *
StreamingDetectIntent
Processes a natural language query in audio format in a streaming fashion and returns structured, actionable data as a result. This method is only available via the gRPC API (not REST). *
Note: Always use agent versions for production traffic. See [Versions and environments](https://cloud.google.com/dialogflow/cx/docs/concept/version).
Sample code: + * + *
{@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 (SessionsClient sessionsClient = SessionsClient.create()) { + * DetectIntentRequest request = + * DetectIntentRequest.newBuilder() + * .setSession( + * SessionName.ofProjectLocationAgentSessionName( + * "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]") + * .toString()) + * .setQueryParams(QueryParameters.newBuilder().build()) + * .setQueryInput(QueryInput.newBuilder().build()) + * .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) + * .build(); + * ServerStream+ */ + public final ServerStreamingCallablestream = + * sessionsClient.serverStreamingDetectIntentCallable().call(request); + * for (DetectIntentResponse response : stream) { + * // Do something when a response is received. + * } + * } + * }
ExportEntityTypes
Exports the selected entity types.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *exportEntityTypesAsync(ExportEntityTypesRequest request) + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *exportEntityTypesOperationCallable() + *
exportEntityTypesCallable() + *
ImportEntityTypes
Imports the specified entitytypes into the agent.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
+ *importEntityTypesAsync(ImportEntityTypesRequest request) + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *importEntityTypesOperationCallable() + *
importEntityTypesCallable() + *
ListLocations
Lists information about the supported locations for this service.
Sample code: + * + *
{@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 (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { + * ExportEntityTypesRequest request = + * ExportEntityTypesRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .addAllEntityTypes(new ArrayList+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture()) + * .setLanguageCode("languageCode-2092349083") + * .build(); + * ExportEntityTypesResponse response = entityTypesClient.exportEntityTypesAsync(request).get(); + * } + * }
Sample code: + * + *
{@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 (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { + * ExportEntityTypesRequest request = + * ExportEntityTypesRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .addAllEntityTypes(new ArrayList+ */ + public final OperationCallable< + ExportEntityTypesRequest, ExportEntityTypesResponse, ExportEntityTypesMetadata> + exportEntityTypesOperationCallable() { + return stub.exportEntityTypesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Exports the selected entity types. + * + *()) + * .setLanguageCode("languageCode-2092349083") + * .build(); + * OperationFuture future = + * entityTypesClient.exportEntityTypesOperationCallable().futureCall(request); + * // Do something. + * ExportEntityTypesResponse response = future.get(); + * } + * }
Sample code: + * + *
{@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 (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { + * ExportEntityTypesRequest request = + * ExportEntityTypesRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .addAllEntityTypes(new ArrayList+ */ + public final UnaryCallable()) + * .setLanguageCode("languageCode-2092349083") + * .build(); + * ApiFuture future = + * entityTypesClient.exportEntityTypesCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@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 (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { + * ImportEntityTypesRequest request = + * ImportEntityTypesRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .setTargetEntityType( + * EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]") + * .toString()) + * .build(); + * ImportEntityTypesResponse response = entityTypesClient.importEntityTypesAsync(request).get(); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture
Sample code: + * + *
{@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 (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { + * ImportEntityTypesRequest request = + * ImportEntityTypesRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .setTargetEntityType( + * EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]") + * .toString()) + * .build(); + * OperationFuture+ */ + public final OperationCallable< + ImportEntityTypesRequest, ImportEntityTypesResponse, ImportEntityTypesMetadata> + importEntityTypesOperationCallable() { + return stub.importEntityTypesOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Imports the specified entitytypes into the agent. + * + *future = + * entityTypesClient.importEntityTypesOperationCallable().futureCall(request); + * // Do something. + * ImportEntityTypesResponse response = future.get(); + * } + * }
Sample code: + * + *
{@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 (EntityTypesClient entityTypesClient = EntityTypesClient.create()) { + * ImportEntityTypesRequest request = + * ImportEntityTypesRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .setTargetEntityType( + * EntityTypeName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[ENTITY_TYPE]") + * .toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = + * entityTypesClient.importEntityTypesCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
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: + * + *
{@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); + * } + * }+ * + *
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: + * + *
{@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 + * ExamplesSettings examplesSettings = + * ExamplesSettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * ExamplesClient examplesClient = ExamplesClient.create(examplesSettings); + * }+ * + *
To customize the endpoint: + * + *
{@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 + * 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: + * + *
{@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 + * ExamplesSettings examplesSettings = ExamplesSettings.newHttpJsonBuilder().build(); + * ExamplesClient examplesClient = ExamplesClient.create(examplesSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class ExamplesClient implements BackgroundResource { + private final ExamplesSettings settings; + private final ExamplesStub stub; + + /** Constructs an instance of ExamplesClient with default settings. */ + public static final ExamplesClient create() throws IOException { + return create(ExamplesSettings.newBuilder().build()); + } + + /** + * 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. + */ + public static final ExamplesClient create(ExamplesSettings settings) throws IOException { + return new ExamplesClient(settings); + } + + /** + * Constructs an instance of ExamplesClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(ExamplesSettings). + */ + public static final ExamplesClient create(ExamplesStub stub) { + return new ExamplesClient(stub); + } + + /** + * 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. + */ + protected ExamplesClient(ExamplesSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ExamplesStubSettings) settings.getStubSettings()).createStub(); + } + + protected ExamplesClient(ExamplesStub stub) { + this.settings = null; + this.stub = stub; + } + + public final ExamplesSettings getSettings() { + return settings; + } + + public ExamplesStub getStub() { + return stub; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates an example in the specified playbook. + * + *
Sample code: + * + *
{@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); + * } + * }+ * + * @param parent Required. The playbook to create an example for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook + * ID>`. + * @param example Required. The example to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Example createExample(PlaybookName parent, Example example) { + CreateExampleRequest request = + CreateExampleRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setExample(example) + .build(); + return createExample(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates an example in the specified playbook. + * + *
Sample code: + * + *
{@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); + * } + * }+ * + * @param parent Required. The playbook to create an example for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook + * ID>`. + * @param example Required. The example to create. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Example createExample(String parent, Example example) { + CreateExampleRequest request = + CreateExampleRequest.newBuilder().setParent(parent).setExample(example).build(); + return createExample(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates an example in the specified playbook. + * + *
Sample code: + * + *
{@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); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Example createExample(CreateExampleRequest request) { + return createExampleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates an example in the specified playbook. + * + *
Sample code: + * + *
{@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+ */ + public final UnaryCallablefuture = examplesClient.createExampleCallable().futureCall(request); + * // Do something. + * Example response = future.get(); + * } + * }
Sample code: + * + *
{@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); + * } + * }+ * + * @param name Required. The name of the example to delete. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook + * ID>/examples/<Example ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteExample(ExampleName name) { + DeleteExampleRequest request = + DeleteExampleRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteExample(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified example. + * + *
Sample code: + * + *
{@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); + * } + * }+ * + * @param name Required. The name of the example to delete. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook + * ID>/examples/<Example ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteExample(String name) { + DeleteExampleRequest request = DeleteExampleRequest.newBuilder().setName(name).build(); + deleteExample(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified example. + * + *
Sample code: + * + *
{@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); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteExample(DeleteExampleRequest request) { + deleteExampleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes the specified example. + * + *
Sample code: + * + *
{@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+ */ + public final UnaryCallablefuture = examplesClient.deleteExampleCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@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); + * } + * } + * }+ * + * @param parent Required. The playbook to list the examples from. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook + * ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExamplesPagedResponse listExamples(PlaybookName parent) { + ListExamplesRequest request = + ListExamplesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listExamples(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of examples in the specified playbook. + * + *
Sample code: + * + *
{@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); + * } + * } + * }+ * + * @param parent Required. The playbook to list the examples from. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook + * ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExamplesPagedResponse listExamples(String parent) { + ListExamplesRequest request = ListExamplesRequest.newBuilder().setParent(parent).build(); + return listExamples(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of examples in the specified playbook. + * + *
Sample code: + * + *
{@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); + * } + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListExamplesPagedResponse listExamples(ListExamplesRequest request) { + return listExamplesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of examples in the specified playbook. + * + *
Sample code: + * + *
{@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+ */ + public final UnaryCallablefuture = examplesClient.listExamplesPagedCallable().futureCall(request); + * // Do something. + * for (Example element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@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; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@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); + * } + * }+ * + * @param name Required. The name of the example. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook + * ID>/examples/<Example ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Example getExample(ExampleName name) { + GetExampleRequest request = + GetExampleRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getExample(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the specified example. + * + *
Sample code: + * + *
{@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); + * } + * }+ * + * @param name Required. The name of the example. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook + * ID>/examples/<Example ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Example getExample(String name) { + GetExampleRequest request = GetExampleRequest.newBuilder().setName(name).build(); + return getExample(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the specified example. + * + *
Sample code: + * + *
{@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); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Example getExample(GetExampleRequest request) { + return getExampleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the specified example. + * + *
Sample code: + * + *
{@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+ */ + public final UnaryCallablefuture = examplesClient.getExampleCallable().futureCall(request); + * // Do something. + * Example response = future.get(); + * } + * }
Sample code: + * + *
{@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); + * } + * }+ * + * @param example Required. The example to update. + * @param updateMask Optional. The mask to control which fields get updated. If the mask is not + * present, all fields will be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Example updateExample(Example example, FieldMask updateMask) { + UpdateExampleRequest request = + UpdateExampleRequest.newBuilder().setExample(example).setUpdateMask(updateMask).build(); + return updateExample(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update the specified example. + * + *
Sample code: + * + *
{@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); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Example updateExample(UpdateExampleRequest request) { + return updateExampleCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update the specified example. + * + *
Sample code: + * + *
{@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+ */ + public final UnaryCallablefuture = examplesClient.updateExampleCallable().futureCall(request); + * // Do something. + * Example response = future.get(); + * } + * }
Sample code: + * + *
{@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); + * } + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *
Sample code: + * + *
{@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+ */ + public final UnaryCallablefuture = examplesClient.listLocationsPagedCallable().futureCall(request); + * // Do something. + * for (Location element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@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; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@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); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *
Sample code: + * + *
{@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+ */ + public final UnaryCallablefuture = examplesClient.getLocationCallable().futureCall(request); + * // Do something. + * Location response = future.get(); + * } + * }
The default instance has everything set to sensible defaults: + * + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the total timeout of createExample to 30 seconds: + * + *
{@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 + * ExamplesSettings.Builder examplesSettingsBuilder = ExamplesSettings.newBuilder(); + * examplesSettingsBuilder + * .createExampleSettings() + * .setRetrySettings( + * examplesSettingsBuilder + * .createExampleSettings() + * .getRetrySettings() + * .toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); + * ExamplesSettings examplesSettings = examplesSettingsBuilder.build(); + * }+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ExamplesSettings extends ClientSettings
Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction 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:
+ *
+ * Note: close() needs to be called on the PlaybooksClient object to clean up resources such as
+ * threads. In the example above, try-with-resources is used, which automatically calls close().
+ *
+ * CreatePlaybook Creates a playbook in a specified agent. Request object method variants only take one parameter, a request object, which must be constructed before the call. createPlaybook(CreatePlaybookRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. createPlaybook(AgentName parent, Playbook playbook)
+ * createPlaybook(String parent, Playbook playbook)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. createPlaybookCallable()
+ * DeletePlaybook Deletes a specified playbook. Request object method variants only take one parameter, a request object, which must be constructed before the call. deletePlaybook(DeletePlaybookRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. deletePlaybook(PlaybookName name)
+ * deletePlaybook(String name)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. deletePlaybookCallable()
+ * ListPlaybooks Returns a list of playbooks in the specified agent. Request object method variants only take one parameter, a request object, which must be constructed before the call. listPlaybooks(ListPlaybooksRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. listPlaybooks(AgentName parent)
+ * listPlaybooks(String parent)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. listPlaybooksPagedCallable()
+ * listPlaybooksCallable()
+ * GetPlaybook Retrieves the specified Playbook. Request object method variants only take one parameter, a request object, which must be constructed before the call. getPlaybook(GetPlaybookRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. getPlaybook(PlaybookName name)
+ * getPlaybook(String name)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. getPlaybookCallable()
+ * UpdatePlaybook Updates the specified Playbook. Request object method variants only take one parameter, a request object, which must be constructed before the call. updatePlaybook(UpdatePlaybookRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. updatePlaybook(Playbook playbook, FieldMask updateMask)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. updatePlaybookCallable()
+ * CreatePlaybookVersion Creates a version for the specified Playbook. Request object method variants only take one parameter, a request object, which must be constructed before the call. createPlaybookVersion(CreatePlaybookVersionRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. createPlaybookVersion(PlaybookName parent, PlaybookVersion playbookVersion)
+ * createPlaybookVersion(String parent, PlaybookVersion playbookVersion)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. createPlaybookVersionCallable()
+ * GetPlaybookVersion Retrieves the specified version of the Playbook. Request object method variants only take one parameter, a request object, which must be constructed before the call. getPlaybookVersion(GetPlaybookVersionRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. getPlaybookVersion(PlaybookVersionName name)
+ * getPlaybookVersion(String name)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. getPlaybookVersionCallable()
+ * ListPlaybookVersions Lists versions for the specified Playbook. Request object method variants only take one parameter, a request object, which must be constructed before the call. listPlaybookVersions(ListPlaybookVersionsRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. listPlaybookVersions(PlaybookName parent)
+ * listPlaybookVersions(String parent)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. listPlaybookVersionsPagedCallable()
+ * listPlaybookVersionsCallable()
+ * DeletePlaybookVersion Deletes the specified version of the Playbook. Request object method variants only take one parameter, a request object, which must be constructed before the call. deletePlaybookVersion(DeletePlaybookVersionRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. deletePlaybookVersion(PlaybookVersionName name)
+ * deletePlaybookVersion(String name)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. deletePlaybookVersionCallable()
+ * ListLocations Lists information about the supported locations for this service. Request object method variants only take one parameter, a request object, which must be constructed before the call. listLocations(ListLocationsRequest request)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. listLocationsPagedCallable()
+ * listLocationsCallable()
+ * GetLocation Gets information about a location. Request object method variants only take one parameter, a request object, which must be constructed before the call. getLocation(GetLocationRequest request)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. getLocationCallable()
+ * See the individual methods for example code.
+ *
+ * Many parameters require resource names to be formatted in a particular way. To assist with
+ * these names, this class includes a format method for each type of name, and additionally a parse
+ * method to extract the individual identifiers contained within names that are returned.
+ *
+ * This class can be customized by passing in a custom instance of PlaybooksSettings to create().
+ * For example:
+ *
+ * To customize credentials:
+ *
+ * To customize the endpoint:
+ *
+ * To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
+ * the wire:
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class PlaybooksClient implements BackgroundResource {
+ private final PlaybooksSettings settings;
+ private final PlaybooksStub stub;
+
+ /** Constructs an instance of PlaybooksClient with default settings. */
+ public static final PlaybooksClient create() throws IOException {
+ return create(PlaybooksSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of PlaybooksClient, using the given settings. The channels are created
+ * based on the settings passed in, or defaults for any settings that are not set.
+ */
+ public static final PlaybooksClient create(PlaybooksSettings settings) throws IOException {
+ return new PlaybooksClient(settings);
+ }
+
+ /**
+ * Constructs an instance of PlaybooksClient, using the given stub for making calls. This is for
+ * advanced usage - prefer using create(PlaybooksSettings).
+ */
+ public static final PlaybooksClient create(PlaybooksStub stub) {
+ return new PlaybooksClient(stub);
+ }
+
+ /**
+ * Constructs an instance of PlaybooksClient, using the given settings. This is protected so that
+ * it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
+ */
+ protected PlaybooksClient(PlaybooksSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((PlaybooksStubSettings) settings.getStubSettings()).createStub();
+ }
+
+ protected PlaybooksClient(PlaybooksStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final PlaybooksSettings getSettings() {
+ return settings;
+ }
+
+ public PlaybooksStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a playbook in a specified agent.
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * Sample code:
+ *
+ * The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the total timeout of createPlaybook to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+ * Playbook playbook = Playbook.newBuilder().build();
+ * Playbook response = playbooksClient.createPlaybook(parent, playbook);
+ * }
+ * }
+ *
+ *
+ *
+ *
+ *
+ *
+ * Method
+ * Description
+ * Method Variants
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ *
+ * {@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
+ * PlaybooksSettings playbooksSettings =
+ * PlaybooksSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * PlaybooksClient playbooksClient = PlaybooksClient.create(playbooksSettings);
+ * }
+ *
+ * {@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
+ * PlaybooksSettings playbooksSettings =
+ * PlaybooksSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * PlaybooksClient playbooksClient = PlaybooksClient.create(playbooksSettings);
+ * }
+ *
+ * {@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
+ * PlaybooksSettings playbooksSettings = PlaybooksSettings.newHttpJsonBuilder().build();
+ * PlaybooksClient playbooksClient = PlaybooksClient.create(playbooksSettings);
+ * }
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+ * Playbook playbook = Playbook.newBuilder().build();
+ * Playbook response = playbooksClient.createPlaybook(parent, playbook);
+ * }
+ * }
+ *
+ * @param parent Required. The agent to create a playbook for. Format: `projects/<Project
+ * ID>/locations/<Location ID>/agents/<Agent ID>`.
+ * @param playbook Required. The playbook to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Playbook createPlaybook(AgentName parent, Playbook playbook) {
+ CreatePlaybookRequest request =
+ CreatePlaybookRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setPlaybook(playbook)
+ .build();
+ return createPlaybook(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a playbook in a specified agent.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString();
+ * Playbook playbook = Playbook.newBuilder().build();
+ * Playbook response = playbooksClient.createPlaybook(parent, playbook);
+ * }
+ * }
+ *
+ * @param parent Required. The agent to create a playbook for. Format: `projects/<Project
+ * ID>/locations/<Location ID>/agents/<Agent ID>`.
+ * @param playbook Required. The playbook to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Playbook createPlaybook(String parent, Playbook playbook) {
+ CreatePlaybookRequest request =
+ CreatePlaybookRequest.newBuilder().setParent(parent).setPlaybook(playbook).build();
+ return createPlaybook(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a playbook in a specified agent.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * CreatePlaybookRequest request =
+ * CreatePlaybookRequest.newBuilder()
+ * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
+ * .setPlaybook(Playbook.newBuilder().build())
+ * .build();
+ * Playbook response = playbooksClient.createPlaybook(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Playbook createPlaybook(CreatePlaybookRequest request) {
+ return createPlaybookCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a playbook in a specified agent.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * CreatePlaybookRequest request =
+ * CreatePlaybookRequest.newBuilder()
+ * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
+ * .setPlaybook(Playbook.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * PlaybookName name = PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]");
+ * playbooksClient.deletePlaybook(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the playbook to delete. Format: `projects/<Project
+ * ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook
+ * ID>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deletePlaybook(PlaybookName name) {
+ DeletePlaybookRequest request =
+ DeletePlaybookRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deletePlaybook(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a specified playbook.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * String name = PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString();
+ * playbooksClient.deletePlaybook(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the playbook to delete. Format: `projects/<Project
+ * ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook
+ * ID>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deletePlaybook(String name) {
+ DeletePlaybookRequest request = DeletePlaybookRequest.newBuilder().setName(name).build();
+ deletePlaybook(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a specified playbook.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * DeletePlaybookRequest request =
+ * DeletePlaybookRequest.newBuilder()
+ * .setName(
+ * PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
+ * .build();
+ * playbooksClient.deletePlaybook(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deletePlaybook(DeletePlaybookRequest request) {
+ deletePlaybookCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a specified playbook.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * DeletePlaybookRequest request =
+ * DeletePlaybookRequest.newBuilder()
+ * .setName(
+ * PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+ * for (Playbook element : playbooksClient.listPlaybooks(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The agent to list playbooks from. Format: `projects/<Project
+ * ID>/locations/<Location ID>/agents/<Agent ID>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListPlaybooksPagedResponse listPlaybooks(AgentName parent) {
+ ListPlaybooksRequest request =
+ ListPlaybooksRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listPlaybooks(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns a list of playbooks in the specified agent.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString();
+ * for (Playbook element : playbooksClient.listPlaybooks(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The agent to list playbooks from. Format: `projects/<Project
+ * ID>/locations/<Location ID>/agents/<Agent ID>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListPlaybooksPagedResponse listPlaybooks(String parent) {
+ ListPlaybooksRequest request = ListPlaybooksRequest.newBuilder().setParent(parent).build();
+ return listPlaybooks(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns a list of playbooks in the specified agent.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * ListPlaybooksRequest request =
+ * ListPlaybooksRequest.newBuilder()
+ * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (Playbook element : playbooksClient.listPlaybooks(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListPlaybooksPagedResponse listPlaybooks(ListPlaybooksRequest request) {
+ return listPlaybooksPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Returns a list of playbooks in the specified agent.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * ListPlaybooksRequest request =
+ * ListPlaybooksRequest.newBuilder()
+ * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * ListPlaybooksRequest request =
+ * ListPlaybooksRequest.newBuilder()
+ * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListPlaybooksResponse response = playbooksClient.listPlaybooksCallable().call(request);
+ * for (Playbook element : response.getPlaybooksList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * PlaybookName name = PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]");
+ * Playbook response = playbooksClient.getPlaybook(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the playbook. Format: `projects/<Project
+ * ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook
+ * ID>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Playbook getPlaybook(PlaybookName name) {
+ GetPlaybookRequest request =
+ GetPlaybookRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getPlaybook(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Retrieves the specified Playbook.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * String name = PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString();
+ * Playbook response = playbooksClient.getPlaybook(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the playbook. Format: `projects/<Project
+ * ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook
+ * ID>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Playbook getPlaybook(String name) {
+ GetPlaybookRequest request = GetPlaybookRequest.newBuilder().setName(name).build();
+ return getPlaybook(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Retrieves the specified Playbook.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * GetPlaybookRequest request =
+ * GetPlaybookRequest.newBuilder()
+ * .setName(
+ * PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
+ * .build();
+ * Playbook response = playbooksClient.getPlaybook(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Playbook getPlaybook(GetPlaybookRequest request) {
+ return getPlaybookCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Retrieves the specified Playbook.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * GetPlaybookRequest request =
+ * GetPlaybookRequest.newBuilder()
+ * .setName(
+ * PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * Playbook playbook = Playbook.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * Playbook response = playbooksClient.updatePlaybook(playbook, updateMask);
+ * }
+ * }
+ *
+ * @param playbook Required. The playbook to update.
+ * @param updateMask The mask to control which fields get updated. If the mask is not present, all
+ * fields will be updated.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Playbook updatePlaybook(Playbook playbook, FieldMask updateMask) {
+ UpdatePlaybookRequest request =
+ UpdatePlaybookRequest.newBuilder().setPlaybook(playbook).setUpdateMask(updateMask).build();
+ return updatePlaybook(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates the specified Playbook.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * UpdatePlaybookRequest request =
+ * UpdatePlaybookRequest.newBuilder()
+ * .setPlaybook(Playbook.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * Playbook response = playbooksClient.updatePlaybook(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Playbook updatePlaybook(UpdatePlaybookRequest request) {
+ return updatePlaybookCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates the specified Playbook.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * UpdatePlaybookRequest request =
+ * UpdatePlaybookRequest.newBuilder()
+ * .setPlaybook(Playbook.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * PlaybookName parent = PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]");
+ * PlaybookVersion playbookVersion = PlaybookVersion.newBuilder().build();
+ * PlaybookVersion response = playbooksClient.createPlaybookVersion(parent, playbookVersion);
+ * }
+ * }
+ *
+ * @param parent Required. The playbook to create a version for. Format: `projects/<Project
+ * ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook
+ * ID>`.
+ * @param playbookVersion Required. The playbook version to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PlaybookVersion createPlaybookVersion(
+ PlaybookName parent, PlaybookVersion playbookVersion) {
+ CreatePlaybookVersionRequest request =
+ CreatePlaybookVersionRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setPlaybookVersion(playbookVersion)
+ .build();
+ return createPlaybookVersion(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a version for the specified Playbook.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * String parent =
+ * PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString();
+ * PlaybookVersion playbookVersion = PlaybookVersion.newBuilder().build();
+ * PlaybookVersion response = playbooksClient.createPlaybookVersion(parent, playbookVersion);
+ * }
+ * }
+ *
+ * @param parent Required. The playbook to create a version for. Format: `projects/<Project
+ * ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook
+ * ID>`.
+ * @param playbookVersion Required. The playbook version to create.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PlaybookVersion createPlaybookVersion(
+ String parent, PlaybookVersion playbookVersion) {
+ CreatePlaybookVersionRequest request =
+ CreatePlaybookVersionRequest.newBuilder()
+ .setParent(parent)
+ .setPlaybookVersion(playbookVersion)
+ .build();
+ return createPlaybookVersion(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a version for the specified Playbook.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * CreatePlaybookVersionRequest request =
+ * CreatePlaybookVersionRequest.newBuilder()
+ * .setParent(
+ * PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
+ * .setPlaybookVersion(PlaybookVersion.newBuilder().build())
+ * .build();
+ * PlaybookVersion response = playbooksClient.createPlaybookVersion(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PlaybookVersion createPlaybookVersion(CreatePlaybookVersionRequest request) {
+ return createPlaybookVersionCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a version for the specified Playbook.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * CreatePlaybookVersionRequest request =
+ * CreatePlaybookVersionRequest.newBuilder()
+ * .setParent(
+ * PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
+ * .setPlaybookVersion(PlaybookVersion.newBuilder().build())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * PlaybookVersionName name =
+ * PlaybookVersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]");
+ * PlaybookVersion response = playbooksClient.getPlaybookVersion(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the playbook version. Format: `projects/<Project
+ * ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook
+ * ID>/versions/<Version ID>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PlaybookVersion getPlaybookVersion(PlaybookVersionName name) {
+ GetPlaybookVersionRequest request =
+ GetPlaybookVersionRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ return getPlaybookVersion(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Retrieves the specified version of the Playbook.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * String name =
+ * PlaybookVersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]")
+ * .toString();
+ * PlaybookVersion response = playbooksClient.getPlaybookVersion(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the playbook version. Format: `projects/<Project
+ * ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook
+ * ID>/versions/<Version ID>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PlaybookVersion getPlaybookVersion(String name) {
+ GetPlaybookVersionRequest request =
+ GetPlaybookVersionRequest.newBuilder().setName(name).build();
+ return getPlaybookVersion(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Retrieves the specified version of the Playbook.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * GetPlaybookVersionRequest request =
+ * GetPlaybookVersionRequest.newBuilder()
+ * .setName(
+ * PlaybookVersionName.of(
+ * "[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]")
+ * .toString())
+ * .build();
+ * PlaybookVersion response = playbooksClient.getPlaybookVersion(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final PlaybookVersion getPlaybookVersion(GetPlaybookVersionRequest request) {
+ return getPlaybookVersionCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Retrieves the specified version of the Playbook.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * GetPlaybookVersionRequest request =
+ * GetPlaybookVersionRequest.newBuilder()
+ * .setName(
+ * PlaybookVersionName.of(
+ * "[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]")
+ * .toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * PlaybookName parent = PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]");
+ * for (PlaybookVersion element : playbooksClient.listPlaybookVersions(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The playbook to list versions for. Format: `projects/<Project
+ * ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook
+ * ID>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListPlaybookVersionsPagedResponse listPlaybookVersions(PlaybookName parent) {
+ ListPlaybookVersionsRequest request =
+ ListPlaybookVersionsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listPlaybookVersions(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists versions for the specified Playbook.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * String parent =
+ * PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString();
+ * for (PlaybookVersion element : playbooksClient.listPlaybookVersions(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The playbook to list versions for. Format: `projects/<Project
+ * ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook
+ * ID>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListPlaybookVersionsPagedResponse listPlaybookVersions(String parent) {
+ ListPlaybookVersionsRequest request =
+ ListPlaybookVersionsRequest.newBuilder().setParent(parent).build();
+ return listPlaybookVersions(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists versions for the specified Playbook.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * ListPlaybookVersionsRequest request =
+ * ListPlaybookVersionsRequest.newBuilder()
+ * .setParent(
+ * PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (PlaybookVersion element : playbooksClient.listPlaybookVersions(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListPlaybookVersionsPagedResponse listPlaybookVersions(
+ ListPlaybookVersionsRequest request) {
+ return listPlaybookVersionsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists versions for the specified Playbook.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * ListPlaybookVersionsRequest request =
+ * ListPlaybookVersionsRequest.newBuilder()
+ * .setParent(
+ * PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * ListPlaybookVersionsRequest request =
+ * ListPlaybookVersionsRequest.newBuilder()
+ * .setParent(
+ * PlaybookName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListPlaybookVersionsResponse response =
+ * playbooksClient.listPlaybookVersionsCallable().call(request);
+ * for (PlaybookVersion element : response.getPlaybookVersionsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * PlaybookVersionName name =
+ * PlaybookVersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]");
+ * playbooksClient.deletePlaybookVersion(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the playbook version to delete. Format: `projects/<Project
+ * ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook
+ * ID>/versions/<Version ID>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deletePlaybookVersion(PlaybookVersionName name) {
+ DeletePlaybookVersionRequest request =
+ DeletePlaybookVersionRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ deletePlaybookVersion(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes the specified version of the Playbook.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * String name =
+ * PlaybookVersionName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]")
+ * .toString();
+ * playbooksClient.deletePlaybookVersion(name);
+ * }
+ * }
+ *
+ * @param name Required. The name of the playbook version to delete. Format: `projects/<Project
+ * ID>/locations/<Location ID>/agents/<Agent ID>/playbooks/<Playbook
+ * ID>/versions/<Version ID>`.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deletePlaybookVersion(String name) {
+ DeletePlaybookVersionRequest request =
+ DeletePlaybookVersionRequest.newBuilder().setName(name).build();
+ deletePlaybookVersion(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes the specified version of the Playbook.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * DeletePlaybookVersionRequest request =
+ * DeletePlaybookVersionRequest.newBuilder()
+ * .setName(
+ * PlaybookVersionName.of(
+ * "[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]")
+ * .toString())
+ * .build();
+ * playbooksClient.deletePlaybookVersion(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deletePlaybookVersion(DeletePlaybookVersionRequest request) {
+ deletePlaybookVersionCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes the specified version of the Playbook.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * DeletePlaybookVersionRequest request =
+ * DeletePlaybookVersionRequest.newBuilder()
+ * .setName(
+ * PlaybookVersionName.of(
+ * "[PROJECT]", "[LOCATION]", "[AGENT]", "[PLAYBOOK]", "[VERSION]")
+ * .toString())
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (Location element : playbooksClient.listLocations(request).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) {
+ return listLocationsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists information about the supported locations for this service.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListLocationsResponse response = playbooksClient.listLocationsCallable().call(request);
+ * for (Location element : response.getLocationsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallable{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * Location response = playbooksClient.getLocation(request);
+ * }
+ * }
+ *
+ * @param request The request object containing all of the parameters for the API call.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Location getLocation(GetLocationRequest request) {
+ return getLocationCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets information about a location.
+ *
+ * {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * ApiFuture
+ */
+ public final UnaryCallable
+ *
+ *
+ * {@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
+ * PlaybooksSettings.Builder playbooksSettingsBuilder = PlaybooksSettings.newBuilder();
+ * playbooksSettingsBuilder
+ * .createPlaybookSettings()
+ * .setRetrySettings(
+ * playbooksSettingsBuilder
+ * .createPlaybookSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * PlaybooksSettings playbooksSettings = playbooksSettingsBuilder.build();
+ * }
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class PlaybooksSettings extends ClientSettings
ServerStreamingDetectIntent
Processes a natural language query and returns structured, actionable data as a result through server-side streaming. Server-side streaming allows Dialogflow to send [partial responses](https://cloud.google.com/dialogflow/cx/docs/concept/fulfillment#partial-response) earlier in a single request.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
+ *serverStreamingDetectIntentCallable() + *
StreamingDetectIntent
Processes a natural language query in audio format in a streaming fashion and returns structured, actionable data as a result. This method is only available via the gRPC API (not REST). *
Note: Always use agent versions for production traffic. See [Versions and environments](https://cloud.google.com/dialogflow/cx/docs/concept/version).
Sample code: + * + *
{@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 (SessionsClient sessionsClient = SessionsClient.create()) { + * DetectIntentRequest request = + * DetectIntentRequest.newBuilder() + * .setSession( + * SessionName.ofProjectLocationAgentSessionName( + * "[PROJECT]", "[LOCATION]", "[AGENT]", "[SESSION]") + * .toString()) + * .setQueryParams(QueryParameters.newBuilder().build()) + * .setQueryInput(QueryInput.newBuilder().build()) + * .setOutputAudioConfig(OutputAudioConfig.newBuilder().build()) + * .build(); + * ServerStream+ */ + public final ServerStreamingCallablestream = + * sessionsClient.serverStreamingDetectIntentCallable().call(request); + * for (DetectIntentResponse response : stream) { + * // Do something when a response is received. + * } + * } + * }
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: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + * Tool tool = Tool.newBuilder().build(); + * Tool response = toolsClient.createTool(parent, tool); + * } + * }+ * + *
Note: close() needs to be called on the ToolsClient 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 | + *
---|---|---|
CreateTool |
+ * Creates a [Tool][google.cloud.dialogflow.cx.v3beta1.Tool] in the specified agent. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ListTools |
+ * Returns a list of [Tools][google.cloud.dialogflow.cx.v3beta1.Tool] in the specified agent. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
ExportTools |
+ * Exports the selected tools. |
+ *
+ * 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. + *
|
+ *
GetTool |
+ * Retrieves the specified [Tool][google.cloud.dialogflow.cx.v3beta1.Tool]. |
+ *
+ * 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. + *
|
+ *
UpdateTool |
+ * Update the specified [Tool][google.cloud.dialogflow.cx.v3beta1.Tool]. |
+ *
+ * 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. + *
|
+ *
DeleteTool |
+ * Deletes a specified [Tool][google.cloud.dialogflow.cx.v3beta1.Tool]. |
+ *
+ * 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 ToolsSettings to create(). For + * example: + * + *
To customize credentials: + * + *
{@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 + * ToolsSettings toolsSettings = + * ToolsSettings.newBuilder() + * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + * .build(); + * ToolsClient toolsClient = ToolsClient.create(toolsSettings); + * }+ * + *
To customize the endpoint: + * + *
{@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 + * ToolsSettings toolsSettings = ToolsSettings.newBuilder().setEndpoint(myEndpoint).build(); + * ToolsClient toolsClient = ToolsClient.create(toolsSettings); + * }+ * + *
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over + * the wire: + * + *
{@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 + * ToolsSettings toolsSettings = ToolsSettings.newHttpJsonBuilder().build(); + * ToolsClient toolsClient = ToolsClient.create(toolsSettings); + * }+ * + *
Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class ToolsClient implements BackgroundResource { + private final ToolsSettings settings; + private final ToolsStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of ToolsClient with default settings. */ + public static final ToolsClient create() throws IOException { + return create(ToolsSettings.newBuilder().build()); + } + + /** + * Constructs an instance of ToolsClient, using the given settings. The channels are created based + * on the settings passed in, or defaults for any settings that are not set. + */ + public static final ToolsClient create(ToolsSettings settings) throws IOException { + return new ToolsClient(settings); + } + + /** + * Constructs an instance of ToolsClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(ToolsSettings). + */ + public static final ToolsClient create(ToolsStub stub) { + return new ToolsClient(stub); + } + + /** + * Constructs an instance of ToolsClient, 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. + */ + protected ToolsClient(ToolsSettings settings) throws IOException { + this.settings = settings; + this.stub = ((ToolsStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected ToolsClient(ToolsStub stub) { + this.settings = null; + this.stub = stub; + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final ToolsSettings getSettings() { + return settings; + } + + public ToolsStub getStub() { + return stub; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + public final com.google.longrunning.OperationsClient getOperationsClient() { + return operationsClient; + } + + /** + * Returns the OperationsClient that can be used to query the status of a long-running operation + * returned by another API method call. + */ + @BetaApi + public final OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Tool][google.cloud.dialogflow.cx.v3beta1.Tool] in the specified agent. + * + *
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + * Tool tool = Tool.newBuilder().build(); + * Tool response = toolsClient.createTool(parent, tool); + * } + * }+ * + * @param parent Required. The agent to create a Tool for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @param tool Required. The Tool to be created. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Tool createTool(AgentName parent, Tool tool) { + CreateToolRequest request = + CreateToolRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setTool(tool) + .build(); + return createTool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Tool][google.cloud.dialogflow.cx.v3beta1.Tool] in the specified agent. + * + *
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString(); + * Tool tool = Tool.newBuilder().build(); + * Tool response = toolsClient.createTool(parent, tool); + * } + * }+ * + * @param parent Required. The agent to create a Tool for. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @param tool Required. The Tool to be created. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Tool createTool(String parent, Tool tool) { + CreateToolRequest request = + CreateToolRequest.newBuilder().setParent(parent).setTool(tool).build(); + return createTool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Tool][google.cloud.dialogflow.cx.v3beta1.Tool] in the specified agent. + * + *
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * CreateToolRequest request = + * CreateToolRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .setTool(Tool.newBuilder().build()) + * .build(); + * Tool response = toolsClient.createTool(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Tool createTool(CreateToolRequest request) { + return createToolCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a [Tool][google.cloud.dialogflow.cx.v3beta1.Tool] in the specified agent. + * + *
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * CreateToolRequest request = + * CreateToolRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .setTool(Tool.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = toolsClient.createToolCallable().futureCall(request); + * // Do something. + * Tool response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]"); + * for (Tool element : toolsClient.listTools(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The agent to list the Tools from. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListToolsPagedResponse listTools(AgentName parent) { + ListToolsRequest request = + ListToolsRequest.newBuilder().setParent(parent == null ? null : parent.toString()).build(); + return listTools(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of [Tools][google.cloud.dialogflow.cx.v3beta1.Tool] in the specified agent. + * + *
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * String parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString(); + * for (Tool element : toolsClient.listTools(parent).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param parent Required. The agent to list the Tools from. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListToolsPagedResponse listTools(String parent) { + ListToolsRequest request = ListToolsRequest.newBuilder().setParent(parent).build(); + return listTools(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of [Tools][google.cloud.dialogflow.cx.v3beta1.Tool] in the specified agent. + * + *
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * ListToolsRequest request = + * ListToolsRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Tool element : toolsClient.listTools(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListToolsPagedResponse listTools(ListToolsRequest request) { + return listToolsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Returns a list of [Tools][google.cloud.dialogflow.cx.v3beta1.Tool] in the specified agent. + * + *
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * ListToolsRequest request = + * ListToolsRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = toolsClient.listToolsPagedCallable().futureCall(request); + * // Do something. + * for (Tool element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * ListToolsRequest request = + * ListToolsRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListToolsResponse response = toolsClient.listToolsCallable().call(request); + * for (Tool element : response.getToolsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * ExportToolsRequest request = + * ExportToolsRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .addAllTools(new ArrayList+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture()) + * .build(); + * ExportToolsResponse response = toolsClient.exportToolsAsync(request).get(); + * } + * }
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * ExportToolsRequest request = + * ExportToolsRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .addAllTools(new ArrayList+ */ + public final OperationCallable()) + * .build(); + * OperationFuture future = + * toolsClient.exportToolsOperationCallable().futureCall(request); + * // Do something. + * ExportToolsResponse response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * ExportToolsRequest request = + * ExportToolsRequest.newBuilder() + * .setParent(AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]").toString()) + * .addAllTools(new ArrayList+ */ + public final UnaryCallable()) + * .build(); + * ApiFuture future = toolsClient.exportToolsCallable().futureCall(request); + * // Do something. + * Operation response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * ToolName name = ToolName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TOOL]"); + * Tool response = toolsClient.getTool(name); + * } + * }+ * + * @param name Required. The name of the Tool. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/tools/<Tool ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Tool getTool(ToolName name) { + GetToolRequest request = + GetToolRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getTool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the specified [Tool][google.cloud.dialogflow.cx.v3beta1.Tool]. + * + *
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * String name = ToolName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TOOL]").toString(); + * Tool response = toolsClient.getTool(name); + * } + * }+ * + * @param name Required. The name of the Tool. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/tools/<Tool ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Tool getTool(String name) { + GetToolRequest request = GetToolRequest.newBuilder().setName(name).build(); + return getTool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the specified [Tool][google.cloud.dialogflow.cx.v3beta1.Tool]. + * + *
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * GetToolRequest request = + * GetToolRequest.newBuilder() + * .setName(ToolName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TOOL]").toString()) + * .build(); + * Tool response = toolsClient.getTool(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Tool getTool(GetToolRequest request) { + return getToolCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Retrieves the specified [Tool][google.cloud.dialogflow.cx.v3beta1.Tool]. + * + *
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * GetToolRequest request = + * GetToolRequest.newBuilder() + * .setName(ToolName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TOOL]").toString()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = toolsClient.getToolCallable().futureCall(request); + * // Do something. + * Tool response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * Tool tool = Tool.newBuilder().build(); + * FieldMask updateMask = FieldMask.newBuilder().build(); + * Tool response = toolsClient.updateTool(tool, updateMask); + * } + * }+ * + * @param tool Required. The Tool to be updated. + * @param updateMask The mask to control which fields get updated. If the mask is not present, all + * fields will be updated. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Tool updateTool(Tool tool, FieldMask updateMask) { + UpdateToolRequest request = + UpdateToolRequest.newBuilder().setTool(tool).setUpdateMask(updateMask).build(); + return updateTool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update the specified [Tool][google.cloud.dialogflow.cx.v3beta1.Tool]. + * + *
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * UpdateToolRequest request = + * UpdateToolRequest.newBuilder() + * .setTool(Tool.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * Tool response = toolsClient.updateTool(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Tool updateTool(UpdateToolRequest request) { + return updateToolCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Update the specified [Tool][google.cloud.dialogflow.cx.v3beta1.Tool]. + * + *
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * UpdateToolRequest request = + * UpdateToolRequest.newBuilder() + * .setTool(Tool.newBuilder().build()) + * .setUpdateMask(FieldMask.newBuilder().build()) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = toolsClient.updateToolCallable().futureCall(request); + * // Do something. + * Tool response = future.get(); + * } + * }
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * ToolName name = ToolName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TOOL]"); + * toolsClient.deleteTool(name); + * } + * }+ * + * @param name Required. The name of the Tool to be deleted. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/tools/<Tool ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteTool(ToolName name) { + DeleteToolRequest request = + DeleteToolRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + deleteTool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a specified [Tool][google.cloud.dialogflow.cx.v3beta1.Tool]. + * + *
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * String name = ToolName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TOOL]").toString(); + * toolsClient.deleteTool(name); + * } + * }+ * + * @param name Required. The name of the Tool to be deleted. Format: `projects/<Project + * ID>/locations/<Location ID>/agents/<Agent ID>/tools/<Tool ID>`. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteTool(String name) { + DeleteToolRequest request = DeleteToolRequest.newBuilder().setName(name).build(); + deleteTool(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a specified [Tool][google.cloud.dialogflow.cx.v3beta1.Tool]. + * + *
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * DeleteToolRequest request = + * DeleteToolRequest.newBuilder() + * .setName(ToolName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TOOL]").toString()) + * .setForce(true) + * .build(); + * toolsClient.deleteTool(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final void deleteTool(DeleteToolRequest request) { + deleteToolCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a specified [Tool][google.cloud.dialogflow.cx.v3beta1.Tool]. + * + *
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * DeleteToolRequest request = + * DeleteToolRequest.newBuilder() + * .setName(ToolName.of("[PROJECT]", "[LOCATION]", "[AGENT]", "[TOOL]").toString()) + * .setForce(true) + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = toolsClient.deleteToolCallable().futureCall(request); + * // Do something. + * future.get(); + * } + * }
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * ListLocationsRequest request = + * ListLocationsRequest.newBuilder() + * .setName("name3373707") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * for (Location element : toolsClient.listLocations(request).iterateAll()) { + * // doThingsWith(element); + * } + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListLocationsPagedResponse listLocations(ListLocationsRequest request) { + return listLocationsPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists information about the supported locations for this service. + * + *
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * ListLocationsRequest request = + * ListLocationsRequest.newBuilder() + * .setName("name3373707") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * ApiFuture+ */ + public final UnaryCallablefuture = toolsClient.listLocationsPagedCallable().futureCall(request); + * // Do something. + * for (Location element : future.get().iterateAll()) { + * // doThingsWith(element); + * } + * } + * }
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * ListLocationsRequest request = + * ListLocationsRequest.newBuilder() + * .setName("name3373707") + * .setFilter("filter-1274492040") + * .setPageSize(883849137) + * .setPageToken("pageToken873572522") + * .build(); + * while (true) { + * ListLocationsResponse response = toolsClient.listLocationsCallable().call(request); + * for (Location element : response.getLocationsList()) { + * // doThingsWith(element); + * } + * String nextPageToken = response.getNextPageToken(); + * if (!Strings.isNullOrEmpty(nextPageToken)) { + * request = request.toBuilder().setPageToken(nextPageToken).build(); + * } else { + * break; + * } + * } + * } + * }+ */ + public final UnaryCallable
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + * Location response = toolsClient.getLocation(request); + * } + * }+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Location getLocation(GetLocationRequest request) { + return getLocationCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets information about a location. + * + *
Sample code: + * + *
{@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 (ToolsClient toolsClient = ToolsClient.create()) { + * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + * ApiFuture+ */ + public final UnaryCallablefuture = toolsClient.getLocationCallable().futureCall(request); + * // Do something. + * Location response = future.get(); + * } + * }
The default instance has everything set to sensible defaults: + * + *
The builder of this class is recursive, so contained classes are themselves builders. When + * build() is called, the tree of builders is called to create the complete settings object. + * + *
For example, to set the total timeout of createTool to 30 seconds: + * + *
{@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 + * ToolsSettings.Builder toolsSettingsBuilder = ToolsSettings.newBuilder(); + * toolsSettingsBuilder + * .createToolSettings() + * .setRetrySettings( + * toolsSettingsBuilder + * .createToolSettings() + * .getRetrySettings() + * .toBuilder() + * .setTotalTimeout(Duration.ofSeconds(30)) + * .build()); + * ToolsSettings toolsSettings = toolsSettingsBuilder.build(); + * }+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class ToolsSettings extends ClientSettings
Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction ======================= ExamplesClient =======================
+ *
+ * Service Description: Service for managing
+ * [Examples][google.cloud.dialogflow.cx.v3beta1.Example].
+ *
+ * Sample for ExamplesClient:
+ *
+ * ======================= ExperimentsClient =======================
*
* Service Description: Service for managing
@@ -211,6 +231,26 @@
* }
* }
*
+ * ======================= PlaybooksClient =======================
+ *
+ * Service Description: Service for managing
+ * [Playbooks][google.cloud.dialogflow.cx.v3beta1.Playbook].
+ *
+ * Sample for PlaybooksClient:
+ *
+ * ======================= SecuritySettingsServiceClient =======================
*
* Service Description: Service for managing security settings for Dialogflow.
@@ -302,6 +342,25 @@
* }
* }
*
+ * ======================= ToolsClient =======================
+ *
+ * Service Description: Service for managing [Tools][google.cloud.dialogflow.cx.v3beta1.Tool].
+ *
+ * Sample for ToolsClient:
+ *
+ * ======================= TransitionRouteGroupsClient =======================
*
* Service Description: Service for managing
diff --git a/java-dialogflow-cx/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStub.java b/java-dialogflow-cx/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStub.java
index fa98e4db89cc..7ffdc84df2ae 100644
--- a/java-dialogflow-cx/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStub.java
+++ b/java-dialogflow-cx/google-cloud-dialogflow-cx/src/main/java/com/google/cloud/dialogflow/cx/v3beta1/stub/EntityTypesStub.java
@@ -21,11 +21,18 @@
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
+import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.dialogflow.cx.v3beta1.CreateEntityTypeRequest;
import com.google.cloud.dialogflow.cx.v3beta1.DeleteEntityTypeRequest;
import com.google.cloud.dialogflow.cx.v3beta1.EntityType;
+import com.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesMetadata;
+import com.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesRequest;
+import com.google.cloud.dialogflow.cx.v3beta1.ExportEntityTypesResponse;
import com.google.cloud.dialogflow.cx.v3beta1.GetEntityTypeRequest;
+import com.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesMetadata;
+import com.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesRequest;
+import com.google.cloud.dialogflow.cx.v3beta1.ImportEntityTypesResponse;
import com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesRequest;
import com.google.cloud.dialogflow.cx.v3beta1.ListEntityTypesResponse;
import com.google.cloud.dialogflow.cx.v3beta1.UpdateEntityTypeRequest;
@@ -33,6 +40,8 @@
import com.google.cloud.location.ListLocationsRequest;
import com.google.cloud.location.ListLocationsResponse;
import com.google.cloud.location.Location;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.OperationsStub;
import com.google.protobuf.Empty;
import javax.annotation.Generated;
@@ -46,6 +55,14 @@
@Generated("by gapic-generator-java")
public abstract class EntityTypesStub implements BackgroundResource {
+ public OperationsStub getOperationsStub() {
+ return null;
+ }
+
+ public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
+ return null;
+ }
+
public UnaryCallable This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public abstract class ExamplesStub implements BackgroundResource {
+
+ public UnaryCallable The default instance has everything set to sensible defaults:
+ *
+ * The builder of this class is recursive, so contained classes are themselves builders. When
+ * build() is called, the tree of builders is called to create the complete settings object.
+ *
+ * For example, to set the total timeout of createExample to 30 seconds:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class GrpcExamplesCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public This class is for advanced usage and reflects the underlying API directly.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class GrpcExamplesStub extends ExamplesStub {
+ private static final MethodDescriptor This class is for advanced usage.
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class GrpcPlaybooksCallableFactory implements GrpcStubCallableFactory {
+
+ @Override
+ public {@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);
+ * }
+ * }
+ *
* {@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (PlaybooksClient playbooksClient = PlaybooksClient.create()) {
+ * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+ * Playbook playbook = Playbook.newBuilder().build();
+ * Playbook response = playbooksClient.createPlaybook(parent, playbook);
+ * }
+ * }
+ *
* {@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 (ToolsClient toolsClient = ToolsClient.create()) {
+ * AgentName parent = AgentName.of("[PROJECT]", "[LOCATION]", "[AGENT]");
+ * Tool tool = Tool.newBuilder().build();
+ * Tool response = toolsClient.createTool(parent, tool);
+ * }
+ * }
+ *
*
+ *
+ *
+ * {@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
+ * ExamplesStubSettings.Builder examplesSettingsBuilder = ExamplesStubSettings.newBuilder();
+ * examplesSettingsBuilder
+ * .createExampleSettings()
+ * .setRetrySettings(
+ * examplesSettingsBuilder
+ * .createExampleSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setTotalTimeout(Duration.ofSeconds(30))
+ * .build());
+ * ExamplesStubSettings examplesSettings = examplesSettingsBuilder.build();
+ * }
+ */
+@BetaApi
+@Generated("by gapic-generator-java")
+public class ExamplesStubSettings extends StubSettings