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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * DataAgentName name = DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]");
+ * DataAgent response = dataAgentServiceClient.getDataAgent(name);
+ * }
+ * }
+ *
+ * Note: close() needs to be called on the DataAgentServiceClient 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 | + *
|---|---|---|
ListDataAgents |
+ * Lists DataAgents in a given project and location. |
+ *
+ * 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. + *
|
+ *
ListAccessibleDataAgents |
+ * Lists DataAgents that are accessible to the caller in a given project and location. |
+ *
+ * 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. + *
|
+ *
GetDataAgent |
+ * Gets details of a single DataAgent. |
+ *
+ * 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. + *
|
+ *
CreateDataAgent |
+ * Creates a new DataAgent in a given project and location. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
CreateDataAgentSync |
+ * Creates a new DataAgent in a given project and location synchronously. |
+ *
+ * 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. + *
|
+ *
UpdateDataAgent |
+ * Updates the parameters of a single DataAgent. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
UpdateDataAgentSync |
+ * Updates the parameters of a single DataAgent synchronously. |
+ *
+ * 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. + *
|
+ *
DeleteDataAgent |
+ * Deletes a single DataAgent. |
+ *
+ * Request object method variants only take one parameter, a request object, which must be constructed before the call. + *
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. + *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. + *
|
+ *
DeleteDataAgentSync |
+ * Deletes a single DataAgent synchronously. |
+ *
+ * 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. + *
|
+ *
GetIamPolicy |
+ * Gets the IAM policy for DataAgent |
+ *
+ * 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. + *
|
+ *
SetIamPolicy |
+ * Sets the IAM policy for a DataAgent. |
+ *
+ * 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. + * This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: ***Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project. + * For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version. |
+ *
+ * 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 DataAgentServiceSettings 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
+ * DataAgentServiceSettings dataAgentServiceSettings =
+ * DataAgentServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * DataAgentServiceClient dataAgentServiceClient =
+ * DataAgentServiceClient.create(dataAgentServiceSettings);
+ * }
+ *
+ * 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
+ * DataAgentServiceSettings dataAgentServiceSettings =
+ * DataAgentServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * DataAgentServiceClient dataAgentServiceClient =
+ * DataAgentServiceClient.create(dataAgentServiceSettings);
+ * }
+ *
+ * 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
+ * DataAgentServiceSettings dataAgentServiceSettings =
+ * DataAgentServiceSettings.newHttpJsonBuilder().build();
+ * DataAgentServiceClient dataAgentServiceClient =
+ * DataAgentServiceClient.create(dataAgentServiceSettings);
+ * }
+ *
+ * Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class DataAgentServiceClient implements BackgroundResource { + private final DataAgentServiceSettings settings; + private final DataAgentServiceStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of DataAgentServiceClient with default settings. */ + public static final DataAgentServiceClient create() throws IOException { + return create(DataAgentServiceSettings.newBuilder().build()); + } + + /** + * Constructs an instance of DataAgentServiceClient, 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 DataAgentServiceClient create(DataAgentServiceSettings settings) + throws IOException { + return new DataAgentServiceClient(settings); + } + + /** + * Constructs an instance of DataAgentServiceClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(DataAgentServiceSettings). + */ + public static final DataAgentServiceClient create(DataAgentServiceStub stub) { + return new DataAgentServiceClient(stub); + } + + /** + * Constructs an instance of DataAgentServiceClient, 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 DataAgentServiceClient(DataAgentServiceSettings settings) throws IOException { + this.settings = settings; + this.stub = ((DataAgentServiceStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected DataAgentServiceClient(DataAgentServiceStub 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 DataAgentServiceSettings getSettings() { + return settings; + } + + public DataAgentServiceStub 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. + /** + * Lists DataAgents in a given project and 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (DataAgent element : dataAgentServiceClient.listDataAgents(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Parent value for ListDataAgentsRequest.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListDataAgentsPagedResponse listDataAgents(LocationName parent) {
+ ListDataAgentsRequest request =
+ ListDataAgentsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listDataAgents(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists DataAgents in a given project and 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (DataAgent element : dataAgentServiceClient.listDataAgents(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Parent value for ListDataAgentsRequest.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListDataAgentsPagedResponse listDataAgents(String parent) {
+ ListDataAgentsRequest request = ListDataAgentsRequest.newBuilder().setParent(parent).build();
+ return listDataAgents(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists DataAgents in a given project and 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * ListDataAgentsRequest request =
+ * ListDataAgentsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .setShowDeleted(true)
+ * .build();
+ * for (DataAgent element : dataAgentServiceClient.listDataAgents(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 ListDataAgentsPagedResponse listDataAgents(ListDataAgentsRequest request) {
+ return listDataAgentsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists DataAgents in a given project and 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * ListDataAgentsRequest request =
+ * ListDataAgentsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .setShowDeleted(true)
+ * .build();
+ * ApiFuture future =
+ * dataAgentServiceClient.listDataAgentsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (DataAgent element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * ListDataAgentsRequest request =
+ * ListDataAgentsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .setShowDeleted(true)
+ * .build();
+ * while (true) {
+ * ListDataAgentsResponse response =
+ * dataAgentServiceClient.listDataAgentsCallable().call(request);
+ * for (DataAgent element : response.getDataAgentsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (DataAgent element :
+ * dataAgentServiceClient.listAccessibleDataAgents(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Parent value for ListAccessibleDataAgentsRequest.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListAccessibleDataAgentsPagedResponse listAccessibleDataAgents(LocationName parent) {
+ ListAccessibleDataAgentsRequest request =
+ ListAccessibleDataAgentsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listAccessibleDataAgents(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists DataAgents that are accessible to the caller in a given project and 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (DataAgent element :
+ * dataAgentServiceClient.listAccessibleDataAgents(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Parent value for ListAccessibleDataAgentsRequest.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListAccessibleDataAgentsPagedResponse listAccessibleDataAgents(String parent) {
+ ListAccessibleDataAgentsRequest request =
+ ListAccessibleDataAgentsRequest.newBuilder().setParent(parent).build();
+ return listAccessibleDataAgents(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists DataAgents that are accessible to the caller in a given project and 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * ListAccessibleDataAgentsRequest request =
+ * ListAccessibleDataAgentsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .setShowDeleted(true)
+ * .build();
+ * for (DataAgent element :
+ * dataAgentServiceClient.listAccessibleDataAgents(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 ListAccessibleDataAgentsPagedResponse listAccessibleDataAgents(
+ ListAccessibleDataAgentsRequest request) {
+ return listAccessibleDataAgentsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists DataAgents that are accessible to the caller in a given project and 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * ListAccessibleDataAgentsRequest request =
+ * ListAccessibleDataAgentsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .setShowDeleted(true)
+ * .build();
+ * ApiFuture future =
+ * dataAgentServiceClient.listAccessibleDataAgentsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (DataAgent element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * ListAccessibleDataAgentsRequest request =
+ * ListAccessibleDataAgentsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .setOrderBy("orderBy-1207110587")
+ * .setShowDeleted(true)
+ * .build();
+ * while (true) {
+ * ListAccessibleDataAgentsResponse response =
+ * dataAgentServiceClient.listAccessibleDataAgentsCallable().call(request);
+ * for (DataAgent element : response.getDataAgentsList()) {
+ * // doThingsWith(element);
+ * }
+ * String nextPageToken = response.getNextPageToken();
+ * if (!Strings.isNullOrEmpty(nextPageToken)) {
+ * request = request.toBuilder().setPageToken(nextPageToken).build();
+ * } else {
+ * break;
+ * }
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * DataAgentName name = DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]");
+ * DataAgent response = dataAgentServiceClient.getDataAgent(name);
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataAgent getDataAgent(DataAgentName name) {
+ GetDataAgentRequest request =
+ GetDataAgentRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getDataAgent(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single DataAgent.
+ *
+ * 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * String name = DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString();
+ * DataAgent response = dataAgentServiceClient.getDataAgent(name);
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataAgent getDataAgent(String name) {
+ GetDataAgentRequest request = GetDataAgentRequest.newBuilder().setName(name).build();
+ return getDataAgent(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single DataAgent.
+ *
+ * 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * GetDataAgentRequest request =
+ * GetDataAgentRequest.newBuilder()
+ * .setName(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString())
+ * .build();
+ * DataAgent response = dataAgentServiceClient.getDataAgent(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 DataAgent getDataAgent(GetDataAgentRequest request) {
+ return getDataAgentCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single DataAgent.
+ *
+ * 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * GetDataAgentRequest request =
+ * GetDataAgentRequest.newBuilder()
+ * .setName(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString())
+ * .build();
+ * ApiFuture future =
+ * dataAgentServiceClient.getDataAgentCallable().futureCall(request);
+ * // Do something.
+ * DataAgent response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * DataAgent dataAgent = DataAgent.newBuilder().build();
+ * String dataAgentId = "dataAgentId1752773622";
+ * DataAgent response =
+ * dataAgentServiceClient.createDataAgentAsync(parent, dataAgent, dataAgentId).get();
+ * }
+ * }
+ *
+ * @param parent Required. Value for parent.
+ * @param dataAgent Required. The resource being created.
+ * @param dataAgentId Optional. Id of the requesting object. Must be unique within the parent. The
+ * allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. If not provided, the server will
+ * auto-generate a value for the id.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * DataAgent dataAgent = DataAgent.newBuilder().build();
+ * String dataAgentId = "dataAgentId1752773622";
+ * DataAgent response =
+ * dataAgentServiceClient.createDataAgentAsync(parent, dataAgent, dataAgentId).get();
+ * }
+ * }
+ *
+ * @param parent Required. Value for parent.
+ * @param dataAgent Required. The resource being created.
+ * @param dataAgentId Optional. Id of the requesting object. Must be unique within the parent. The
+ * allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. If not provided, the server will
+ * auto-generate a value for the id.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * CreateDataAgentRequest request =
+ * CreateDataAgentRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setDataAgentId("dataAgentId1752773622")
+ * .setDataAgent(DataAgent.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * DataAgent response = dataAgentServiceClient.createDataAgentAsync(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 OperationFutureSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * CreateDataAgentRequest request =
+ * CreateDataAgentRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setDataAgentId("dataAgentId1752773622")
+ * .setDataAgent(DataAgent.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * OperationFuture future =
+ * dataAgentServiceClient.createDataAgentOperationCallable().futureCall(request);
+ * // Do something.
+ * DataAgent response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * CreateDataAgentRequest request =
+ * CreateDataAgentRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setDataAgentId("dataAgentId1752773622")
+ * .setDataAgent(DataAgent.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * ApiFuture future =
+ * dataAgentServiceClient.createDataAgentCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * DataAgent dataAgent = DataAgent.newBuilder().build();
+ * String dataAgentId = "dataAgentId1752773622";
+ * DataAgent response =
+ * dataAgentServiceClient.createDataAgentSync(parent, dataAgent, dataAgentId);
+ * }
+ * }
+ *
+ * @param parent Required. Value for parent.
+ * @param dataAgent Required. The resource being created.
+ * @param dataAgentId Optional. Id of the requesting object. Must be unique within the parent. The
+ * allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. If not provided, the server will
+ * auto-generate a value for the id.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataAgent createDataAgentSync(
+ LocationName parent, DataAgent dataAgent, String dataAgentId) {
+ CreateDataAgentRequest request =
+ CreateDataAgentRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setDataAgent(dataAgent)
+ .setDataAgentId(dataAgentId)
+ .build();
+ return createDataAgentSync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new DataAgent in a given project and location synchronously.
+ *
+ * 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * DataAgent dataAgent = DataAgent.newBuilder().build();
+ * String dataAgentId = "dataAgentId1752773622";
+ * DataAgent response =
+ * dataAgentServiceClient.createDataAgentSync(parent, dataAgent, dataAgentId);
+ * }
+ * }
+ *
+ * @param parent Required. Value for parent.
+ * @param dataAgent Required. The resource being created.
+ * @param dataAgentId Optional. Id of the requesting object. Must be unique within the parent. The
+ * allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. If not provided, the server will
+ * auto-generate a value for the id.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataAgent createDataAgentSync(
+ String parent, DataAgent dataAgent, String dataAgentId) {
+ CreateDataAgentRequest request =
+ CreateDataAgentRequest.newBuilder()
+ .setParent(parent)
+ .setDataAgent(dataAgent)
+ .setDataAgentId(dataAgentId)
+ .build();
+ return createDataAgentSync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new DataAgent in a given project and location synchronously.
+ *
+ * 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * CreateDataAgentRequest request =
+ * CreateDataAgentRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setDataAgentId("dataAgentId1752773622")
+ * .setDataAgent(DataAgent.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * DataAgent response = dataAgentServiceClient.createDataAgentSync(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 DataAgent createDataAgentSync(CreateDataAgentRequest request) {
+ return createDataAgentSyncCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new DataAgent in a given project and location synchronously.
+ *
+ * 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * CreateDataAgentRequest request =
+ * CreateDataAgentRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setDataAgentId("dataAgentId1752773622")
+ * .setDataAgent(DataAgent.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * ApiFuture future =
+ * dataAgentServiceClient.createDataAgentSyncCallable().futureCall(request);
+ * // Do something.
+ * DataAgent response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * DataAgent dataAgent = DataAgent.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * DataAgent response = dataAgentServiceClient.updateDataAgentAsync(dataAgent, updateMask).get();
+ * }
+ * }
+ *
+ * @param dataAgent Required. The resource being updated.
+ * @param updateMask Optional. Field mask is used to specify the fields to be overwritten in the
+ * DataAgent resource by the update. The fields specified in the update_mask are relative to
+ * the resource, not the full request. A field will be overwritten if it is in the mask. If
+ * the user does not provide a mask then all fields with non-default values present in the
+ * request will be overwritten. If a wildcard mask is provided, all fields will be
+ * overwritten.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * UpdateDataAgentRequest request =
+ * UpdateDataAgentRequest.newBuilder()
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setDataAgent(DataAgent.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * DataAgent response = dataAgentServiceClient.updateDataAgentAsync(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 OperationFutureSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * UpdateDataAgentRequest request =
+ * UpdateDataAgentRequest.newBuilder()
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setDataAgent(DataAgent.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * OperationFuture future =
+ * dataAgentServiceClient.updateDataAgentOperationCallable().futureCall(request);
+ * // Do something.
+ * DataAgent response = future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * UpdateDataAgentRequest request =
+ * UpdateDataAgentRequest.newBuilder()
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setDataAgent(DataAgent.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * ApiFuture future =
+ * dataAgentServiceClient.updateDataAgentCallable().futureCall(request);
+ * // Do something.
+ * Operation response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * DataAgent dataAgent = DataAgent.newBuilder().build();
+ * FieldMask updateMask = FieldMask.newBuilder().build();
+ * DataAgent response = dataAgentServiceClient.updateDataAgentSync(dataAgent, updateMask);
+ * }
+ * }
+ *
+ * @param dataAgent Required. The resource being updated.
+ * @param updateMask Optional. Field mask is used to specify the fields to be overwritten in the
+ * DataAgent resource by the update. The fields specified in the update_mask are relative to
+ * the resource, not the full request. A field will be overwritten if it is in the mask. If
+ * the user does not provide a mask then all fields with non-default values present in the
+ * request will be overwritten. If a wildcard mask is provided, all fields will be
+ * overwritten.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final DataAgent updateDataAgentSync(DataAgent dataAgent, FieldMask updateMask) {
+ UpdateDataAgentRequest request =
+ UpdateDataAgentRequest.newBuilder()
+ .setDataAgent(dataAgent)
+ .setUpdateMask(updateMask)
+ .build();
+ return updateDataAgentSync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates the parameters of a single DataAgent synchronously.
+ *
+ * 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * UpdateDataAgentRequest request =
+ * UpdateDataAgentRequest.newBuilder()
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setDataAgent(DataAgent.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * DataAgent response = dataAgentServiceClient.updateDataAgentSync(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 DataAgent updateDataAgentSync(UpdateDataAgentRequest request) {
+ return updateDataAgentSyncCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Updates the parameters of a single DataAgent synchronously.
+ *
+ * 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * UpdateDataAgentRequest request =
+ * UpdateDataAgentRequest.newBuilder()
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .setDataAgent(DataAgent.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * ApiFuture future =
+ * dataAgentServiceClient.updateDataAgentSyncCallable().futureCall(request);
+ * // Do something.
+ * DataAgent response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * DataAgentName name = DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]");
+ * dataAgentServiceClient.deleteDataAgentAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * String name = DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString();
+ * dataAgentServiceClient.deleteDataAgentAsync(name).get();
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final OperationFutureSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * DeleteDataAgentRequest request =
+ * DeleteDataAgentRequest.newBuilder()
+ * .setName(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * dataAgentServiceClient.deleteDataAgentAsync(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 OperationFutureSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * DeleteDataAgentRequest request =
+ * DeleteDataAgentRequest.newBuilder()
+ * .setName(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * OperationFuture future =
+ * dataAgentServiceClient.deleteDataAgentOperationCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final OperationCallableSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * DeleteDataAgentRequest request =
+ * DeleteDataAgentRequest.newBuilder()
+ * .setName(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * ApiFuture future =
+ * dataAgentServiceClient.deleteDataAgentCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * DataAgentName name = DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]");
+ * dataAgentServiceClient.deleteDataAgentSync(name);
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteDataAgentSync(DataAgentName name) {
+ DeleteDataAgentRequest request =
+ DeleteDataAgentRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ deleteDataAgentSync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a single DataAgent synchronously.
+ *
+ * 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * String name = DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString();
+ * dataAgentServiceClient.deleteDataAgentSync(name);
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteDataAgentSync(String name) {
+ DeleteDataAgentRequest request = DeleteDataAgentRequest.newBuilder().setName(name).build();
+ deleteDataAgentSync(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a single DataAgent synchronously.
+ *
+ * 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * DeleteDataAgentRequest request =
+ * DeleteDataAgentRequest.newBuilder()
+ * .setName(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * dataAgentServiceClient.deleteDataAgentSync(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 deleteDataAgentSync(DeleteDataAgentRequest request) {
+ deleteDataAgentSyncCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a single DataAgent synchronously.
+ *
+ * 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * DeleteDataAgentRequest request =
+ * DeleteDataAgentRequest.newBuilder()
+ * .setName(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * ApiFuture future =
+ * dataAgentServiceClient.deleteDataAgentSyncCallable().futureCall(request);
+ * // Do something.
+ * future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * ResourceName resource = DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]");
+ * Policy response = dataAgentServiceClient.getIamPolicy(resource);
+ * }
+ * }
+ *
+ * @param resource REQUIRED: The resource for which the policy is being requested. See the
+ * operation documentation for the appropriate value for this field.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy getIamPolicy(ResourceName resource) {
+ GetIamPolicyRequest request =
+ GetIamPolicyRequest.newBuilder()
+ .setResource(resource == null ? null : resource.toString())
+ .build();
+ return getIamPolicy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the IAM policy for DataAgent
+ *
+ * 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * String resource = ConversationName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION]").toString();
+ * Policy response = dataAgentServiceClient.getIamPolicy(resource);
+ * }
+ * }
+ *
+ * @param resource REQUIRED: The resource for which the policy is being requested. See the
+ * operation documentation for the appropriate value for this field.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy getIamPolicy(String resource) {
+ GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build();
+ return getIamPolicy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the IAM policy for DataAgent
+ *
+ * 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * GetIamPolicyRequest request =
+ * GetIamPolicyRequest.newBuilder()
+ * .setResource(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString())
+ * .setOptions(GetPolicyOptions.newBuilder().build())
+ * .build();
+ * Policy response = dataAgentServiceClient.getIamPolicy(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 Policy getIamPolicy(GetIamPolicyRequest request) {
+ return getIamPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets the IAM policy for DataAgent
+ *
+ * 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * GetIamPolicyRequest request =
+ * GetIamPolicyRequest.newBuilder()
+ * .setResource(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString())
+ * .setOptions(GetPolicyOptions.newBuilder().build())
+ * .build();
+ * ApiFuture future = dataAgentServiceClient.getIamPolicyCallable().futureCall(request);
+ * // Do something.
+ * Policy response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * ResourceName resource = DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]");
+ * Policy response = dataAgentServiceClient.setIamPolicy(resource);
+ * }
+ * }
+ *
+ * @param resource REQUIRED: The resource for which the policy is being specified. See the
+ * operation documentation for the appropriate value for this field.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy setIamPolicy(ResourceName resource) {
+ SetIamPolicyRequest request =
+ SetIamPolicyRequest.newBuilder()
+ .setResource(resource == null ? null : resource.toString())
+ .build();
+ return setIamPolicy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Sets the IAM policy for a DataAgent.
+ *
+ * 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * String resource = ConversationName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION]").toString();
+ * Policy response = dataAgentServiceClient.setIamPolicy(resource);
+ * }
+ * }
+ *
+ * @param resource REQUIRED: The resource for which the policy is being specified. See the
+ * operation documentation for the appropriate value for this field.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Policy setIamPolicy(String resource) {
+ SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder().setResource(resource).build();
+ return setIamPolicy(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Sets the IAM policy for a DataAgent.
+ *
+ * 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * SetIamPolicyRequest request =
+ * SetIamPolicyRequest.newBuilder()
+ * .setResource(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * Policy response = dataAgentServiceClient.setIamPolicy(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 Policy setIamPolicy(SetIamPolicyRequest request) {
+ return setIamPolicyCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Sets the IAM policy for a DataAgent.
+ *
+ * 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * SetIamPolicyRequest request =
+ * SetIamPolicyRequest.newBuilder()
+ * .setResource(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString())
+ * .setPolicy(Policy.newBuilder().build())
+ * .setUpdateMask(FieldMask.newBuilder().build())
+ * .build();
+ * ApiFuture future = dataAgentServiceClient.setIamPolicyCallable().futureCall(request);
+ * // Do something.
+ * Policy response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableThis method lists locations based on the resource scope provided inthe + * [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: + * ***Global locations**: If `name` is empty, the method lists thepublic + * locations available to all projects. * **Project-specificlocations**: If + * `name` follows the format`projects/{project}`, the method lists locations visible to + * thatspecific project. This includes public, private, or otherproject-specific locations enabled + * for the project. + * + *
For gRPC and client library implementations, the resource name ispassed as the `name` field. + * For direct service calls, the resourcename isincorporated into the request path based on the + * specific serviceimplementation and 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (Location element : dataAgentServiceClient.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.
+ *
+ * This method lists locations based on the resource scope provided inthe + * [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: + * ***Global locations**: If `name` is empty, the method lists thepublic + * locations available to all projects. * **Project-specificlocations**: If + * `name` follows the format`projects/{project}`, the method lists locations visible to + * thatspecific project. This includes public, private, or otherproject-specific locations enabled + * for the project. + * + *
For gRPC and client library implementations, the resource name ispassed as the `name` field. + * For direct service calls, the resourcename isincorporated into the request path based on the + * specific serviceimplementation and 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * ApiFuture future =
+ * dataAgentServiceClient.listLocationsPagedCallable().futureCall(request);
+ * // Do something.
+ * for (Location element : future.get().iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ */
+ public final UnaryCallableThis method lists locations based on the resource scope provided inthe + * [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: + * ***Global locations**: If `name` is empty, the method lists thepublic + * locations available to all projects. * **Project-specificlocations**: If + * `name` follows the format`projects/{project}`, the method lists locations visible to + * thatspecific project. This includes public, private, or otherproject-specific locations enabled + * for the project. + * + *
For gRPC and client library implementations, the resource name ispassed as the `name` field. + * For direct service calls, the resourcename isincorporated into the request path based on the + * specific serviceimplementation and 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListLocationsResponse response =
+ * dataAgentServiceClient.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 UnaryCallableSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * Location response = dataAgentServiceClient.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * ApiFuture future = dataAgentServiceClient.getLocationCallable().futureCall(request);
+ * // Do something.
+ * Location response = future.get();
+ * }
+ * }
+ */
+ public final UnaryCallableThe 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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getDataAgent: + * + *
{@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
+ * DataAgentServiceSettings.Builder dataAgentServiceSettingsBuilder =
+ * DataAgentServiceSettings.newBuilder();
+ * dataAgentServiceSettingsBuilder
+ * .getDataAgentSettings()
+ * .setRetrySettings(
+ * dataAgentServiceSettingsBuilder
+ * .getDataAgentSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ * .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ * .setMaxAttempts(5)
+ * .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ * .setRetryDelayMultiplier(1.3)
+ * .setRpcTimeoutMultiplier(1.5)
+ * .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ * .build());
+ * DataAgentServiceSettings dataAgentServiceSettings = dataAgentServiceSettingsBuilder.build();
+ * }
+ *
+ * Please refer to the [Client Side Retry
+ * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting
+ * retries.
+ *
+ * To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for createDataAgent: + * + *
{@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
+ * DataAgentServiceSettings.Builder dataAgentServiceSettingsBuilder =
+ * DataAgentServiceSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ * OperationalTimedPollAlgorithm.create(
+ * RetrySettings.newBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ * .setRetryDelayMultiplier(1.5)
+ * .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ * .setTotalTimeoutDuration(Duration.ofHours(24))
+ * .build());
+ * dataAgentServiceSettingsBuilder
+ * .createClusterOperationSettings()
+ * .setPollingAlgorithm(timedRetryAlgorithm)
+ * .build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+public class DataAgentServiceSettings extends ClientSettingsNote: 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 DataChatServiceClient object to clean up resources
+ * such as threads. In the example above, try-with-resources is used, which automatically calls
+ * close().
+ *
+ * Chat Answers a data question by generating a stream of [Message][google.cloud.geminidataanalytics.v1.Message] objects. Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. chatCallable()
+ * CreateConversation Creates a new conversation to persist the conversation history. Each conversation will have multiple messages associated with it. Request object method variants only take one parameter, a request object, which must be constructed before the call. createConversation(CreateConversationRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. createConversation(LocationName parent, Conversation conversation, String conversationId)
+ * createConversation(String parent, Conversation conversation, String conversationId)
+ * Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. createConversationCallable()
+ * DeleteConversation Deletes a conversation. Request object method variants only take one parameter, a request object, which must be constructed before the call. deleteConversation(DeleteConversationRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. deleteConversation(ConversationName name)
+ * deleteConversation(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. deleteConversationCallable()
+ * GetConversation Gets details of a single conversation by using conversation id and parent. Request object method variants only take one parameter, a request object, which must be constructed before the call. getConversation(GetConversationRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. getConversation(ConversationName name)
+ * getConversation(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. getConversationCallable()
+ * ListConversations Lists all conversations for a given parent. Request object method variants only take one parameter, a request object, which must be constructed before the call. listConversations(ListConversationsRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. listConversations(LocationName parent)
+ * listConversations(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. listConversationsPagedCallable()
+ * listConversationsCallable()
+ * ListMessages Lists all messages for a given conversation. Request object method variants only take one parameter, a request object, which must be constructed before the call. listMessages(ListMessagesRequest request)
+ * "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. listMessages(ConversationName parent)
+ * listMessages(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. listMessagesPagedCallable()
+ * listMessagesCallable()
+ * ListLocations Lists information about the supported locations for this service.
+ * This method lists locations based on the resource scope provided inthe [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: ***Global locations**: If `name` is empty, the method lists thepublic locations available to all projects. * **Project-specificlocations**: If `name` follows the format`projects/{project}`, the method lists locations visible to thatspecific project. This includes public, private, or otherproject-specific locations enabled for the project.
+ * For gRPC and client library implementations, the resource name ispassed as the `name` field. For direct service calls, the resourcename isincorporated into the request path based on the specific serviceimplementation and version. 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 DataChatServiceSettings 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.
+ */
+@Generated("by gapic-generator-java")
+public class DataChatServiceClient implements BackgroundResource {
+ private final DataChatServiceSettings settings;
+ private final DataChatServiceStub stub;
+
+ /** Constructs an instance of DataChatServiceClient with default settings. */
+ public static final DataChatServiceClient create() throws IOException {
+ return create(DataChatServiceSettings.newBuilder().build());
+ }
+
+ /**
+ * Constructs an instance of DataChatServiceClient, 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 DataChatServiceClient create(DataChatServiceSettings settings)
+ throws IOException {
+ return new DataChatServiceClient(settings);
+ }
+
+ /**
+ * Constructs an instance of DataChatServiceClient, using the given stub for making calls. This is
+ * for advanced usage - prefer using create(DataChatServiceSettings).
+ */
+ public static final DataChatServiceClient create(DataChatServiceStub stub) {
+ return new DataChatServiceClient(stub);
+ }
+
+ /**
+ * Constructs an instance of DataChatServiceClient, 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 DataChatServiceClient(DataChatServiceSettings settings) throws IOException {
+ this.settings = settings;
+ this.stub = ((DataChatServiceStubSettings) settings.getStubSettings()).createStub();
+ }
+
+ protected DataChatServiceClient(DataChatServiceStub stub) {
+ this.settings = null;
+ this.stub = stub;
+ }
+
+ public final DataChatServiceSettings getSettings() {
+ return settings;
+ }
+
+ public DataChatServiceStub getStub() {
+ return stub;
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Answers a data question by generating a stream of
+ * [Message][google.cloud.geminidataanalytics.v1.Message] objects.
+ *
+ * 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:
+ *
+ * This method lists locations based on the resource scope provided inthe
+ * [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field:
+ * ***Global locations**: If `name` is empty, the method lists thepublic
+ * locations available to all projects. * **Project-specificlocations**: If
+ * `name` follows the format`projects/{project}`, the method lists locations visible to
+ * thatspecific project. This includes public, private, or otherproject-specific locations enabled
+ * for the project.
+ *
+ * For gRPC and client library implementations, the resource name ispassed as the `name` field.
+ * For direct service calls, the resourcename isincorporated into the request path based on the
+ * specific serviceimplementation and version.
+ *
+ * Sample code:
+ *
+ * This method lists locations based on the resource scope provided inthe
+ * [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field:
+ * ***Global locations**: If `name` is empty, the method lists thepublic
+ * locations available to all projects. * **Project-specificlocations**: If
+ * `name` follows the format`projects/{project}`, the method lists locations visible to
+ * thatspecific project. This includes public, private, or otherproject-specific locations enabled
+ * for the project.
+ *
+ * For gRPC and client library implementations, the resource name ispassed as the `name` field.
+ * For direct service calls, the resourcename isincorporated into the request path based on the
+ * specific serviceimplementation and version.
+ *
+ * Sample code:
+ *
+ * This method lists locations based on the resource scope provided inthe
+ * [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field:
+ * ***Global locations**: If `name` is empty, the method lists thepublic
+ * locations available to all projects. * **Project-specificlocations**: If
+ * `name` follows the format`projects/{project}`, the method lists locations visible to
+ * thatspecific project. This includes public, private, or otherproject-specific locations enabled
+ * for the project.
+ *
+ * For gRPC and client library implementations, the resource name ispassed as the `name` field.
+ * For direct service calls, the resourcename isincorporated into the request path based on the
+ * specific serviceimplementation and version.
+ *
+ * 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
+ * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings)
+ * of createConversation:
+ *
+ * Note: This method does not support applying settings to streaming methods.
+ */
+ public Builder applyToAllUnaryMethods(
+ ApiFunction The interfaces provided are listed below, along with usage samples.
+ *
+ * ======================= DataAgentServiceClient =======================
+ *
+ * Service Description: Service describing handlers for resources.
+ *
+ * Sample for DataAgentServiceClient:
+ *
+ * ======================= DataChatServiceClient =======================
+ *
+ * Service Description: Service to ask a natural language question on top of BigQuery and Looker
+ * Studio datasources to get back streamed responses of various kinds to help provide a rich
+ * conversational answer.
+ *
+ * Sample for DataChatServiceClient:
+ *
+ * This class is for advanced usage and reflects the underlying API directly.
+ */
+@Generated("by gapic-generator-java")
+public abstract class DataAgentServiceStub implements BackgroundResource {
+
+ public OperationsStub getOperationsStub() {
+ return null;
+ }
+
+ public com.google.api.gax.httpjson.longrunning.stub.OperationsStub getHttpJsonOperationsStub() {
+ return null;
+ }
+
+ 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
+ * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings)
+ * of getDataAgent:
+ *
+ * To configure the RetrySettings of a Long Running Operation method, create an
+ * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to
+ * configure the RetrySettings for createDataAgent:
+ *
+ * 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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * Conversation conversation = Conversation.newBuilder().build();
+ * String conversationId = "conversationId-1676095234";
+ * Conversation response =
+ * dataChatServiceClient.createConversation(parent, conversation, conversationId);
+ * }
+ * }
+ *
+ *
+ *
+ *
+ *
+ *
+ * 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
+ * DataChatServiceSettings dataChatServiceSettings =
+ * DataChatServiceSettings.newBuilder()
+ * .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ * .build();
+ * DataChatServiceClient dataChatServiceClient =
+ * DataChatServiceClient.create(dataChatServiceSettings);
+ * }
+ *
+ * {@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
+ * DataChatServiceSettings dataChatServiceSettings =
+ * DataChatServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * DataChatServiceClient dataChatServiceClient =
+ * DataChatServiceClient.create(dataChatServiceSettings);
+ * }
+ *
+ * {@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
+ * DataChatServiceSettings dataChatServiceSettings =
+ * DataChatServiceSettings.newHttpJsonBuilder().build();
+ * DataChatServiceClient dataChatServiceClient =
+ * DataChatServiceClient.create(dataChatServiceSettings);
+ * }
+ *
+ * {@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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * ChatRequest request =
+ * ChatRequest.newBuilder()
+ * .setParent("parent-995424086")
+ * .addAllMessages(new ArrayList
+ */
+ public final ServerStreamingCallable{@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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * Conversation conversation = Conversation.newBuilder().build();
+ * String conversationId = "conversationId-1676095234";
+ * Conversation response =
+ * dataChatServiceClient.createConversation(parent, conversation, conversationId);
+ * }
+ * }
+ *
+ * @param parent Required. Parent value for CreateConversationRequest. Format:
+ * `projects/{project}/locations/{location}`
+ * @param conversation Required. The conversation to create.
+ * @param conversationId Optional. The conversation id of the conversation to create. Must be
+ * unique within the parent. The allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. If
+ * not provided, the server will auto-generate a value for the id.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Conversation createConversation(
+ LocationName parent, Conversation conversation, String conversationId) {
+ CreateConversationRequest request =
+ CreateConversationRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .setConversation(conversation)
+ .setConversationId(conversationId)
+ .build();
+ return createConversation(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new conversation to persist the conversation history. Each conversation will have
+ * multiple messages associated with it.
+ *
+ * {@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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * Conversation conversation = Conversation.newBuilder().build();
+ * String conversationId = "conversationId-1676095234";
+ * Conversation response =
+ * dataChatServiceClient.createConversation(parent, conversation, conversationId);
+ * }
+ * }
+ *
+ * @param parent Required. Parent value for CreateConversationRequest. Format:
+ * `projects/{project}/locations/{location}`
+ * @param conversation Required. The conversation to create.
+ * @param conversationId Optional. The conversation id of the conversation to create. Must be
+ * unique within the parent. The allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. If
+ * not provided, the server will auto-generate a value for the id.
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Conversation createConversation(
+ String parent, Conversation conversation, String conversationId) {
+ CreateConversationRequest request =
+ CreateConversationRequest.newBuilder()
+ .setParent(parent)
+ .setConversation(conversation)
+ .setConversationId(conversationId)
+ .build();
+ return createConversation(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new conversation to persist the conversation history. Each conversation will have
+ * multiple messages associated with it.
+ *
+ * {@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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * CreateConversationRequest request =
+ * CreateConversationRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setConversationId("conversationId-1676095234")
+ * .setConversation(Conversation.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .build();
+ * Conversation response = dataChatServiceClient.createConversation(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 Conversation createConversation(CreateConversationRequest request) {
+ return createConversationCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Creates a new conversation to persist the conversation history. Each conversation will have
+ * multiple messages associated with it.
+ *
+ * {@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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * CreateConversationRequest request =
+ * CreateConversationRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setConversationId("conversationId-1676095234")
+ * .setConversation(Conversation.newBuilder().build())
+ * .setRequestId("requestId693933066")
+ * .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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * ConversationName name = ConversationName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION]");
+ * dataChatServiceClient.deleteConversation(name);
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource. Format:
+ * `projects/{project}/locations/{location}/conversations/{conversation}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteConversation(ConversationName name) {
+ DeleteConversationRequest request =
+ DeleteConversationRequest.newBuilder()
+ .setName(name == null ? null : name.toString())
+ .build();
+ deleteConversation(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a conversation.
+ *
+ * {@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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * String name = ConversationName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION]").toString();
+ * dataChatServiceClient.deleteConversation(name);
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource. Format:
+ * `projects/{project}/locations/{location}/conversations/{conversation}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final void deleteConversation(String name) {
+ DeleteConversationRequest request =
+ DeleteConversationRequest.newBuilder().setName(name).build();
+ deleteConversation(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a conversation.
+ *
+ * {@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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * DeleteConversationRequest request =
+ * DeleteConversationRequest.newBuilder()
+ * .setName(ConversationName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION]").toString())
+ * .build();
+ * dataChatServiceClient.deleteConversation(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 deleteConversation(DeleteConversationRequest request) {
+ deleteConversationCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Deletes a conversation.
+ *
+ * {@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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * DeleteConversationRequest request =
+ * DeleteConversationRequest.newBuilder()
+ * .setName(ConversationName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION]").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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * ConversationName name = ConversationName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION]");
+ * Conversation response = dataChatServiceClient.getConversation(name);
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource. Format:
+ * `projects/{project}/locations/{location}/conversations/{conversation}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Conversation getConversation(ConversationName name) {
+ GetConversationRequest request =
+ GetConversationRequest.newBuilder().setName(name == null ? null : name.toString()).build();
+ return getConversation(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single conversation by using conversation id and parent.
+ *
+ * {@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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * String name = ConversationName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION]").toString();
+ * Conversation response = dataChatServiceClient.getConversation(name);
+ * }
+ * }
+ *
+ * @param name Required. Name of the resource. Format:
+ * `projects/{project}/locations/{location}/conversations/{conversation}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final Conversation getConversation(String name) {
+ GetConversationRequest request = GetConversationRequest.newBuilder().setName(name).build();
+ return getConversation(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single conversation by using conversation id and parent.
+ *
+ * {@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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * GetConversationRequest request =
+ * GetConversationRequest.newBuilder()
+ * .setName(ConversationName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION]").toString())
+ * .build();
+ * Conversation response = dataChatServiceClient.getConversation(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 Conversation getConversation(GetConversationRequest request) {
+ return getConversationCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Gets details of a single conversation by using conversation id and parent.
+ *
+ * {@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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * GetConversationRequest request =
+ * GetConversationRequest.newBuilder()
+ * .setName(ConversationName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION]").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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * for (Conversation element : dataChatServiceClient.listConversations(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Parent value for ListConversationsRequest. Format:
+ * `projects/{project}/locations/{location}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListConversationsPagedResponse listConversations(LocationName parent) {
+ ListConversationsRequest request =
+ ListConversationsRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listConversations(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists all conversations for a given parent.
+ *
+ * {@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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+ * for (Conversation element : dataChatServiceClient.listConversations(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. Parent value for ListConversationsRequest. Format:
+ * `projects/{project}/locations/{location}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListConversationsPagedResponse listConversations(String parent) {
+ ListConversationsRequest request =
+ ListConversationsRequest.newBuilder().setParent(parent).build();
+ return listConversations(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists all conversations for a given parent.
+ *
+ * {@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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * ListConversationsRequest request =
+ * ListConversationsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .build();
+ * for (Conversation element : dataChatServiceClient.listConversations(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 ListConversationsPagedResponse listConversations(ListConversationsRequest request) {
+ return listConversationsPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists all conversations for a given parent.
+ *
+ * {@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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * ListConversationsRequest request =
+ * ListConversationsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * ListConversationsRequest request =
+ * ListConversationsRequest.newBuilder()
+ * .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .build();
+ * while (true) {
+ * ListConversationsResponse response =
+ * dataChatServiceClient.listConversationsCallable().call(request);
+ * for (Conversation element : response.getConversationsList()) {
+ * // 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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * ConversationName parent = ConversationName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION]");
+ * for (StorageMessage element : dataChatServiceClient.listMessages(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The conversation to list messages under. Format:
+ * `projects/{project}/locations/{location}/conversations/{conversation_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListMessagesPagedResponse listMessages(ConversationName parent) {
+ ListMessagesRequest request =
+ ListMessagesRequest.newBuilder()
+ .setParent(parent == null ? null : parent.toString())
+ .build();
+ return listMessages(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists all messages for a given conversation.
+ *
+ * {@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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * String parent = ConversationName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION]").toString();
+ * for (StorageMessage element : dataChatServiceClient.listMessages(parent).iterateAll()) {
+ * // doThingsWith(element);
+ * }
+ * }
+ * }
+ *
+ * @param parent Required. The conversation to list messages under. Format:
+ * `projects/{project}/locations/{location}/conversations/{conversation_id}`
+ * @throws com.google.api.gax.rpc.ApiException if the remote call fails
+ */
+ public final ListMessagesPagedResponse listMessages(String parent) {
+ ListMessagesRequest request = ListMessagesRequest.newBuilder().setParent(parent).build();
+ return listMessages(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists all messages for a given conversation.
+ *
+ * {@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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * ListMessagesRequest request =
+ * ListMessagesRequest.newBuilder()
+ * .setParent(
+ * ConversationName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .build();
+ * for (StorageMessage element : dataChatServiceClient.listMessages(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 ListMessagesPagedResponse listMessages(ListMessagesRequest request) {
+ return listMessagesPagedCallable().call(request);
+ }
+
+ // AUTO-GENERATED DOCUMENTATION AND METHOD.
+ /**
+ * Lists all messages for a given conversation.
+ *
+ * {@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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * ListMessagesRequest request =
+ * ListMessagesRequest.newBuilder()
+ * .setParent(
+ * ConversationName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * ListMessagesRequest request =
+ * ListMessagesRequest.newBuilder()
+ * .setParent(
+ * ConversationName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION]").toString())
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .setFilter("filter-1274492040")
+ * .build();
+ * while (true) {
+ * ListMessagesResponse response = dataChatServiceClient.listMessagesCallable().call(request);
+ * for (StorageMessage element : response.getMessagesList()) {
+ * // 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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * for (Location element : dataChatServiceClient.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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * ListLocationsRequest request =
+ * ListLocationsRequest.newBuilder()
+ * .setName("name3373707")
+ * .setFilter("filter-1274492040")
+ * .setPageSize(883849137)
+ * .setPageToken("pageToken873572522")
+ * .build();
+ * while (true) {
+ * ListLocationsResponse response =
+ * dataChatServiceClient.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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+ * Location response = dataChatServiceClient.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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.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
+ * DataChatServiceSettings.Builder dataChatServiceSettingsBuilder =
+ * DataChatServiceSettings.newBuilder();
+ * dataChatServiceSettingsBuilder
+ * .createConversationSettings()
+ * .setRetrySettings(
+ * dataChatServiceSettingsBuilder
+ * .createConversationSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ * .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ * .setMaxAttempts(5)
+ * .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ * .setRetryDelayMultiplier(1.3)
+ * .setRpcTimeoutMultiplier(1.5)
+ * .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ * .build());
+ * DataChatServiceSettings dataChatServiceSettings = dataChatServiceSettingsBuilder.build();
+ * }
+ *
+ * Please refer to the [Client Side Retry
+ * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting
+ * retries.
+ */
+@Generated("by gapic-generator-java")
+public class DataChatServiceSettings extends ClientSettings{@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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
+ * DataAgentName name = DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]");
+ * DataAgent response = dataAgentServiceClient.getDataAgent(name);
+ * }
+ * }
+ *
+ * {@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 (DataChatServiceClient dataChatServiceClient = DataChatServiceClient.create()) {
+ * LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+ * Conversation conversation = Conversation.newBuilder().build();
+ * String conversationId = "conversationId-1676095234";
+ * Conversation response =
+ * dataChatServiceClient.createConversation(parent, conversation, conversationId);
+ * }
+ * }
+ */
+@Generated("by gapic-generator-java")
+package com.google.cloud.geminidataanalytics.v1;
+
+import javax.annotation.Generated;
diff --git a/java-geminidataanalytics/google-cloud-geminidataanalytics/src/main/java/com/google/cloud/geminidataanalytics/v1/stub/DataAgentServiceStub.java b/java-geminidataanalytics/google-cloud-geminidataanalytics/src/main/java/com/google/cloud/geminidataanalytics/v1/stub/DataAgentServiceStub.java
new file mode 100644
index 000000000000..45710752c368
--- /dev/null
+++ b/java-geminidataanalytics/google-cloud-geminidataanalytics/src/main/java/com/google/cloud/geminidataanalytics/v1/stub/DataAgentServiceStub.java
@@ -0,0 +1,151 @@
+/*
+ * Copyright 2026 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.cloud.geminidataanalytics.v1.stub;
+
+import static com.google.cloud.geminidataanalytics.v1.DataAgentServiceClient.ListAccessibleDataAgentsPagedResponse;
+import static com.google.cloud.geminidataanalytics.v1.DataAgentServiceClient.ListDataAgentsPagedResponse;
+import static com.google.cloud.geminidataanalytics.v1.DataAgentServiceClient.ListLocationsPagedResponse;
+
+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.geminidataanalytics.v1.CreateDataAgentRequest;
+import com.google.cloud.geminidataanalytics.v1.DataAgent;
+import com.google.cloud.geminidataanalytics.v1.DeleteDataAgentRequest;
+import com.google.cloud.geminidataanalytics.v1.GetDataAgentRequest;
+import com.google.cloud.geminidataanalytics.v1.ListAccessibleDataAgentsRequest;
+import com.google.cloud.geminidataanalytics.v1.ListAccessibleDataAgentsResponse;
+import com.google.cloud.geminidataanalytics.v1.ListDataAgentsRequest;
+import com.google.cloud.geminidataanalytics.v1.ListDataAgentsResponse;
+import com.google.cloud.geminidataanalytics.v1.OperationMetadata;
+import com.google.cloud.geminidataanalytics.v1.UpdateDataAgentRequest;
+import com.google.cloud.location.GetLocationRequest;
+import com.google.cloud.location.ListLocationsRequest;
+import com.google.cloud.location.ListLocationsResponse;
+import com.google.cloud.location.Location;
+import com.google.iam.v1.GetIamPolicyRequest;
+import com.google.iam.v1.Policy;
+import com.google.iam.v1.SetIamPolicyRequest;
+import com.google.longrunning.Operation;
+import com.google.longrunning.stub.OperationsStub;
+import com.google.protobuf.Empty;
+import javax.annotation.Generated;
+
+// AUTO-GENERATED DOCUMENTATION AND CLASS.
+/**
+ * Base stub class for the DataAgentService service API.
+ *
+ *
+ *
+ *
+ * {@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
+ * DataAgentServiceStubSettings.Builder dataAgentServiceSettingsBuilder =
+ * DataAgentServiceStubSettings.newBuilder();
+ * dataAgentServiceSettingsBuilder
+ * .getDataAgentSettings()
+ * .setRetrySettings(
+ * dataAgentServiceSettingsBuilder
+ * .getDataAgentSettings()
+ * .getRetrySettings()
+ * .toBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ * .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ * .setMaxAttempts(5)
+ * .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ * .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ * .setRetryDelayMultiplier(1.3)
+ * .setRpcTimeoutMultiplier(1.5)
+ * .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ * .build());
+ * DataAgentServiceStubSettings dataAgentServiceSettings = dataAgentServiceSettingsBuilder.build();
+ * }
+ *
+ * Please refer to the [Client Side Retry
+ * Guide](https://docs.cloud.google.com/java/docs/client-retries) for additional support in setting
+ * retries.
+ *
+ * {@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
+ * DataAgentServiceStubSettings.Builder dataAgentServiceSettingsBuilder =
+ * DataAgentServiceStubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ * OperationalTimedPollAlgorithm.create(
+ * RetrySettings.newBuilder()
+ * .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ * .setRetryDelayMultiplier(1.5)
+ * .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ * .setTotalTimeoutDuration(Duration.ofHours(24))
+ * .build());
+ * dataAgentServiceSettingsBuilder
+ * .createClusterOperationSettings()
+ * .setPollingAlgorithm(timedRetryAlgorithm)
+ * .build();
+ * }
+ */
+@Generated("by gapic-generator-java")
+@SuppressWarnings("CanonicalDuration")
+public class DataAgentServiceStubSettings extends StubSettings