Class ConversationDatasetsClient
- java.lang.Object
-
- com.google.cloud.dialogflow.v2.ConversationDatasetsClient
-
- All Implemented Interfaces:
com.google.api.gax.core.BackgroundResource
,AutoCloseable
@Generated("by gapic-generator-java") public class ConversationDatasetsClient extends Object implements com.google.api.gax.core.BackgroundResource
Service Description: Conversation datasets.Conversation datasets contain raw conversation files and their customizable metadata that can be used for model training.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { ConversationDatasetName name = ConversationDatasetName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION_DATASET]"); ConversationDataset response = conversationDatasetsClient.getConversationDataset(name); }
Note: close() needs to be called on the ConversationDatasetsClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns 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 ConversationDatasetsSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library ConversationDatasetsSettings conversationDatasetsSettings = ConversationDatasetsSettings.newBuilder() .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) .build(); ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create(conversationDatasetsSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library ConversationDatasetsSettings conversationDatasetsSettings = ConversationDatasetsSettings.newBuilder().setEndpoint(myEndpoint).build(); ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create(conversationDatasetsSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library ConversationDatasetsSettings conversationDatasetsSettings = ConversationDatasetsSettings.newHttpJsonBuilder().build(); ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create(conversationDatasetsSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ConversationDatasetsClient.ListConversationDatasetsFixedSizeCollection
static class
ConversationDatasetsClient.ListConversationDatasetsPage
static class
ConversationDatasetsClient.ListConversationDatasetsPagedResponse
static class
ConversationDatasetsClient.ListLocationsFixedSizeCollection
static class
ConversationDatasetsClient.ListLocationsPage
static class
ConversationDatasetsClient.ListLocationsPagedResponse
-
Constructor Summary
Constructors Modifier Constructor Description protected
ConversationDatasetsClient(ConversationDatasetsSettings settings)
Constructs an instance of ConversationDatasetsClient, using the given settings.protected
ConversationDatasetsClient(ConversationDatasetsStub stub)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
awaitTermination(long duration, TimeUnit unit)
void
close()
static ConversationDatasetsClient
create()
Constructs an instance of ConversationDatasetsClient with default settings.static ConversationDatasetsClient
create(ConversationDatasetsSettings settings)
Constructs an instance of ConversationDatasetsClient, using the given settings.static ConversationDatasetsClient
create(ConversationDatasetsStub stub)
Constructs an instance of ConversationDatasetsClient, using the given stub for making calls.com.google.api.gax.longrunning.OperationFuture<ConversationDataset,CreateConversationDatasetOperationMetadata>
createConversationDatasetAsync(CreateConversationDatasetRequest request)
Creates a new conversation dataset.com.google.api.gax.longrunning.OperationFuture<ConversationDataset,CreateConversationDatasetOperationMetadata>
createConversationDatasetAsync(String parent, ConversationDataset conversationDataset)
Creates a new conversation dataset.com.google.api.gax.rpc.UnaryCallable<CreateConversationDatasetRequest,com.google.longrunning.Operation>
createConversationDatasetCallable()
Creates a new conversation dataset.com.google.api.gax.rpc.OperationCallable<CreateConversationDatasetRequest,ConversationDataset,CreateConversationDatasetOperationMetadata>
createConversationDatasetOperationCallable()
Creates a new conversation dataset.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteConversationDatasetOperationMetadata>
deleteConversationDatasetAsync(ConversationDatasetName name)
Deletes the specified conversation dataset.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteConversationDatasetOperationMetadata>
deleteConversationDatasetAsync(DeleteConversationDatasetRequest request)
Deletes the specified conversation dataset.com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteConversationDatasetOperationMetadata>
deleteConversationDatasetAsync(String name)
Deletes the specified conversation dataset.com.google.api.gax.rpc.UnaryCallable<DeleteConversationDatasetRequest,com.google.longrunning.Operation>
deleteConversationDatasetCallable()
Deletes the specified conversation dataset.com.google.api.gax.rpc.OperationCallable<DeleteConversationDatasetRequest,com.google.protobuf.Empty,DeleteConversationDatasetOperationMetadata>
deleteConversationDatasetOperationCallable()
Deletes the specified conversation dataset.ConversationDataset
getConversationDataset(ConversationDatasetName name)
Retrieves the specified conversation dataset.ConversationDataset
getConversationDataset(GetConversationDatasetRequest request)
Retrieves the specified conversation dataset.ConversationDataset
getConversationDataset(String name)
Retrieves the specified conversation dataset.com.google.api.gax.rpc.UnaryCallable<GetConversationDatasetRequest,ConversationDataset>
getConversationDatasetCallable()
Retrieves the specified conversation dataset.com.google.api.gax.httpjson.longrunning.OperationsClient
getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.com.google.cloud.location.Location
getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>
getLocationCallable()
Gets information about a location.com.google.longrunning.OperationsClient
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.ConversationDatasetsSettings
getSettings()
ConversationDatasetsStub
getStub()
com.google.api.gax.longrunning.OperationFuture<ImportConversationDataOperationResponse,ImportConversationDataOperationMetadata>
importConversationDataAsync(ImportConversationDataRequest request)
Import data into the specified conversation dataset.com.google.api.gax.rpc.UnaryCallable<ImportConversationDataRequest,com.google.longrunning.Operation>
importConversationDataCallable()
Import data into the specified conversation dataset.com.google.api.gax.rpc.OperationCallable<ImportConversationDataRequest,ImportConversationDataOperationResponse,ImportConversationDataOperationMetadata>
importConversationDataOperationCallable()
Import data into the specified conversation dataset.boolean
isShutdown()
boolean
isTerminated()
ConversationDatasetsClient.ListConversationDatasetsPagedResponse
listConversationDatasets(ListConversationDatasetsRequest request)
Returns the list of all conversation datasets in the specified project and location.ConversationDatasetsClient.ListConversationDatasetsPagedResponse
listConversationDatasets(LocationName parent)
Returns the list of all conversation datasets in the specified project and location.ConversationDatasetsClient.ListConversationDatasetsPagedResponse
listConversationDatasets(String parent)
Returns the list of all conversation datasets in the specified project and location.com.google.api.gax.rpc.UnaryCallable<ListConversationDatasetsRequest,ListConversationDatasetsResponse>
listConversationDatasetsCallable()
Returns the list of all conversation datasets in the specified project and location.com.google.api.gax.rpc.UnaryCallable<ListConversationDatasetsRequest,ConversationDatasetsClient.ListConversationDatasetsPagedResponse>
listConversationDatasetsPagedCallable()
Returns the list of all conversation datasets in the specified project and location.ConversationDatasetsClient.ListLocationsPagedResponse
listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>
listLocationsCallable()
Lists information about the supported locations for this service.com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,ConversationDatasetsClient.ListLocationsPagedResponse>
listLocationsPagedCallable()
Lists information about the supported locations for this service.void
shutdown()
void
shutdownNow()
-
-
-
Constructor Detail
-
ConversationDatasetsClient
protected ConversationDatasetsClient(ConversationDatasetsSettings settings) throws IOException
Constructs an instance of ConversationDatasetsClient, 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.- Throws:
IOException
-
ConversationDatasetsClient
protected ConversationDatasetsClient(ConversationDatasetsStub stub)
-
-
Method Detail
-
create
public static final ConversationDatasetsClient create() throws IOException
Constructs an instance of ConversationDatasetsClient with default settings.- Throws:
IOException
-
create
public static final ConversationDatasetsClient create(ConversationDatasetsSettings settings) throws IOException
Constructs an instance of ConversationDatasetsClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
public static final ConversationDatasetsClient create(ConversationDatasetsStub stub)
Constructs an instance of ConversationDatasetsClient, using the given stub for making calls. This is for advanced usage - prefer using create(ConversationDatasetsSettings).
-
getSettings
public final ConversationDatasetsSettings getSettings()
-
getStub
public ConversationDatasetsStub getStub()
-
getOperationsClient
public final com.google.longrunning.OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
-
getHttpJsonOperationsClient
@BetaApi public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
-
createConversationDatasetAsync
public final com.google.api.gax.longrunning.OperationFuture<ConversationDataset,CreateConversationDatasetOperationMetadata> createConversationDatasetAsync(String parent, ConversationDataset conversationDataset)
Creates a new conversation dataset.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: [CreateConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.CreateConversationDatasetOperationMetadata] - `response`: [ConversationDataset][google.cloud.dialogflow.v2.ConversationDataset]
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { String parent = "parent-995424086"; ConversationDataset conversationDataset = ConversationDataset.newBuilder().build(); ConversationDataset response = conversationDatasetsClient .createConversationDatasetAsync(parent, conversationDataset) .get(); }
- Parameters:
parent
- Required. The project to create conversation dataset for. Format: `projects/<Project ID>/locations/<Location ID>`conversationDataset
- Required. The conversation dataset to create.- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
createConversationDatasetAsync
public final com.google.api.gax.longrunning.OperationFuture<ConversationDataset,CreateConversationDatasetOperationMetadata> createConversationDatasetAsync(CreateConversationDatasetRequest request)
Creates a new conversation dataset.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: [CreateConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.CreateConversationDatasetOperationMetadata] - `response`: [ConversationDataset][google.cloud.dialogflow.v2.ConversationDataset]
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { CreateConversationDatasetRequest request = CreateConversationDatasetRequest.newBuilder() .setParent("parent-995424086") .setConversationDataset(ConversationDataset.newBuilder().build()) .build(); ConversationDataset response = conversationDatasetsClient.createConversationDatasetAsync(request).get(); }
- Parameters:
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
-
createConversationDatasetOperationCallable
public final com.google.api.gax.rpc.OperationCallable<CreateConversationDatasetRequest,ConversationDataset,CreateConversationDatasetOperationMetadata> createConversationDatasetOperationCallable()
Creates a new conversation dataset.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: [CreateConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.CreateConversationDatasetOperationMetadata] - `response`: [ConversationDataset][google.cloud.dialogflow.v2.ConversationDataset]
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { CreateConversationDatasetRequest request = CreateConversationDatasetRequest.newBuilder() .setParent("parent-995424086") .setConversationDataset(ConversationDataset.newBuilder().build()) .build(); OperationFuture<ConversationDataset, CreateConversationDatasetOperationMetadata> future = conversationDatasetsClient .createConversationDatasetOperationCallable() .futureCall(request); // Do something. ConversationDataset response = future.get(); }
-
createConversationDatasetCallable
public final com.google.api.gax.rpc.UnaryCallable<CreateConversationDatasetRequest,com.google.longrunning.Operation> createConversationDatasetCallable()
Creates a new conversation dataset.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: [CreateConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.CreateConversationDatasetOperationMetadata] - `response`: [ConversationDataset][google.cloud.dialogflow.v2.ConversationDataset]
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { CreateConversationDatasetRequest request = CreateConversationDatasetRequest.newBuilder() .setParent("parent-995424086") .setConversationDataset(ConversationDataset.newBuilder().build()) .build(); ApiFuture<Operation> future = conversationDatasetsClient.createConversationDatasetCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
getConversationDataset
public final ConversationDataset getConversationDataset(ConversationDatasetName name)
Retrieves the specified conversation dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { ConversationDatasetName name = ConversationDatasetName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION_DATASET]"); ConversationDataset response = conversationDatasetsClient.getConversationDataset(name); }
- Parameters:
name
- Required. The conversation dataset to retrieve. Format: `projects/<Project ID>/locations/<Location ID>/conversationDatasets/<Conversation Dataset ID>`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getConversationDataset
public final ConversationDataset getConversationDataset(String name)
Retrieves the specified conversation dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { String name = ConversationDatasetName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION_DATASET]") .toString(); ConversationDataset response = conversationDatasetsClient.getConversationDataset(name); }
- Parameters:
name
- Required. The conversation dataset to retrieve. Format: `projects/<Project ID>/locations/<Location ID>/conversationDatasets/<Conversation Dataset ID>`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
getConversationDataset
public final ConversationDataset getConversationDataset(GetConversationDatasetRequest request)
Retrieves the specified conversation dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { GetConversationDatasetRequest request = GetConversationDatasetRequest.newBuilder() .setName( ConversationDatasetName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION_DATASET]") .toString()) .build(); ConversationDataset response = conversationDatasetsClient.getConversationDataset(request); }
- Parameters:
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
-
getConversationDatasetCallable
public final com.google.api.gax.rpc.UnaryCallable<GetConversationDatasetRequest,ConversationDataset> getConversationDatasetCallable()
Retrieves the specified conversation dataset.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { GetConversationDatasetRequest request = GetConversationDatasetRequest.newBuilder() .setName( ConversationDatasetName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION_DATASET]") .toString()) .build(); ApiFuture<ConversationDataset> future = conversationDatasetsClient.getConversationDatasetCallable().futureCall(request); // Do something. ConversationDataset response = future.get(); }
-
listConversationDatasets
public final ConversationDatasetsClient.ListConversationDatasetsPagedResponse listConversationDatasets(LocationName parent)
Returns the list of all conversation datasets in the specified project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (ConversationDataset element : conversationDatasetsClient.listConversationDatasets(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. The project and location name to list all conversation datasets for. Format: `projects/<Project ID>/locations/<Location ID>`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listConversationDatasets
public final ConversationDatasetsClient.ListConversationDatasetsPagedResponse listConversationDatasets(String parent)
Returns the list of all conversation datasets in the specified project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (ConversationDataset element : conversationDatasetsClient.listConversationDatasets(parent).iterateAll()) { // doThingsWith(element); } }
- Parameters:
parent
- Required. The project and location name to list all conversation datasets for. Format: `projects/<Project ID>/locations/<Location ID>`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
listConversationDatasets
public final ConversationDatasetsClient.ListConversationDatasetsPagedResponse listConversationDatasets(ListConversationDatasetsRequest request)
Returns the list of all conversation datasets in the specified project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { ListConversationDatasetsRequest request = ListConversationDatasetsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (ConversationDataset element : conversationDatasetsClient.listConversationDatasets(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
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
-
listConversationDatasetsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<ListConversationDatasetsRequest,ConversationDatasetsClient.ListConversationDatasetsPagedResponse> listConversationDatasetsPagedCallable()
Returns the list of all conversation datasets in the specified project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { ListConversationDatasetsRequest request = ListConversationDatasetsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<ConversationDataset> future = conversationDatasetsClient.listConversationDatasetsPagedCallable().futureCall(request); // Do something. for (ConversationDataset element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listConversationDatasetsCallable
public final com.google.api.gax.rpc.UnaryCallable<ListConversationDatasetsRequest,ListConversationDatasetsResponse> listConversationDatasetsCallable()
Returns the list of all conversation datasets in the specified project and location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { ListConversationDatasetsRequest request = ListConversationDatasetsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListConversationDatasetsResponse response = conversationDatasetsClient.listConversationDatasetsCallable().call(request); for (ConversationDataset element : response.getConversationDatasetsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } }
-
deleteConversationDatasetAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteConversationDatasetOperationMetadata> deleteConversationDatasetAsync(ConversationDatasetName name)
Deletes the specified conversation dataset.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: [DeleteConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationDatasetOperationMetadata] - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { ConversationDatasetName name = ConversationDatasetName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION_DATASET]"); conversationDatasetsClient.deleteConversationDatasetAsync(name).get(); }
- Parameters:
name
- Required. The conversation dataset to delete. Format: `projects/<Project ID>/locations/<Location ID>/conversationDatasets/<Conversation Dataset ID>`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteConversationDatasetAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteConversationDatasetOperationMetadata> deleteConversationDatasetAsync(String name)
Deletes the specified conversation dataset.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: [DeleteConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationDatasetOperationMetadata] - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { String name = ConversationDatasetName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION_DATASET]") .toString(); conversationDatasetsClient.deleteConversationDatasetAsync(name).get(); }
- Parameters:
name
- Required. The conversation dataset to delete. Format: `projects/<Project ID>/locations/<Location ID>/conversationDatasets/<Conversation Dataset ID>`- Throws:
com.google.api.gax.rpc.ApiException
- if the remote call fails
-
deleteConversationDatasetAsync
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteConversationDatasetOperationMetadata> deleteConversationDatasetAsync(DeleteConversationDatasetRequest request)
Deletes the specified conversation dataset.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: [DeleteConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationDatasetOperationMetadata] - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { DeleteConversationDatasetRequest request = DeleteConversationDatasetRequest.newBuilder() .setName( ConversationDatasetName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION_DATASET]") .toString()) .build(); conversationDatasetsClient.deleteConversationDatasetAsync(request).get(); }
- Parameters:
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
-
deleteConversationDatasetOperationCallable
public final com.google.api.gax.rpc.OperationCallable<DeleteConversationDatasetRequest,com.google.protobuf.Empty,DeleteConversationDatasetOperationMetadata> deleteConversationDatasetOperationCallable()
Deletes the specified conversation dataset.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: [DeleteConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationDatasetOperationMetadata] - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { DeleteConversationDatasetRequest request = DeleteConversationDatasetRequest.newBuilder() .setName( ConversationDatasetName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION_DATASET]") .toString()) .build(); OperationFuture<Empty, DeleteConversationDatasetOperationMetadata> future = conversationDatasetsClient .deleteConversationDatasetOperationCallable() .futureCall(request); // Do something. future.get(); }
-
deleteConversationDatasetCallable
public final com.google.api.gax.rpc.UnaryCallable<DeleteConversationDatasetRequest,com.google.longrunning.Operation> deleteConversationDatasetCallable()
Deletes the specified conversation dataset.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: [DeleteConversationDatasetOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationDatasetOperationMetadata] - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { DeleteConversationDatasetRequest request = DeleteConversationDatasetRequest.newBuilder() .setName( ConversationDatasetName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION_DATASET]") .toString()) .build(); ApiFuture<Operation> future = conversationDatasetsClient.deleteConversationDatasetCallable().futureCall(request); // Do something. future.get(); }
-
importConversationDataAsync
public final com.google.api.gax.longrunning.OperationFuture<ImportConversationDataOperationResponse,ImportConversationDataOperationMetadata> importConversationDataAsync(ImportConversationDataRequest request)
Import data into the specified conversation dataset. Note that it is not allowed to import data to a conversation dataset that already has data in it.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: [ImportConversationDataOperationMetadata][google.cloud.dialogflow.v2.ImportConversationDataOperationMetadata] - `response`: [ImportConversationDataOperationResponse][google.cloud.dialogflow.v2.ImportConversationDataOperationResponse]
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { ImportConversationDataRequest request = ImportConversationDataRequest.newBuilder() .setName( ConversationDatasetName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION_DATASET]") .toString()) .setInputConfig(InputConfig.newBuilder().build()) .build(); ImportConversationDataOperationResponse response = conversationDatasetsClient.importConversationDataAsync(request).get(); }
- Parameters:
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
-
importConversationDataOperationCallable
public final com.google.api.gax.rpc.OperationCallable<ImportConversationDataRequest,ImportConversationDataOperationResponse,ImportConversationDataOperationMetadata> importConversationDataOperationCallable()
Import data into the specified conversation dataset. Note that it is not allowed to import data to a conversation dataset that already has data in it.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: [ImportConversationDataOperationMetadata][google.cloud.dialogflow.v2.ImportConversationDataOperationMetadata] - `response`: [ImportConversationDataOperationResponse][google.cloud.dialogflow.v2.ImportConversationDataOperationResponse]
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { ImportConversationDataRequest request = ImportConversationDataRequest.newBuilder() .setName( ConversationDatasetName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION_DATASET]") .toString()) .setInputConfig(InputConfig.newBuilder().build()) .build(); OperationFuture< ImportConversationDataOperationResponse, ImportConversationDataOperationMetadata> future = conversationDatasetsClient .importConversationDataOperationCallable() .futureCall(request); // Do something. ImportConversationDataOperationResponse response = future.get(); }
-
importConversationDataCallable
public final com.google.api.gax.rpc.UnaryCallable<ImportConversationDataRequest,com.google.longrunning.Operation> importConversationDataCallable()
Import data into the specified conversation dataset. Note that it is not allowed to import data to a conversation dataset that already has data in it.This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:
- `metadata`: [ImportConversationDataOperationMetadata][google.cloud.dialogflow.v2.ImportConversationDataOperationMetadata] - `response`: [ImportConversationDataOperationResponse][google.cloud.dialogflow.v2.ImportConversationDataOperationResponse]
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { ImportConversationDataRequest request = ImportConversationDataRequest.newBuilder() .setName( ConversationDatasetName.of("[PROJECT]", "[LOCATION]", "[CONVERSATION_DATASET]") .toString()) .setInputConfig(InputConfig.newBuilder().build()) .build(); ApiFuture<Operation> future = conversationDatasetsClient.importConversationDataCallable().futureCall(request); // Do something. Operation response = future.get(); }
-
listLocations
public final ConversationDatasetsClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : conversationDatasetsClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }
- Parameters:
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
-
listLocationsPagedCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,ConversationDatasetsClient.ListLocationsPagedResponse> listLocationsPagedCallable()
Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = conversationDatasetsClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } }
-
listLocationsCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
Lists information about the supported locations for this service.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = conversationDatasetsClient.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; } } }
-
getLocation
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = conversationDatasetsClient.getLocation(request); }
- Parameters:
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
-
getLocationCallable
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
Gets information about a location.Sample code:
// This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library try (ConversationDatasetsClient conversationDatasetsClient = ConversationDatasetsClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = conversationDatasetsClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); }
-
close
public final void close()
- Specified by:
close
in interfaceAutoCloseable
-
shutdown
public void shutdown()
- Specified by:
shutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdown
in interfacecom.google.api.gax.core.BackgroundResource
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminated
in interfacecom.google.api.gax.core.BackgroundResource
-
shutdownNow
public void shutdownNow()
- Specified by:
shutdownNow
in interfacecom.google.api.gax.core.BackgroundResource
-
awaitTermination
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
- Specified by:
awaitTermination
in interfacecom.google.api.gax.core.BackgroundResource
- Throws:
InterruptedException
-
-