@Generated(value="by gapic-generator-java") public class ParticipantsClient 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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
ConversationName parent =
ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]");
Participant participant = Participant.newBuilder().build();
Participant response = participantsClient.createParticipant(parent, participant);
}
Note: close() needs to be called on the ParticipantsClient 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 ParticipantsSettings 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
ParticipantsSettings participantsSettings =
ParticipantsSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
ParticipantsClient participantsClient = ParticipantsClient.create(participantsSettings);
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
ParticipantsSettings participantsSettings =
ParticipantsSettings.newBuilder().setEndpoint(myEndpoint).build();
ParticipantsClient participantsClient = ParticipantsClient.create(participantsSettings);
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
ParticipantsSettings participantsSettings =
ParticipantsSettings.newBuilder()
.setTransportChannelProvider(
ParticipantsSettings.defaultHttpJsonTransportProviderBuilder().build())
.build();
ParticipantsClient participantsClient = ParticipantsClient.create(participantsSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Modifier and Type | Class and Description |
---|---|
static class |
ParticipantsClient.ListLocationsFixedSizeCollection |
static class |
ParticipantsClient.ListLocationsPage |
static class |
ParticipantsClient.ListLocationsPagedResponse |
static class |
ParticipantsClient.ListParticipantsFixedSizeCollection |
static class |
ParticipantsClient.ListParticipantsPage |
static class |
ParticipantsClient.ListParticipantsPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
ParticipantsClient(ParticipantsSettings settings)
Constructs an instance of ParticipantsClient, using the given settings.
|
protected |
ParticipantsClient(ParticipantsStub stub) |
Modifier and Type | Method and Description |
---|---|
AnalyzeContentResponse |
analyzeContent(AnalyzeContentRequest request)
Adds a text (chat, for example), or audio (phone recording, for example) message from a
participant into the conversation.
|
AnalyzeContentResponse |
analyzeContent(ParticipantName participant,
EventInput eventInput)
Adds a text (chat, for example), or audio (phone recording, for example) message from a
participant into the conversation.
|
AnalyzeContentResponse |
analyzeContent(ParticipantName participant,
TextInput textInput)
Adds a text (chat, for example), or audio (phone recording, for example) message from a
participant into the conversation.
|
AnalyzeContentResponse |
analyzeContent(String participant,
EventInput eventInput)
Adds a text (chat, for example), or audio (phone recording, for example) message from a
participant into the conversation.
|
AnalyzeContentResponse |
analyzeContent(String participant,
TextInput textInput)
Adds a text (chat, for example), or audio (phone recording, for example) message from a
participant into the conversation.
|
UnaryCallable<AnalyzeContentRequest,AnalyzeContentResponse> |
analyzeContentCallable()
Adds a text (chat, for example), or audio (phone recording, for example) message from a
participant into the conversation.
|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static ParticipantsClient |
create()
Constructs an instance of ParticipantsClient with default settings.
|
static ParticipantsClient |
create(ParticipantsSettings settings)
Constructs an instance of ParticipantsClient, using the given settings.
|
static ParticipantsClient |
create(ParticipantsStub stub)
Constructs an instance of ParticipantsClient, using the given stub for making calls.
|
Participant |
createParticipant(ConversationName parent,
Participant participant)
Creates a new participant in a conversation.
|
Participant |
createParticipant(CreateParticipantRequest request)
Creates a new participant in a conversation.
|
Participant |
createParticipant(String parent,
Participant participant)
Creates a new participant in a conversation.
|
UnaryCallable<CreateParticipantRequest,Participant> |
createParticipantCallable()
Creates a new participant in a conversation.
|
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.
|
Participant |
getParticipant(GetParticipantRequest request)
Retrieves a conversation participant.
|
Participant |
getParticipant(ParticipantName name)
Retrieves a conversation participant.
|
Participant |
getParticipant(String name)
Retrieves a conversation participant.
|
UnaryCallable<GetParticipantRequest,Participant> |
getParticipantCallable()
Retrieves a conversation participant.
|
ParticipantsSettings |
getSettings() |
ParticipantsStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
ParticipantsClient.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,ParticipantsClient.ListLocationsPagedResponse> |
listLocationsPagedCallable()
Lists information about the supported locations for this service.
|
ParticipantsClient.ListParticipantsPagedResponse |
listParticipants(ConversationName parent)
Returns the list of all participants in the specified conversation.
|
ParticipantsClient.ListParticipantsPagedResponse |
listParticipants(ListParticipantsRequest request)
Returns the list of all participants in the specified conversation.
|
ParticipantsClient.ListParticipantsPagedResponse |
listParticipants(String parent)
Returns the list of all participants in the specified conversation.
|
UnaryCallable<ListParticipantsRequest,ListParticipantsResponse> |
listParticipantsCallable()
Returns the list of all participants in the specified conversation.
|
UnaryCallable<ListParticipantsRequest,ParticipantsClient.ListParticipantsPagedResponse> |
listParticipantsPagedCallable()
Returns the list of all participants in the specified conversation.
|
void |
shutdown() |
void |
shutdownNow() |
SuggestArticlesResponse |
suggestArticles(ParticipantName parent)
Gets suggested articles for a participant based on specific historical messages.
|
SuggestArticlesResponse |
suggestArticles(String parent)
Gets suggested articles for a participant based on specific historical messages.
|
SuggestArticlesResponse |
suggestArticles(SuggestArticlesRequest request)
Gets suggested articles for a participant based on specific historical messages.
|
UnaryCallable<SuggestArticlesRequest,SuggestArticlesResponse> |
suggestArticlesCallable()
Gets suggested articles for a participant based on specific historical messages.
|
SuggestFaqAnswersResponse |
suggestFaqAnswers(ParticipantName parent)
Gets suggested faq answers for a participant based on specific historical messages.
|
SuggestFaqAnswersResponse |
suggestFaqAnswers(String parent)
Gets suggested faq answers for a participant based on specific historical messages.
|
SuggestFaqAnswersResponse |
suggestFaqAnswers(SuggestFaqAnswersRequest request)
Gets suggested faq answers for a participant based on specific historical messages.
|
UnaryCallable<SuggestFaqAnswersRequest,SuggestFaqAnswersResponse> |
suggestFaqAnswersCallable()
Gets suggested faq answers for a participant based on specific historical messages.
|
SuggestSmartRepliesResponse |
suggestSmartReplies(ParticipantName parent)
Gets smart replies for a participant based on specific historical messages.
|
SuggestSmartRepliesResponse |
suggestSmartReplies(String parent)
Gets smart replies for a participant based on specific historical messages.
|
SuggestSmartRepliesResponse |
suggestSmartReplies(SuggestSmartRepliesRequest request)
Gets smart replies for a participant based on specific historical messages.
|
UnaryCallable<SuggestSmartRepliesRequest,SuggestSmartRepliesResponse> |
suggestSmartRepliesCallable()
Gets smart replies for a participant based on specific historical messages.
|
Participant |
updateParticipant(Participant participant,
FieldMask updateMask)
Updates the specified participant.
|
Participant |
updateParticipant(UpdateParticipantRequest request)
Updates the specified participant.
|
UnaryCallable<UpdateParticipantRequest,Participant> |
updateParticipantCallable()
Updates the specified participant.
|
protected ParticipantsClient(ParticipantsSettings settings) throws IOException
IOException
protected ParticipantsClient(ParticipantsStub stub)
public static final ParticipantsClient create() throws IOException
IOException
public static final ParticipantsClient create(ParticipantsSettings settings) throws IOException
IOException
public static final ParticipantsClient create(ParticipantsStub stub)
public final ParticipantsSettings getSettings()
public ParticipantsStub getStub()
public final Participant createParticipant(ConversationName parent, Participant participant)
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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
ConversationName parent =
ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]");
Participant participant = Participant.newBuilder().build();
Participant response = participantsClient.createParticipant(parent, participant);
}
parent
- Required. Resource identifier of the conversation adding the participant. Format:
`projects/<Project ID>/locations/<Location ID>/conversations/<Conversation
ID>`.participant
- Required. The participant to create.ApiException
- if the remote call failspublic final Participant createParticipant(String parent, Participant participant)
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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
String parent =
ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]").toString();
Participant participant = Participant.newBuilder().build();
Participant response = participantsClient.createParticipant(parent, participant);
}
parent
- Required. Resource identifier of the conversation adding the participant. Format:
`projects/<Project ID>/locations/<Location ID>/conversations/<Conversation
ID>`.participant
- Required. The participant to create.ApiException
- if the remote call failspublic final Participant createParticipant(CreateParticipantRequest 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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
CreateParticipantRequest request =
CreateParticipantRequest.newBuilder()
.setParent(
ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]")
.toString())
.setParticipant(Participant.newBuilder().build())
.build();
Participant response = participantsClient.createParticipant(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<CreateParticipantRequest,Participant> createParticipantCallable()
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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
CreateParticipantRequest request =
CreateParticipantRequest.newBuilder()
.setParent(
ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]")
.toString())
.setParticipant(Participant.newBuilder().build())
.build();
ApiFuture<Participant> future =
participantsClient.createParticipantCallable().futureCall(request);
// Do something.
Participant response = future.get();
}
public final Participant getParticipant(ParticipantName 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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
ParticipantName name =
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]");
Participant response = participantsClient.getParticipant(name);
}
name
- Required. The name of the participant. Format: `projects/<Project
ID>/locations/<Location ID>/conversations/<Conversation
ID>/participants/<Participant ID>`.ApiException
- if the remote call failspublic final Participant getParticipant(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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
String name =
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
.toString();
Participant response = participantsClient.getParticipant(name);
}
name
- Required. The name of the participant. Format: `projects/<Project
ID>/locations/<Location ID>/conversations/<Conversation
ID>/participants/<Participant ID>`.ApiException
- if the remote call failspublic final Participant getParticipant(GetParticipantRequest 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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
GetParticipantRequest request =
GetParticipantRequest.newBuilder()
.setName(
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
.toString())
.build();
Participant response = participantsClient.getParticipant(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<GetParticipantRequest,Participant> getParticipantCallable()
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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
GetParticipantRequest request =
GetParticipantRequest.newBuilder()
.setName(
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
.toString())
.build();
ApiFuture<Participant> future =
participantsClient.getParticipantCallable().futureCall(request);
// Do something.
Participant response = future.get();
}
public final ParticipantsClient.ListParticipantsPagedResponse listParticipants(ConversationName 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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
ConversationName parent =
ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]");
for (Participant element : participantsClient.listParticipants(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The conversation to list all participants from. Format:
`projects/<Project ID>/locations/<Location ID>/conversations/<Conversation
ID>`.ApiException
- if the remote call failspublic final ParticipantsClient.ListParticipantsPagedResponse listParticipants(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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
String parent =
ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]").toString();
for (Participant element : participantsClient.listParticipants(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The conversation to list all participants from. Format:
`projects/<Project ID>/locations/<Location ID>/conversations/<Conversation
ID>`.ApiException
- if the remote call failspublic final ParticipantsClient.ListParticipantsPagedResponse listParticipants(ListParticipantsRequest 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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
ListParticipantsRequest request =
ListParticipantsRequest.newBuilder()
.setParent(
ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Participant element : participantsClient.listParticipants(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<ListParticipantsRequest,ParticipantsClient.ListParticipantsPagedResponse> listParticipantsPagedCallable()
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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
ListParticipantsRequest request =
ListParticipantsRequest.newBuilder()
.setParent(
ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Participant> future =
participantsClient.listParticipantsPagedCallable().futureCall(request);
// Do something.
for (Participant element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<ListParticipantsRequest,ListParticipantsResponse> listParticipantsCallable()
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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
ListParticipantsRequest request =
ListParticipantsRequest.newBuilder()
.setParent(
ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]")
.toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListParticipantsResponse response =
participantsClient.listParticipantsCallable().call(request);
for (Participant element : response.getParticipantsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final Participant updateParticipant(Participant participant, FieldMask updateMask)
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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
Participant participant = Participant.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
Participant response = participantsClient.updateParticipant(participant, updateMask);
}
participant
- Required. The participant to update.updateMask
- Required. The mask to specify which fields to update.ApiException
- if the remote call failspublic final Participant updateParticipant(UpdateParticipantRequest 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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
UpdateParticipantRequest request =
UpdateParticipantRequest.newBuilder()
.setParticipant(Participant.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Participant response = participantsClient.updateParticipant(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<UpdateParticipantRequest,Participant> updateParticipantCallable()
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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
UpdateParticipantRequest request =
UpdateParticipantRequest.newBuilder()
.setParticipant(Participant.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Participant> future =
participantsClient.updateParticipantCallable().futureCall(request);
// Do something.
Participant response = future.get();
}
public final AnalyzeContentResponse analyzeContent(ParticipantName participant, EventInput eventInput)
Note: Always use agent versions for production traffic sent to virtual agents. See [Versions and environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
ParticipantName participant =
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]");
EventInput eventInput = EventInput.newBuilder().build();
AnalyzeContentResponse response = participantsClient.analyzeContent(participant, eventInput);
}
participant
- Required. The name of the participant this text comes from. Format:
`projects/<Project ID>/locations/<Location ID>/conversations/<Conversation
ID>/participants/<Participant ID>`.eventInput
- An input event to send to Dialogflow.ApiException
- if the remote call failspublic final AnalyzeContentResponse analyzeContent(ParticipantName participant, TextInput textInput)
Note: Always use agent versions for production traffic sent to virtual agents. See [Versions and environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
ParticipantName participant =
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]");
TextInput textInput = TextInput.newBuilder().build();
AnalyzeContentResponse response = participantsClient.analyzeContent(participant, textInput);
}
participant
- Required. The name of the participant this text comes from. Format:
`projects/<Project ID>/locations/<Location ID>/conversations/<Conversation
ID>/participants/<Participant ID>`.textInput
- The natural language text to be processed.ApiException
- if the remote call failspublic final AnalyzeContentResponse analyzeContent(String participant, EventInput eventInput)
Note: Always use agent versions for production traffic sent to virtual agents. See [Versions and environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
String participant =
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
.toString();
EventInput eventInput = EventInput.newBuilder().build();
AnalyzeContentResponse response = participantsClient.analyzeContent(participant, eventInput);
}
participant
- Required. The name of the participant this text comes from. Format:
`projects/<Project ID>/locations/<Location ID>/conversations/<Conversation
ID>/participants/<Participant ID>`.eventInput
- An input event to send to Dialogflow.ApiException
- if the remote call failspublic final AnalyzeContentResponse analyzeContent(String participant, TextInput textInput)
Note: Always use agent versions for production traffic sent to virtual agents. See [Versions and environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
String participant =
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
.toString();
TextInput textInput = TextInput.newBuilder().build();
AnalyzeContentResponse response = participantsClient.analyzeContent(participant, textInput);
}
participant
- Required. The name of the participant this text comes from. Format:
`projects/<Project ID>/locations/<Location ID>/conversations/<Conversation
ID>/participants/<Participant ID>`.textInput
- The natural language text to be processed.ApiException
- if the remote call failspublic final AnalyzeContentResponse analyzeContent(AnalyzeContentRequest request)
Note: Always use agent versions for production traffic sent to virtual agents. See [Versions and environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
AnalyzeContentRequest request =
AnalyzeContentRequest.newBuilder()
.setParticipant(
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
.toString())
.setReplyAudioConfig(OutputAudioConfig.newBuilder().build())
.setQueryParams(QueryParameters.newBuilder().build())
.setAssistQueryParams(AssistQueryParameters.newBuilder().build())
.setCxParameters(Struct.newBuilder().build())
.setRequestId("requestId693933066")
.build();
AnalyzeContentResponse response = participantsClient.analyzeContent(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<AnalyzeContentRequest,AnalyzeContentResponse> analyzeContentCallable()
Note: Always use agent versions for production traffic sent to virtual agents. See [Versions and environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
AnalyzeContentRequest request =
AnalyzeContentRequest.newBuilder()
.setParticipant(
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
.toString())
.setReplyAudioConfig(OutputAudioConfig.newBuilder().build())
.setQueryParams(QueryParameters.newBuilder().build())
.setAssistQueryParams(AssistQueryParameters.newBuilder().build())
.setCxParameters(Struct.newBuilder().build())
.setRequestId("requestId693933066")
.build();
ApiFuture<AnalyzeContentResponse> future =
participantsClient.analyzeContentCallable().futureCall(request);
// Do something.
AnalyzeContentResponse response = future.get();
}
public final SuggestArticlesResponse suggestArticles(ParticipantName 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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
ParticipantName parent =
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]");
SuggestArticlesResponse response = participantsClient.suggestArticles(parent);
}
parent
- Required. The name of the participant to fetch suggestion for. Format:
`projects/<Project ID>/locations/<Location ID>/conversations/<Conversation
ID>/participants/<Participant ID>`.ApiException
- if the remote call failspublic final SuggestArticlesResponse suggestArticles(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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
String parent =
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
.toString();
SuggestArticlesResponse response = participantsClient.suggestArticles(parent);
}
parent
- Required. The name of the participant to fetch suggestion for. Format:
`projects/<Project ID>/locations/<Location ID>/conversations/<Conversation
ID>/participants/<Participant ID>`.ApiException
- if the remote call failspublic final SuggestArticlesResponse suggestArticles(SuggestArticlesRequest 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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
SuggestArticlesRequest request =
SuggestArticlesRequest.newBuilder()
.setParent(
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
.toString())
.setLatestMessage(
MessageName.ofProjectConversationMessageName(
"[PROJECT]", "[CONVERSATION]", "[MESSAGE]")
.toString())
.setContextSize(1116903569)
.setAssistQueryParams(AssistQueryParameters.newBuilder().build())
.build();
SuggestArticlesResponse response = participantsClient.suggestArticles(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<SuggestArticlesRequest,SuggestArticlesResponse> suggestArticlesCallable()
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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
SuggestArticlesRequest request =
SuggestArticlesRequest.newBuilder()
.setParent(
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
.toString())
.setLatestMessage(
MessageName.ofProjectConversationMessageName(
"[PROJECT]", "[CONVERSATION]", "[MESSAGE]")
.toString())
.setContextSize(1116903569)
.setAssistQueryParams(AssistQueryParameters.newBuilder().build())
.build();
ApiFuture<SuggestArticlesResponse> future =
participantsClient.suggestArticlesCallable().futureCall(request);
// Do something.
SuggestArticlesResponse response = future.get();
}
public final SuggestFaqAnswersResponse suggestFaqAnswers(ParticipantName 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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
ParticipantName parent =
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]");
SuggestFaqAnswersResponse response = participantsClient.suggestFaqAnswers(parent);
}
parent
- Required. The name of the participant to fetch suggestion for. Format:
`projects/<Project ID>/locations/<Location ID>/conversations/<Conversation
ID>/participants/<Participant ID>`.ApiException
- if the remote call failspublic final SuggestFaqAnswersResponse suggestFaqAnswers(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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
String parent =
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
.toString();
SuggestFaqAnswersResponse response = participantsClient.suggestFaqAnswers(parent);
}
parent
- Required. The name of the participant to fetch suggestion for. Format:
`projects/<Project ID>/locations/<Location ID>/conversations/<Conversation
ID>/participants/<Participant ID>`.ApiException
- if the remote call failspublic final SuggestFaqAnswersResponse suggestFaqAnswers(SuggestFaqAnswersRequest 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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
SuggestFaqAnswersRequest request =
SuggestFaqAnswersRequest.newBuilder()
.setParent(
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
.toString())
.setLatestMessage(
MessageName.ofProjectConversationMessageName(
"[PROJECT]", "[CONVERSATION]", "[MESSAGE]")
.toString())
.setContextSize(1116903569)
.setAssistQueryParams(AssistQueryParameters.newBuilder().build())
.build();
SuggestFaqAnswersResponse response = participantsClient.suggestFaqAnswers(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<SuggestFaqAnswersRequest,SuggestFaqAnswersResponse> suggestFaqAnswersCallable()
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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
SuggestFaqAnswersRequest request =
SuggestFaqAnswersRequest.newBuilder()
.setParent(
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
.toString())
.setLatestMessage(
MessageName.ofProjectConversationMessageName(
"[PROJECT]", "[CONVERSATION]", "[MESSAGE]")
.toString())
.setContextSize(1116903569)
.setAssistQueryParams(AssistQueryParameters.newBuilder().build())
.build();
ApiFuture<SuggestFaqAnswersResponse> future =
participantsClient.suggestFaqAnswersCallable().futureCall(request);
// Do something.
SuggestFaqAnswersResponse response = future.get();
}
public final SuggestSmartRepliesResponse suggestSmartReplies(ParticipantName 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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
ParticipantName parent =
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]");
SuggestSmartRepliesResponse response = participantsClient.suggestSmartReplies(parent);
}
parent
- Required. The name of the participant to fetch suggestion for. Format:
`projects/<Project ID>/locations/<Location ID>/conversations/<Conversation
ID>/participants/<Participant ID>`.ApiException
- if the remote call failspublic final SuggestSmartRepliesResponse suggestSmartReplies(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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
String parent =
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
.toString();
SuggestSmartRepliesResponse response = participantsClient.suggestSmartReplies(parent);
}
parent
- Required. The name of the participant to fetch suggestion for. Format:
`projects/<Project ID>/locations/<Location ID>/conversations/<Conversation
ID>/participants/<Participant ID>`.ApiException
- if the remote call failspublic final SuggestSmartRepliesResponse suggestSmartReplies(SuggestSmartRepliesRequest 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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
SuggestSmartRepliesRequest request =
SuggestSmartRepliesRequest.newBuilder()
.setParent(
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
.toString())
.setCurrentTextInput(TextInput.newBuilder().build())
.setLatestMessage(
MessageName.ofProjectConversationMessageName(
"[PROJECT]", "[CONVERSATION]", "[MESSAGE]")
.toString())
.setContextSize(1116903569)
.build();
SuggestSmartRepliesResponse response = participantsClient.suggestSmartReplies(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<SuggestSmartRepliesRequest,SuggestSmartRepliesResponse> suggestSmartRepliesCallable()
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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
SuggestSmartRepliesRequest request =
SuggestSmartRepliesRequest.newBuilder()
.setParent(
ParticipantName.ofProjectConversationParticipantName(
"[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
.toString())
.setCurrentTextInput(TextInput.newBuilder().build())
.setLatestMessage(
MessageName.ofProjectConversationMessageName(
"[PROJECT]", "[CONVERSATION]", "[MESSAGE]")
.toString())
.setContextSize(1116903569)
.build();
ApiFuture<SuggestSmartRepliesResponse> future =
participantsClient.suggestSmartRepliesCallable().futureCall(request);
// Do something.
SuggestSmartRepliesResponse response = future.get();
}
public final ParticipantsClient.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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : participantsClient.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,ParticipantsClient.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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future =
participantsClient.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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response = participantsClient.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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = participantsClient.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 (ParticipantsClient participantsClient = ParticipantsClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future = participantsClient.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.