@Generated(value="by gapic-generator-java") public class ConversationProfilesClient extends Object implements BackgroundResource
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
ConversationProfileName name =
ConversationProfileName.ofProjectConversationProfileName(
"[PROJECT]", "[CONVERSATION_PROFILE]");
ConversationProfile response = conversationProfilesClient.getConversationProfile(name);
}
Note: close() needs to be called on the ConversationProfilesClient 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:
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 ConversationProfilesSettings 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
ConversationProfilesSettings conversationProfilesSettings =
ConversationProfilesSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create(conversationProfilesSettings);
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
ConversationProfilesSettings conversationProfilesSettings =
ConversationProfilesSettings.newBuilder().setEndpoint(myEndpoint).build();
ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create(conversationProfilesSettings);
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
ConversationProfilesSettings conversationProfilesSettings =
ConversationProfilesSettings.newBuilder()
.setTransportChannelProvider(
ConversationProfilesSettings.defaultHttpJsonTransportProviderBuilder().build())
.build();
ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create(conversationProfilesSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Modifier and Type | Class and Description |
---|---|
static class |
ConversationProfilesClient.ListConversationProfilesFixedSizeCollection |
static class |
ConversationProfilesClient.ListConversationProfilesPage |
static class |
ConversationProfilesClient.ListConversationProfilesPagedResponse |
static class |
ConversationProfilesClient.ListLocationsFixedSizeCollection |
static class |
ConversationProfilesClient.ListLocationsPage |
static class |
ConversationProfilesClient.ListLocationsPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
ConversationProfilesClient(ConversationProfilesSettings settings)
Constructs an instance of ConversationProfilesClient, using the given settings.
|
protected |
ConversationProfilesClient(ConversationProfilesStub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
OperationFuture<ConversationProfile,ClearSuggestionFeatureConfigOperationMetadata> |
clearSuggestionFeatureConfigAsync(ClearSuggestionFeatureConfigRequest request)
Clears a suggestion feature from a conversation profile for the given participant role.
|
OperationFuture<ConversationProfile,ClearSuggestionFeatureConfigOperationMetadata> |
clearSuggestionFeatureConfigAsync(String conversationProfile)
Clears a suggestion feature from a conversation profile for the given participant role.
|
UnaryCallable<ClearSuggestionFeatureConfigRequest,Operation> |
clearSuggestionFeatureConfigCallable()
Clears a suggestion feature from a conversation profile for the given participant role.
|
OperationCallable<ClearSuggestionFeatureConfigRequest,ConversationProfile,ClearSuggestionFeatureConfigOperationMetadata> |
clearSuggestionFeatureConfigOperationCallable()
Clears a suggestion feature from a conversation profile for the given participant role.
|
void |
close() |
static ConversationProfilesClient |
create()
Constructs an instance of ConversationProfilesClient with default settings.
|
static ConversationProfilesClient |
create(ConversationProfilesSettings settings)
Constructs an instance of ConversationProfilesClient, using the given settings.
|
static ConversationProfilesClient |
create(ConversationProfilesStub stub)
Constructs an instance of ConversationProfilesClient, using the given stub for making calls.
|
ConversationProfile |
createConversationProfile(CreateConversationProfileRequest request)
Creates a conversation profile in the specified project.
|
ConversationProfile |
createConversationProfile(LocationName parent,
ConversationProfile conversationProfile)
Creates a conversation profile in the specified project.
|
ConversationProfile |
createConversationProfile(ProjectName parent,
ConversationProfile conversationProfile)
Creates a conversation profile in the specified project.
|
ConversationProfile |
createConversationProfile(String parent,
ConversationProfile conversationProfile)
Creates a conversation profile in the specified project.
|
UnaryCallable<CreateConversationProfileRequest,ConversationProfile> |
createConversationProfileCallable()
Creates a conversation profile in the specified project.
|
void |
deleteConversationProfile(ConversationProfileName name)
Deletes the specified conversation profile.
|
void |
deleteConversationProfile(DeleteConversationProfileRequest request)
Deletes the specified conversation profile.
|
void |
deleteConversationProfile(String name)
Deletes the specified conversation profile.
|
UnaryCallable<DeleteConversationProfileRequest,Empty> |
deleteConversationProfileCallable()
Deletes the specified conversation profile.
|
ConversationProfile |
getConversationProfile(ConversationProfileName name)
Retrieves the specified conversation profile.
|
ConversationProfile |
getConversationProfile(GetConversationProfileRequest request)
Retrieves the specified conversation profile.
|
ConversationProfile |
getConversationProfile(String name)
Retrieves the specified conversation profile.
|
UnaryCallable<GetConversationProfileRequest,ConversationProfile> |
getConversationProfileCallable()
Retrieves the specified conversation profile.
|
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.
|
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
getLocationCallable()
Gets information about a location.
|
OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
ConversationProfilesSettings |
getSettings() |
ConversationProfilesStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
ConversationProfilesClient.ListConversationProfilesPagedResponse |
listConversationProfiles(ListConversationProfilesRequest request)
Returns the list of all conversation profiles in the specified project.
|
ConversationProfilesClient.ListConversationProfilesPagedResponse |
listConversationProfiles(LocationName parent)
Returns the list of all conversation profiles in the specified project.
|
ConversationProfilesClient.ListConversationProfilesPagedResponse |
listConversationProfiles(ProjectName parent)
Returns the list of all conversation profiles in the specified project.
|
ConversationProfilesClient.ListConversationProfilesPagedResponse |
listConversationProfiles(String parent)
Returns the list of all conversation profiles in the specified project.
|
UnaryCallable<ListConversationProfilesRequest,ListConversationProfilesResponse> |
listConversationProfilesCallable()
Returns the list of all conversation profiles in the specified project.
|
UnaryCallable<ListConversationProfilesRequest,ConversationProfilesClient.ListConversationProfilesPagedResponse> |
listConversationProfilesPagedCallable()
Returns the list of all conversation profiles in the specified project.
|
ConversationProfilesClient.ListLocationsPagedResponse |
listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.
|
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
listLocationsCallable()
Lists information about the supported locations for this service.
|
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ConversationProfilesClient.ListLocationsPagedResponse> |
listLocationsPagedCallable()
Lists information about the supported locations for this service.
|
OperationFuture<ConversationProfile,SetSuggestionFeatureConfigOperationMetadata> |
setSuggestionFeatureConfigAsync(SetSuggestionFeatureConfigRequest request)
Adds or updates a suggestion feature in a conversation profile.
|
OperationFuture<ConversationProfile,SetSuggestionFeatureConfigOperationMetadata> |
setSuggestionFeatureConfigAsync(String conversationProfile)
Adds or updates a suggestion feature in a conversation profile.
|
UnaryCallable<SetSuggestionFeatureConfigRequest,Operation> |
setSuggestionFeatureConfigCallable()
Adds or updates a suggestion feature in a conversation profile.
|
OperationCallable<SetSuggestionFeatureConfigRequest,ConversationProfile,SetSuggestionFeatureConfigOperationMetadata> |
setSuggestionFeatureConfigOperationCallable()
Adds or updates a suggestion feature in a conversation profile.
|
void |
shutdown() |
void |
shutdownNow() |
ConversationProfile |
updateConversationProfile(ConversationProfile conversationProfile,
FieldMask updateMask)
Updates the specified conversation profile.
|
ConversationProfile |
updateConversationProfile(UpdateConversationProfileRequest request)
Updates the specified conversation profile.
|
UnaryCallable<UpdateConversationProfileRequest,ConversationProfile> |
updateConversationProfileCallable()
Updates the specified conversation profile.
|
protected ConversationProfilesClient(ConversationProfilesSettings settings) throws IOException
IOException
protected ConversationProfilesClient(ConversationProfilesStub stub)
public static final ConversationProfilesClient create() throws IOException
IOException
public static final ConversationProfilesClient create(ConversationProfilesSettings settings) throws IOException
IOException
public static final ConversationProfilesClient create(ConversationProfilesStub stub)
public final ConversationProfilesSettings getSettings()
public ConversationProfilesStub getStub()
public final OperationsClient getOperationsClient()
@BetaApi public final OperationsClient getHttpJsonOperationsClient()
public final ConversationProfilesClient.ListConversationProfilesPagedResponse listConversationProfiles(LocationName parent)
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (ConversationProfile element :
conversationProfilesClient.listConversationProfiles(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The project to list all conversation profiles from. Format:
`projects/<Project ID>/locations/<Location ID>`.ApiException
- if the remote call failspublic final ConversationProfilesClient.ListConversationProfilesPagedResponse listConversationProfiles(ProjectName parent)
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
for (ConversationProfile element :
conversationProfilesClient.listConversationProfiles(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The project to list all conversation profiles from. Format:
`projects/<Project ID>/locations/<Location ID>`.ApiException
- if the remote call failspublic final ConversationProfilesClient.ListConversationProfilesPagedResponse listConversationProfiles(String parent)
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
for (ConversationProfile element :
conversationProfilesClient.listConversationProfiles(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The project to list all conversation profiles from. Format:
`projects/<Project ID>/locations/<Location ID>`.ApiException
- if the remote call failspublic final ConversationProfilesClient.ListConversationProfilesPagedResponse listConversationProfiles(ListConversationProfilesRequest request)
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
ListConversationProfilesRequest request =
ListConversationProfilesRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (ConversationProfile element :
conversationProfilesClient.listConversationProfiles(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<ListConversationProfilesRequest,ConversationProfilesClient.ListConversationProfilesPagedResponse> listConversationProfilesPagedCallable()
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
ListConversationProfilesRequest request =
ListConversationProfilesRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<ConversationProfile> future =
conversationProfilesClient.listConversationProfilesPagedCallable().futureCall(request);
// Do something.
for (ConversationProfile element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<ListConversationProfilesRequest,ListConversationProfilesResponse> listConversationProfilesCallable()
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
ListConversationProfilesRequest request =
ListConversationProfilesRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListConversationProfilesResponse response =
conversationProfilesClient.listConversationProfilesCallable().call(request);
for (ConversationProfile element : response.getConversationProfilesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final ConversationProfile getConversationProfile(ConversationProfileName name)
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
ConversationProfileName name =
ConversationProfileName.ofProjectConversationProfileName(
"[PROJECT]", "[CONVERSATION_PROFILE]");
ConversationProfile response = conversationProfilesClient.getConversationProfile(name);
}
name
- Required. The resource name of the conversation profile. Format:
`projects/<Project ID>/locations/<Location
ID>/conversationProfiles/<Conversation Profile ID>`.ApiException
- if the remote call failspublic final ConversationProfile getConversationProfile(String name)
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
String name =
ConversationProfileName.ofProjectConversationProfileName(
"[PROJECT]", "[CONVERSATION_PROFILE]")
.toString();
ConversationProfile response = conversationProfilesClient.getConversationProfile(name);
}
name
- Required. The resource name of the conversation profile. Format:
`projects/<Project ID>/locations/<Location
ID>/conversationProfiles/<Conversation Profile ID>`.ApiException
- if the remote call failspublic final ConversationProfile getConversationProfile(GetConversationProfileRequest request)
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
GetConversationProfileRequest request =
GetConversationProfileRequest.newBuilder()
.setName(
ConversationProfileName.ofProjectConversationProfileName(
"[PROJECT]", "[CONVERSATION_PROFILE]")
.toString())
.build();
ConversationProfile response = conversationProfilesClient.getConversationProfile(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<GetConversationProfileRequest,ConversationProfile> getConversationProfileCallable()
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
GetConversationProfileRequest request =
GetConversationProfileRequest.newBuilder()
.setName(
ConversationProfileName.ofProjectConversationProfileName(
"[PROJECT]", "[CONVERSATION_PROFILE]")
.toString())
.build();
ApiFuture<ConversationProfile> future =
conversationProfilesClient.getConversationProfileCallable().futureCall(request);
// Do something.
ConversationProfile response = future.get();
}
public final ConversationProfile createConversationProfile(LocationName parent, ConversationProfile conversationProfile)
[ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] aren't populated in the response. You can retrieve them via [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] API.
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
ConversationProfile conversationProfile = ConversationProfile.newBuilder().build();
ConversationProfile response =
conversationProfilesClient.createConversationProfile(parent, conversationProfile);
}
parent
- Required. The project to create a conversation profile for. Format:
`projects/<Project ID>/locations/<Location ID>`.conversationProfile
- Required. The conversation profile to create.ApiException
- if the remote call failspublic final ConversationProfile createConversationProfile(ProjectName parent, ConversationProfile conversationProfile)
[ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] aren't populated in the response. You can retrieve them via [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] API.
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ConversationProfile conversationProfile = ConversationProfile.newBuilder().build();
ConversationProfile response =
conversationProfilesClient.createConversationProfile(parent, conversationProfile);
}
parent
- Required. The project to create a conversation profile for. Format:
`projects/<Project ID>/locations/<Location ID>`.conversationProfile
- Required. The conversation profile to create.ApiException
- if the remote call failspublic final ConversationProfile createConversationProfile(String parent, ConversationProfile conversationProfile)
[ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] aren't populated in the response. You can retrieve them via [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] API.
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
ConversationProfile conversationProfile = ConversationProfile.newBuilder().build();
ConversationProfile response =
conversationProfilesClient.createConversationProfile(parent, conversationProfile);
}
parent
- Required. The project to create a conversation profile for. Format:
`projects/<Project ID>/locations/<Location ID>`.conversationProfile
- Required. The conversation profile to create.ApiException
- if the remote call failspublic final ConversationProfile createConversationProfile(CreateConversationProfileRequest request)
[ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] aren't populated in the response. You can retrieve them via [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] API.
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
CreateConversationProfileRequest request =
CreateConversationProfileRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setConversationProfile(ConversationProfile.newBuilder().build())
.build();
ConversationProfile response = conversationProfilesClient.createConversationProfile(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<CreateConversationProfileRequest,ConversationProfile> createConversationProfileCallable()
[ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] aren't populated in the response. You can retrieve them via [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] API.
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
CreateConversationProfileRequest request =
CreateConversationProfileRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setConversationProfile(ConversationProfile.newBuilder().build())
.build();
ApiFuture<ConversationProfile> future =
conversationProfilesClient.createConversationProfileCallable().futureCall(request);
// Do something.
ConversationProfile response = future.get();
}
public final ConversationProfile updateConversationProfile(ConversationProfile conversationProfile, FieldMask updateMask)
[ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] aren't populated in the response. You can retrieve them via [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] API.
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
ConversationProfile conversationProfile = ConversationProfile.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
ConversationProfile response =
conversationProfilesClient.updateConversationProfile(conversationProfile, updateMask);
}
conversationProfile
- Required. The conversation profile to update.updateMask
- Required. The mask to control which fields to update.ApiException
- if the remote call failspublic final ConversationProfile updateConversationProfile(UpdateConversationProfileRequest request)
[ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] aren't populated in the response. You can retrieve them via [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] API.
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
UpdateConversationProfileRequest request =
UpdateConversationProfileRequest.newBuilder()
.setConversationProfile(ConversationProfile.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ConversationProfile response = conversationProfilesClient.updateConversationProfile(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<UpdateConversationProfileRequest,ConversationProfile> updateConversationProfileCallable()
[ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] aren't populated in the response. You can retrieve them via [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] API.
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
UpdateConversationProfileRequest request =
UpdateConversationProfileRequest.newBuilder()
.setConversationProfile(ConversationProfile.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<ConversationProfile> future =
conversationProfilesClient.updateConversationProfileCallable().futureCall(request);
// Do something.
ConversationProfile response = future.get();
}
public final void deleteConversationProfile(ConversationProfileName name)
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
ConversationProfileName name =
ConversationProfileName.ofProjectConversationProfileName(
"[PROJECT]", "[CONVERSATION_PROFILE]");
conversationProfilesClient.deleteConversationProfile(name);
}
name
- Required. The name of the conversation profile to delete. Format:
`projects/<Project ID>/locations/<Location
ID>/conversationProfiles/<Conversation Profile ID>`.ApiException
- if the remote call failspublic final void deleteConversationProfile(String name)
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
String name =
ConversationProfileName.ofProjectConversationProfileName(
"[PROJECT]", "[CONVERSATION_PROFILE]")
.toString();
conversationProfilesClient.deleteConversationProfile(name);
}
name
- Required. The name of the conversation profile to delete. Format:
`projects/<Project ID>/locations/<Location
ID>/conversationProfiles/<Conversation Profile ID>`.ApiException
- if the remote call failspublic final void deleteConversationProfile(DeleteConversationProfileRequest request)
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
DeleteConversationProfileRequest request =
DeleteConversationProfileRequest.newBuilder()
.setName(
ConversationProfileName.ofProjectConversationProfileName(
"[PROJECT]", "[CONVERSATION_PROFILE]")
.toString())
.build();
conversationProfilesClient.deleteConversationProfile(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<DeleteConversationProfileRequest,Empty> deleteConversationProfileCallable()
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
DeleteConversationProfileRequest request =
DeleteConversationProfileRequest.newBuilder()
.setName(
ConversationProfileName.ofProjectConversationProfileName(
"[PROJECT]", "[CONVERSATION_PROFILE]")
.toString())
.build();
ApiFuture<Empty> future =
conversationProfilesClient.deleteConversationProfileCallable().futureCall(request);
// Do something.
future.get();
}
public final OperationFuture<ConversationProfile,SetSuggestionFeatureConfigOperationMetadata> setSuggestionFeatureConfigAsync(String conversationProfile)
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`: [SetSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata] - `response`: [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile]
If a long running operation to add or update suggestion feature config for the same conversation profile, participant role and suggestion feature type exists, please cancel the existing long running operation before sending such request, otherwise the request will be rejected.
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
String conversationProfile = "conversationProfile1691597734";
ConversationProfile response =
conversationProfilesClient.setSuggestionFeatureConfigAsync(conversationProfile).get();
}
conversationProfile
- Required. The Conversation Profile to add or update the suggestion
feature config. Format: `projects/<Project ID>/locations/<Location
ID>/conversationProfiles/<Conversation Profile ID>`.ApiException
- if the remote call failspublic final OperationFuture<ConversationProfile,SetSuggestionFeatureConfigOperationMetadata> setSuggestionFeatureConfigAsync(SetSuggestionFeatureConfigRequest request)
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`: [SetSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata] - `response`: [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile]
If a long running operation to add or update suggestion feature config for the same conversation profile, participant role and suggestion feature type exists, please cancel the existing long running operation before sending such request, otherwise the request will be rejected.
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
SetSuggestionFeatureConfigRequest request =
SetSuggestionFeatureConfigRequest.newBuilder()
.setConversationProfile("conversationProfile1691597734")
.setSuggestionFeatureConfig(
HumanAgentAssistantConfig.SuggestionFeatureConfig.newBuilder().build())
.build();
ConversationProfile response =
conversationProfilesClient.setSuggestionFeatureConfigAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final OperationCallable<SetSuggestionFeatureConfigRequest,ConversationProfile,SetSuggestionFeatureConfigOperationMetadata> setSuggestionFeatureConfigOperationCallable()
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`: [SetSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata] - `response`: [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile]
If a long running operation to add or update suggestion feature config for the same conversation profile, participant role and suggestion feature type exists, please cancel the existing long running operation before sending such request, otherwise the request will be rejected.
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
SetSuggestionFeatureConfigRequest request =
SetSuggestionFeatureConfigRequest.newBuilder()
.setConversationProfile("conversationProfile1691597734")
.setSuggestionFeatureConfig(
HumanAgentAssistantConfig.SuggestionFeatureConfig.newBuilder().build())
.build();
OperationFuture<ConversationProfile, SetSuggestionFeatureConfigOperationMetadata> future =
conversationProfilesClient
.setSuggestionFeatureConfigOperationCallable()
.futureCall(request);
// Do something.
ConversationProfile response = future.get();
}
public final UnaryCallable<SetSuggestionFeatureConfigRequest,Operation> setSuggestionFeatureConfigCallable()
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`: [SetSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.SetSuggestionFeatureConfigOperationMetadata] - `response`: [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile]
If a long running operation to add or update suggestion feature config for the same conversation profile, participant role and suggestion feature type exists, please cancel the existing long running operation before sending such request, otherwise the request will be rejected.
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
SetSuggestionFeatureConfigRequest request =
SetSuggestionFeatureConfigRequest.newBuilder()
.setConversationProfile("conversationProfile1691597734")
.setSuggestionFeatureConfig(
HumanAgentAssistantConfig.SuggestionFeatureConfig.newBuilder().build())
.build();
ApiFuture<Operation> future =
conversationProfilesClient.setSuggestionFeatureConfigCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final OperationFuture<ConversationProfile,ClearSuggestionFeatureConfigOperationMetadata> clearSuggestionFeatureConfigAsync(String conversationProfile)
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`: [ClearSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata] - `response`: [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile]
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
String conversationProfile = "conversationProfile1691597734";
ConversationProfile response =
conversationProfilesClient.clearSuggestionFeatureConfigAsync(conversationProfile).get();
}
conversationProfile
- Required. The Conversation Profile to add or update the suggestion
feature config. Format: `projects/<Project ID>/locations/<Location
ID>/conversationProfiles/<Conversation Profile ID>`.ApiException
- if the remote call failspublic final OperationFuture<ConversationProfile,ClearSuggestionFeatureConfigOperationMetadata> clearSuggestionFeatureConfigAsync(ClearSuggestionFeatureConfigRequest request)
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`: [ClearSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata] - `response`: [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile]
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
ClearSuggestionFeatureConfigRequest request =
ClearSuggestionFeatureConfigRequest.newBuilder()
.setConversationProfile("conversationProfile1691597734")
.build();
ConversationProfile response =
conversationProfilesClient.clearSuggestionFeatureConfigAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final OperationCallable<ClearSuggestionFeatureConfigRequest,ConversationProfile,ClearSuggestionFeatureConfigOperationMetadata> clearSuggestionFeatureConfigOperationCallable()
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`: [ClearSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata] - `response`: [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile]
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
ClearSuggestionFeatureConfigRequest request =
ClearSuggestionFeatureConfigRequest.newBuilder()
.setConversationProfile("conversationProfile1691597734")
.build();
OperationFuture<ConversationProfile, ClearSuggestionFeatureConfigOperationMetadata> future =
conversationProfilesClient
.clearSuggestionFeatureConfigOperationCallable()
.futureCall(request);
// Do something.
ConversationProfile response = future.get();
}
public final UnaryCallable<ClearSuggestionFeatureConfigRequest,Operation> clearSuggestionFeatureConfigCallable()
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`: [ClearSuggestionFeatureConfigOperationMetadata][google.cloud.dialogflow.v2.ClearSuggestionFeatureConfigOperationMetadata] - `response`: [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile]
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
ClearSuggestionFeatureConfigRequest request =
ClearSuggestionFeatureConfigRequest.newBuilder()
.setConversationProfile("conversationProfile1691597734")
.build();
ApiFuture<Operation> future =
conversationProfilesClient.clearSuggestionFeatureConfigCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final ConversationProfilesClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest request)
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : conversationProfilesClient.listLocations(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.location.ListLocationsRequest,ConversationProfilesClient.ListLocationsPagedResponse> listLocationsPagedCallable()
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future =
conversationProfilesClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for (Location element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response =
conversationProfilesClient.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 com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest request)
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = conversationProfilesClient.getLocation(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
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 (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future =
conversationProfilesClient.getLocationCallable().futureCall(request);
// Do something.
Location response = future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface BackgroundResource
public boolean isShutdown()
isShutdown
in interface BackgroundResource
public boolean isTerminated()
isTerminated
in interface BackgroundResource
public void shutdownNow()
shutdownNow
in interface BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface BackgroundResource
InterruptedException
Copyright © 2022 Google LLC. All rights reserved.