- 4.59.0 (latest)
- 4.58.0
- 4.57.0
- 4.55.0
- 4.54.0
- 4.53.0
- 4.52.0
- 4.51.0
- 4.50.0
- 4.49.0
- 4.48.0
- 4.47.0
- 4.46.0
- 4.45.0
- 4.43.0
- 4.42.0
- 4.41.0
- 4.40.0
- 4.39.0
- 4.38.0
- 4.37.0
- 4.36.0
- 4.35.0
- 4.34.0
- 4.33.0
- 4.30.0
- 4.29.0
- 4.28.0
- 4.27.0
- 4.26.0
- 4.25.0
- 4.24.0
- 4.23.0
- 4.22.0
- 4.21.0
- 4.20.0
- 4.19.0
- 4.18.0
- 4.17.0
- 4.15.0
- 4.14.0
- 4.13.0
- 4.12.0
- 4.11.0
- 4.10.0
- 4.9.1
- 4.8.6
- 4.7.5
- 4.6.0
- 4.5.11
- 4.4.0
- 4.3.1
public class ConversationProfilesClient implements BackgroundResource
Service Description: Service for managing ConversationProfiles.
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:
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:
- 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 ConversationProfilesSettings to create(). For example:
To customize credentials:
ConversationProfilesSettings conversationProfilesSettings =
ConversationProfilesSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create(conversationProfilesSettings);
To customize the endpoint:
ConversationProfilesSettings conversationProfilesSettings =
ConversationProfilesSettings.newBuilder().setEndpoint(myEndpoint).build();
ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create(conversationProfilesSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Implements
BackgroundResourceConstructors
ConversationProfilesClient(ConversationProfilesSettings settings)
protected ConversationProfilesClient(ConversationProfilesSettings settings)
Constructs an instance of ConversationProfilesClient, 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.
Name | Description |
settings | ConversationProfilesSettings |
ConversationProfilesClient(ConversationProfilesStub stub)
protected ConversationProfilesClient(ConversationProfilesStub stub)
Name | Description |
stub | ConversationProfilesStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Name | Description |
duration | long |
unit | TimeUnit |
Type | Description |
boolean |
Type | Description |
InterruptedException |
close()
public final void close()
create()
public static final ConversationProfilesClient create()
Constructs an instance of ConversationProfilesClient with default settings.
Type | Description |
ConversationProfilesClient |
Type | Description |
IOException |
create(ConversationProfilesSettings settings)
public static final ConversationProfilesClient create(ConversationProfilesSettings settings)
Constructs an instance of ConversationProfilesClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
Name | Description |
settings | ConversationProfilesSettings |
Type | Description |
ConversationProfilesClient |
Type | Description |
IOException |
create(ConversationProfilesStub stub)
public static final ConversationProfilesClient create(ConversationProfilesStub stub)
Constructs an instance of ConversationProfilesClient, using the given stub for making calls. This is for advanced usage - prefer using create(ConversationProfilesSettings).
Name | Description |
stub | ConversationProfilesStub |
Type | Description |
ConversationProfilesClient |
createConversationProfile(CreateConversationProfileRequest request)
public final ConversationProfile createConversationProfile(CreateConversationProfileRequest request)
Creates a conversation profile in the specified project.
[ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] aren't populated in the response. You can retrieve them via GetConversationProfile API.
Sample code:
try (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
CreateConversationProfileRequest request =
CreateConversationProfileRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setConversationProfile(ConversationProfile.newBuilder().build())
.build();
ConversationProfile response = conversationProfilesClient.createConversationProfile(request);
}
Name | Description |
request | CreateConversationProfileRequest The request object containing all of the parameters for the API call. |
Type | Description |
ConversationProfile |
createConversationProfile(LocationName parent, ConversationProfile conversationProfile)
public final ConversationProfile createConversationProfile(LocationName parent, ConversationProfile conversationProfile)
Creates a conversation profile in the specified project.
[ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] aren't populated in the response. You can retrieve them via GetConversationProfile API.
Sample code:
try (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
ConversationProfile conversationProfile = ConversationProfile.newBuilder().build();
ConversationProfile response =
conversationProfilesClient.createConversationProfile(parent, conversationProfile);
}
Name | Description |
parent | LocationName Required. The project to create a conversation profile for. Format:
|
conversationProfile | ConversationProfile Required. The conversation profile to create. |
Type | Description |
ConversationProfile |
createConversationProfile(ProjectName parent, ConversationProfile conversationProfile)
public final ConversationProfile createConversationProfile(ProjectName parent, ConversationProfile conversationProfile)
Creates a conversation profile in the specified project.
[ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] aren't populated in the response. You can retrieve them via GetConversationProfile API.
Sample code:
try (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
ConversationProfile conversationProfile = ConversationProfile.newBuilder().build();
ConversationProfile response =
conversationProfilesClient.createConversationProfile(parent, conversationProfile);
}
Name | Description |
parent | ProjectName Required. The project to create a conversation profile for. Format:
|
conversationProfile | ConversationProfile Required. The conversation profile to create. |
Type | Description |
ConversationProfile |
createConversationProfile(String parent, ConversationProfile conversationProfile)
public final ConversationProfile createConversationProfile(String parent, ConversationProfile conversationProfile)
Creates a conversation profile in the specified project.
[ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] aren't populated in the response. You can retrieve them via GetConversationProfile API.
Sample code:
try (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
ConversationProfile conversationProfile = ConversationProfile.newBuilder().build();
ConversationProfile response =
conversationProfilesClient.createConversationProfile(parent, conversationProfile);
}
Name | Description |
parent | String Required. The project to create a conversation profile for. Format:
|
conversationProfile | ConversationProfile Required. The conversation profile to create. |
Type | Description |
ConversationProfile |
createConversationProfileCallable()
public final UnaryCallable<CreateConversationProfileRequest,ConversationProfile> createConversationProfileCallable()
Creates a conversation profile in the specified project.
[ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] aren't populated in the response. You can retrieve them via GetConversationProfile API.
Sample code:
try (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
CreateConversationProfileRequest request =
CreateConversationProfileRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setConversationProfile(ConversationProfile.newBuilder().build())
.build();
ApiFuture
Type | Description |
UnaryCallable<CreateConversationProfileRequest,ConversationProfile> |
deleteConversationProfile(ConversationProfileName name)
public final void deleteConversationProfile(ConversationProfileName name)
Deletes the specified conversation profile.
Sample code:
try (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
ConversationProfileName name =
ConversationProfileName.ofProjectConversationProfileName(
"[PROJECT]", "[CONVERSATION_PROFILE]");
conversationProfilesClient.deleteConversationProfile(name);
}
Name | Description |
name | ConversationProfileName Required. The name of the conversation profile to delete. Format:
|
deleteConversationProfile(DeleteConversationProfileRequest request)
public final void deleteConversationProfile(DeleteConversationProfileRequest request)
Deletes the specified conversation profile.
Sample code:
try (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
DeleteConversationProfileRequest request =
DeleteConversationProfileRequest.newBuilder()
.setName(
ConversationProfileName.ofProjectConversationProfileName(
"[PROJECT]", "[CONVERSATION_PROFILE]")
.toString())
.build();
conversationProfilesClient.deleteConversationProfile(request);
}
Name | Description |
request | DeleteConversationProfileRequest The request object containing all of the parameters for the API call. |
deleteConversationProfile(String name)
public final void deleteConversationProfile(String name)
Deletes the specified conversation profile.
Sample code:
try (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
String name =
ConversationProfileName.ofProjectConversationProfileName(
"[PROJECT]", "[CONVERSATION_PROFILE]")
.toString();
conversationProfilesClient.deleteConversationProfile(name);
}
Name | Description |
name | String Required. The name of the conversation profile to delete. Format:
|
deleteConversationProfileCallable()
public final UnaryCallable<DeleteConversationProfileRequest,Empty> deleteConversationProfileCallable()
Deletes the specified conversation profile.
Sample code:
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();
}
Type | Description |
UnaryCallable<DeleteConversationProfileRequest,Empty> |
getConversationProfile(ConversationProfileName name)
public final ConversationProfile getConversationProfile(ConversationProfileName name)
Retrieves the specified conversation profile.
Sample code:
try (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
ConversationProfileName name =
ConversationProfileName.ofProjectConversationProfileName(
"[PROJECT]", "[CONVERSATION_PROFILE]");
ConversationProfile response = conversationProfilesClient.getConversationProfile(name);
}
Name | Description |
name | ConversationProfileName Required. The resource name of the conversation profile. Format:
|
Type | Description |
ConversationProfile |
getConversationProfile(GetConversationProfileRequest request)
public final ConversationProfile getConversationProfile(GetConversationProfileRequest request)
Retrieves the specified conversation profile.
Sample code:
try (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
GetConversationProfileRequest request =
GetConversationProfileRequest.newBuilder()
.setName(
ConversationProfileName.ofProjectConversationProfileName(
"[PROJECT]", "[CONVERSATION_PROFILE]")
.toString())
.build();
ConversationProfile response = conversationProfilesClient.getConversationProfile(request);
}
Name | Description |
request | GetConversationProfileRequest The request object containing all of the parameters for the API call. |
Type | Description |
ConversationProfile |
getConversationProfile(String name)
public final ConversationProfile getConversationProfile(String name)
Retrieves the specified conversation profile.
Sample code:
try (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
String name =
ConversationProfileName.ofProjectConversationProfileName(
"[PROJECT]", "[CONVERSATION_PROFILE]")
.toString();
ConversationProfile response = conversationProfilesClient.getConversationProfile(name);
}
Name | Description |
name | String Required. The resource name of the conversation profile. Format:
|
Type | Description |
ConversationProfile |
getConversationProfileCallable()
public final UnaryCallable<GetConversationProfileRequest,ConversationProfile> getConversationProfileCallable()
Retrieves the specified conversation profile.
Sample code:
try (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
GetConversationProfileRequest request =
GetConversationProfileRequest.newBuilder()
.setName(
ConversationProfileName.ofProjectConversationProfileName(
"[PROJECT]", "[CONVERSATION_PROFILE]")
.toString())
.build();
ApiFuture
Type | Description |
UnaryCallable<GetConversationProfileRequest,ConversationProfile> |
getSettings()
public final ConversationProfilesSettings getSettings()
Type | Description |
ConversationProfilesSettings |
getStub()
public ConversationProfilesStub getStub()
Type | Description |
ConversationProfilesStub |
isShutdown()
public boolean isShutdown()
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Type | Description |
boolean |
listConversationProfiles(ListConversationProfilesRequest request)
public final ConversationProfilesClient.ListConversationProfilesPagedResponse listConversationProfiles(ListConversationProfilesRequest request)
Returns the list of all conversation profiles in the specified project.
Sample code:
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);
}
}
Name | Description |
request | ListConversationProfilesRequest The request object containing all of the parameters for the API call. |
Type | Description |
ConversationProfilesClient.ListConversationProfilesPagedResponse |
listConversationProfiles(LocationName parent)
public final ConversationProfilesClient.ListConversationProfilesPagedResponse listConversationProfiles(LocationName parent)
Returns the list of all conversation profiles in the specified project.
Sample code:
try (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (ConversationProfile element :
conversationProfilesClient.listConversationProfiles(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | LocationName Required. The project to list all conversation profiles from. Format:
|
Type | Description |
ConversationProfilesClient.ListConversationProfilesPagedResponse |
listConversationProfiles(ProjectName parent)
public final ConversationProfilesClient.ListConversationProfilesPagedResponse listConversationProfiles(ProjectName parent)
Returns the list of all conversation profiles in the specified project.
Sample code:
try (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
ProjectName parent = ProjectName.of("[PROJECT]");
for (ConversationProfile element :
conversationProfilesClient.listConversationProfiles(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | ProjectName Required. The project to list all conversation profiles from. Format:
|
Type | Description |
ConversationProfilesClient.ListConversationProfilesPagedResponse |
listConversationProfiles(String parent)
public final ConversationProfilesClient.ListConversationProfilesPagedResponse listConversationProfiles(String parent)
Returns the list of all conversation profiles in the specified project.
Sample code:
try (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
String parent = ProjectName.of("[PROJECT]").toString();
for (ConversationProfile element :
conversationProfilesClient.listConversationProfiles(parent).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
parent | String Required. The project to list all conversation profiles from. Format:
|
Type | Description |
ConversationProfilesClient.ListConversationProfilesPagedResponse |
listConversationProfilesCallable()
public final UnaryCallable<ListConversationProfilesRequest,ListConversationProfilesResponse> listConversationProfilesCallable()
Returns the list of all conversation profiles in the specified project.
Sample code:
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.getResponsesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListConversationProfilesRequest,ListConversationProfilesResponse> |
listConversationProfilesPagedCallable()
public final UnaryCallable<ListConversationProfilesRequest,ConversationProfilesClient.ListConversationProfilesPagedResponse> listConversationProfilesPagedCallable()
Returns the list of all conversation profiles in the specified project.
Sample code:
try (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
ListConversationProfilesRequest request =
ListConversationProfilesRequest.newBuilder()
.setParent(ProjectName.of("[PROJECT]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture
Type | Description |
UnaryCallable<ListConversationProfilesRequest,ListConversationProfilesPagedResponse> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()
updateConversationProfile(ConversationProfile conversationProfile, FieldMask updateMask)
public final ConversationProfile updateConversationProfile(ConversationProfile conversationProfile, FieldMask updateMask)
Updates the specified conversation profile.
[ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] aren't populated in the response. You can retrieve them via GetConversationProfile API.
Sample code:
try (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
ConversationProfile conversationProfile = ConversationProfile.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
ConversationProfile response =
conversationProfilesClient.updateConversationProfile(conversationProfile, updateMask);
}
Name | Description |
conversationProfile | ConversationProfile Required. The conversation profile to update. |
updateMask | FieldMask Required. The mask to control which fields to update. |
Type | Description |
ConversationProfile |
updateConversationProfile(UpdateConversationProfileRequest request)
public final ConversationProfile updateConversationProfile(UpdateConversationProfileRequest request)
Updates the specified conversation profile.
[ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] aren't populated in the response. You can retrieve them via GetConversationProfile API.
Sample code:
try (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
UpdateConversationProfileRequest request =
UpdateConversationProfileRequest.newBuilder()
.setConversationProfile(ConversationProfile.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ConversationProfile response = conversationProfilesClient.updateConversationProfile(request);
}
Name | Description |
request | UpdateConversationProfileRequest The request object containing all of the parameters for the API call. |
Type | Description |
ConversationProfile |
updateConversationProfileCallable()
public final UnaryCallable<UpdateConversationProfileRequest,ConversationProfile> updateConversationProfileCallable()
Updates the specified conversation profile.
[ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] aren't populated in the response. You can retrieve them via GetConversationProfile API.
Sample code:
try (ConversationProfilesClient conversationProfilesClient =
ConversationProfilesClient.create()) {
UpdateConversationProfileRequest request =
UpdateConversationProfileRequest.newBuilder()
.setConversationProfile(ConversationProfile.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture
Type | Description |
UnaryCallable<UpdateConversationProfileRequest,ConversationProfile> |