All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.google.cloud.dialogflow.v2beta1.ParticipantsClient Maven / Gradle / Ivy

There is a newer version: 4.55.0
Show newest version
/*
 * Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.cloud.dialogflow.v2beta1;

import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.paging.AbstractFixedSizeCollection;
import com.google.api.gax.paging.AbstractPage;
import com.google.api.gax.paging.AbstractPagedListResponse;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.dialogflow.v2beta1.stub.ParticipantsStub;
import com.google.cloud.dialogflow.v2beta1.stub.ParticipantsStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.protobuf.FieldMask;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;

// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
 * Service Description: Service for managing
 * [Participants][google.cloud.dialogflow.v2beta1.Participant].
 *
 * 

This class provides the ability to make remote calls to the backing service through method * calls that map to API methods. Sample code to get started: * *

{@code
 * 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: * *

    *
  1. 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. *
  2. 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. *
  3. 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 ParticipantsSettings to * create(). For example: * *

To customize credentials: * *

{@code
 * ParticipantsSettings participantsSettings =
 *     ParticipantsSettings.newBuilder()
 *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
 *         .build();
 * ParticipantsClient participantsClient = ParticipantsClient.create(participantsSettings);
 * }
* *

To customize the endpoint: * *

{@code
 * ParticipantsSettings participantsSettings =
 *     ParticipantsSettings.newBuilder().setEndpoint(myEndpoint).build();
 * ParticipantsClient participantsClient = ParticipantsClient.create(participantsSettings);
 * }
* *

Please refer to the GitHub repository's samples for more quickstart code snippets. */ @BetaApi @Generated("by gapic-generator-java") public class ParticipantsClient implements BackgroundResource { private final ParticipantsSettings settings; private final ParticipantsStub stub; /** Constructs an instance of ParticipantsClient with default settings. */ public static final ParticipantsClient create() throws IOException { return create(ParticipantsSettings.newBuilder().build()); } /** * Constructs an instance of ParticipantsClient, using the given settings. The channels are * created based on the settings passed in, or defaults for any settings that are not set. */ public static final ParticipantsClient create(ParticipantsSettings settings) throws IOException { return new ParticipantsClient(settings); } /** * Constructs an instance of ParticipantsClient, using the given stub for making calls. This is * for advanced usage - prefer using create(ParticipantsSettings). */ @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public static final ParticipantsClient create(ParticipantsStub stub) { return new ParticipantsClient(stub); } /** * Constructs an instance of ParticipantsClient, using the given settings. This is protected so * that it is easy to make a subclass, but otherwise, the static factory methods should be * preferred. */ protected ParticipantsClient(ParticipantsSettings settings) throws IOException { this.settings = settings; this.stub = ((ParticipantsStubSettings) settings.getStubSettings()).createStub(); } @BetaApi("A restructuring of stub classes is planned, so this may break in the future") protected ParticipantsClient(ParticipantsStub stub) { this.settings = null; this.stub = stub; } public final ParticipantsSettings getSettings() { return settings; } @BetaApi("A restructuring of stub classes is planned, so this may break in the future") public ParticipantsStub getStub() { return stub; } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new participant in a conversation. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   ConversationName parent =
   *       ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]");
   *   Participant participant = Participant.newBuilder().build();
   *   Participant response = participantsClient.createParticipant(parent, participant);
   * }
   * }
* * @param parent Required. Resource identifier of the conversation adding the participant. Format: * `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation * ID>`. * @param participant Required. The participant to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Participant createParticipant(ConversationName parent, Participant participant) { CreateParticipantRequest request = CreateParticipantRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .setParticipant(participant) .build(); return createParticipant(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new participant in a conversation. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   String parent =
   *       ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]").toString();
   *   Participant participant = Participant.newBuilder().build();
   *   Participant response = participantsClient.createParticipant(parent, participant);
   * }
   * }
* * @param parent Required. Resource identifier of the conversation adding the participant. Format: * `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation * ID>`. * @param participant Required. The participant to create. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Participant createParticipant(String parent, Participant participant) { CreateParticipantRequest request = CreateParticipantRequest.newBuilder().setParent(parent).setParticipant(participant).build(); return createParticipant(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new participant in a conversation. * *

Sample code: * *

{@code
   * 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);
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Participant createParticipant(CreateParticipantRequest request) { return createParticipantCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Creates a new participant in a conversation. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   CreateParticipantRequest request =
   *       CreateParticipantRequest.newBuilder()
   *           .setParent(
   *               ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]")
   *                   .toString())
   *           .setParticipant(Participant.newBuilder().build())
   *           .build();
   *   ApiFuture future =
   *       participantsClient.createParticipantCallable().futureCall(request);
   *   // Do something.
   *   Participant response = future.get();
   * }
   * }
*/ public final UnaryCallable createParticipantCallable() { return stub.createParticipantCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves a conversation participant. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   ParticipantName name =
   *       ParticipantName.ofProjectConversationParticipantName(
   *           "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]");
   *   Participant response = participantsClient.getParticipant(name);
   * }
   * }
* * @param name Required. The name of the participant. Format: `projects/<Project * ID>/locations/<Location ID>/conversations/<Conversation * ID>/participants/<Participant ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Participant getParticipant(ParticipantName name) { GetParticipantRequest request = GetParticipantRequest.newBuilder().setName(name == null ? null : name.toString()).build(); return getParticipant(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves a conversation participant. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   String name =
   *       ParticipantName.ofProjectConversationParticipantName(
   *               "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
   *           .toString();
   *   Participant response = participantsClient.getParticipant(name);
   * }
   * }
* * @param name Required. The name of the participant. Format: `projects/<Project * ID>/locations/<Location ID>/conversations/<Conversation * ID>/participants/<Participant ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Participant getParticipant(String name) { GetParticipantRequest request = GetParticipantRequest.newBuilder().setName(name).build(); return getParticipant(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves a conversation participant. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   GetParticipantRequest request =
   *       GetParticipantRequest.newBuilder()
   *           .setName(
   *               ParticipantName.ofProjectConversationParticipantName(
   *                       "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
   *                   .toString())
   *           .build();
   *   Participant response = participantsClient.getParticipant(request);
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Participant getParticipant(GetParticipantRequest request) { return getParticipantCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Retrieves a conversation participant. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   GetParticipantRequest request =
   *       GetParticipantRequest.newBuilder()
   *           .setName(
   *               ParticipantName.ofProjectConversationParticipantName(
   *                       "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
   *                   .toString())
   *           .build();
   *   ApiFuture future =
   *       participantsClient.getParticipantCallable().futureCall(request);
   *   // Do something.
   *   Participant response = future.get();
   * }
   * }
*/ public final UnaryCallable getParticipantCallable() { return stub.getParticipantCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all participants in the specified conversation. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   ConversationName parent =
   *       ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]");
   *   for (Participant element : participantsClient.listParticipants(parent).iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
* * @param parent Required. The conversation to list all participants from. Format: * `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation * ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListParticipantsPagedResponse listParticipants(ConversationName parent) { ListParticipantsRequest request = ListParticipantsRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); return listParticipants(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all participants in the specified conversation. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   String parent =
   *       ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]").toString();
   *   for (Participant element : participantsClient.listParticipants(parent).iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
* * @param parent Required. The conversation to list all participants from. Format: * `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation * ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListParticipantsPagedResponse listParticipants(String parent) { ListParticipantsRequest request = ListParticipantsRequest.newBuilder().setParent(parent).build(); return listParticipants(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all participants in the specified conversation. * *

Sample code: * *

{@code
   * 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);
   *   }
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final ListParticipantsPagedResponse listParticipants(ListParticipantsRequest request) { return listParticipantsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all participants in the specified conversation. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   ListParticipantsRequest request =
   *       ListParticipantsRequest.newBuilder()
   *           .setParent(
   *               ConversationName.ofProjectConversationName("[PROJECT]", "[CONVERSATION]")
   *                   .toString())
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .build();
   *   ApiFuture future =
   *       participantsClient.listParticipantsPagedCallable().futureCall(request);
   *   // Do something.
   *   for (Participant element : future.get().iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
*/ public final UnaryCallable listParticipantsPagedCallable() { return stub.listParticipantsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Returns the list of all participants in the specified conversation. * *

Sample code: * *

{@code
   * 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.getResponsesList()) {
   *       // doThingsWith(element);
   *     }
   *     String nextPageToken = response.getNextPageToken();
   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
   *       request = request.toBuilder().setPageToken(nextPageToken).build();
   *     } else {
   *       break;
   *     }
   *   }
   * }
   * }
*/ public final UnaryCallable listParticipantsCallable() { return stub.listParticipantsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified participant. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   Participant participant = Participant.newBuilder().build();
   *   FieldMask updateMask = FieldMask.newBuilder().build();
   *   Participant response = participantsClient.updateParticipant(participant, updateMask);
   * }
   * }
* * @param participant Required. The participant to update. * @param updateMask Required. The mask to specify which fields to update. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Participant updateParticipant(Participant participant, FieldMask updateMask) { UpdateParticipantRequest request = UpdateParticipantRequest.newBuilder() .setParticipant(participant) .setUpdateMask(updateMask) .build(); return updateParticipant(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified participant. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   UpdateParticipantRequest request =
   *       UpdateParticipantRequest.newBuilder()
   *           .setParticipant(Participant.newBuilder().build())
   *           .setUpdateMask(FieldMask.newBuilder().build())
   *           .build();
   *   Participant response = participantsClient.updateParticipant(request);
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final Participant updateParticipant(UpdateParticipantRequest request) { return updateParticipantCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Updates the specified participant. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   UpdateParticipantRequest request =
   *       UpdateParticipantRequest.newBuilder()
   *           .setParticipant(Participant.newBuilder().build())
   *           .setUpdateMask(FieldMask.newBuilder().build())
   *           .build();
   *   ApiFuture future =
   *       participantsClient.updateParticipantCallable().futureCall(request);
   *   // Do something.
   *   Participant response = future.get();
   * }
   * }
*/ public final UnaryCallable updateParticipantCallable() { return stub.updateParticipantCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Adds a text (chat, for example), or audio (phone recording, for example) message from a * participant into the conversation. * *

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: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   ParticipantName participant =
   *       ParticipantName.ofProjectConversationParticipantName(
   *           "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]");
   *   EventInput eventInput = EventInput.newBuilder().build();
   *   AnalyzeContentResponse response = participantsClient.analyzeContent(participant, eventInput);
   * }
   * }
* * @param participant Required. The name of the participant this text comes from. Format: * `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation * ID>/participants/<Participant ID>`. * @param eventInput An input event to send to Dialogflow. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AnalyzeContentResponse analyzeContent( ParticipantName participant, EventInput eventInput) { AnalyzeContentRequest request = AnalyzeContentRequest.newBuilder() .setParticipant(participant == null ? null : participant.toString()) .setEventInput(eventInput) .build(); return analyzeContent(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Adds a text (chat, for example), or audio (phone recording, for example) message from a * participant into the conversation. * *

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: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   ParticipantName participant =
   *       ParticipantName.ofProjectConversationParticipantName(
   *           "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]");
   *   TextInput textInput = TextInput.newBuilder().build();
   *   AnalyzeContentResponse response = participantsClient.analyzeContent(participant, textInput);
   * }
   * }
* * @param participant Required. The name of the participant this text comes from. Format: * `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation * ID>/participants/<Participant ID>`. * @param textInput The natural language text to be processed. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AnalyzeContentResponse analyzeContent( ParticipantName participant, TextInput textInput) { AnalyzeContentRequest request = AnalyzeContentRequest.newBuilder() .setParticipant(participant == null ? null : participant.toString()) .setTextInput(textInput) .build(); return analyzeContent(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Adds a text (chat, for example), or audio (phone recording, for example) message from a * participant into the conversation. * *

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: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   String participant =
   *       ParticipantName.ofProjectConversationParticipantName(
   *               "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
   *           .toString();
   *   EventInput eventInput = EventInput.newBuilder().build();
   *   AnalyzeContentResponse response = participantsClient.analyzeContent(participant, eventInput);
   * }
   * }
* * @param participant Required. The name of the participant this text comes from. Format: * `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation * ID>/participants/<Participant ID>`. * @param eventInput An input event to send to Dialogflow. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AnalyzeContentResponse analyzeContent(String participant, EventInput eventInput) { AnalyzeContentRequest request = AnalyzeContentRequest.newBuilder() .setParticipant(participant) .setEventInput(eventInput) .build(); return analyzeContent(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Adds a text (chat, for example), or audio (phone recording, for example) message from a * participant into the conversation. * *

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: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   String participant =
   *       ParticipantName.ofProjectConversationParticipantName(
   *               "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
   *           .toString();
   *   TextInput textInput = TextInput.newBuilder().build();
   *   AnalyzeContentResponse response = participantsClient.analyzeContent(participant, textInput);
   * }
   * }
* * @param participant Required. The name of the participant this text comes from. Format: * `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation * ID>/participants/<Participant ID>`. * @param textInput The natural language text to be processed. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AnalyzeContentResponse analyzeContent(String participant, TextInput textInput) { AnalyzeContentRequest request = AnalyzeContentRequest.newBuilder() .setParticipant(participant) .setTextInput(textInput) .build(); return analyzeContent(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Adds a text (chat, for example), or audio (phone recording, for example) message from a * participant into the conversation. * *

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: * *

{@code
   * 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())
   *           .setMessageSendTime(Timestamp.newBuilder().build())
   *           .setRequestId("requestId693933066")
   *           .build();
   *   AnalyzeContentResponse response = participantsClient.analyzeContent(request);
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final AnalyzeContentResponse analyzeContent(AnalyzeContentRequest request) { return analyzeContentCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Adds a text (chat, for example), or audio (phone recording, for example) message from a * participant into the conversation. * *

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: * *

{@code
   * 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())
   *           .setMessageSendTime(Timestamp.newBuilder().build())
   *           .setRequestId("requestId693933066")
   *           .build();
   *   ApiFuture future =
   *       participantsClient.analyzeContentCallable().futureCall(request);
   *   // Do something.
   *   AnalyzeContentResponse response = future.get();
   * }
   * }
*/ public final UnaryCallable analyzeContentCallable() { return stub.analyzeContentCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets suggested articles for a participant based on specific historical messages. * *

Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] * will only list the auto-generated suggestions, while * [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to * compile suggestion based on the provided conversation context in the real time. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   ParticipantName parent =
   *       ParticipantName.ofProjectConversationParticipantName(
   *           "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]");
   *   SuggestArticlesResponse response = participantsClient.suggestArticles(parent);
   * }
   * }
* * @param parent Required. The name of the participant to fetch suggestion for. Format: * `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation * ID>/participants/<Participant ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SuggestArticlesResponse suggestArticles(ParticipantName parent) { SuggestArticlesRequest request = SuggestArticlesRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); return suggestArticles(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets suggested articles for a participant based on specific historical messages. * *

Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] * will only list the auto-generated suggestions, while * [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to * compile suggestion based on the provided conversation context in the real time. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   String parent =
   *       ParticipantName.ofProjectConversationParticipantName(
   *               "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
   *           .toString();
   *   SuggestArticlesResponse response = participantsClient.suggestArticles(parent);
   * }
   * }
* * @param parent Required. The name of the participant to fetch suggestion for. Format: * `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation * ID>/participants/<Participant ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SuggestArticlesResponse suggestArticles(String parent) { SuggestArticlesRequest request = SuggestArticlesRequest.newBuilder().setParent(parent).build(); return suggestArticles(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets suggested articles for a participant based on specific historical messages. * *

Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] * will only list the auto-generated suggestions, while * [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to * compile suggestion based on the provided conversation context in the real time. * *

Sample code: * *

{@code
   * 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);
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SuggestArticlesResponse suggestArticles(SuggestArticlesRequest request) { return suggestArticlesCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets suggested articles for a participant based on specific historical messages. * *

Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] * will only list the auto-generated suggestions, while * [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to * compile suggestion based on the provided conversation context in the real time. * *

Sample code: * *

{@code
   * 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 future =
   *       participantsClient.suggestArticlesCallable().futureCall(request);
   *   // Do something.
   *   SuggestArticlesResponse response = future.get();
   * }
   * }
*/ public final UnaryCallable suggestArticlesCallable() { return stub.suggestArticlesCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets suggested faq answers for a participant based on specific historical messages. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   ParticipantName parent =
   *       ParticipantName.ofProjectConversationParticipantName(
   *           "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]");
   *   SuggestFaqAnswersResponse response = participantsClient.suggestFaqAnswers(parent);
   * }
   * }
* * @param parent Required. The name of the participant to fetch suggestion for. Format: * `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation * ID>/participants/<Participant ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SuggestFaqAnswersResponse suggestFaqAnswers(ParticipantName parent) { SuggestFaqAnswersRequest request = SuggestFaqAnswersRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); return suggestFaqAnswers(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets suggested faq answers for a participant based on specific historical messages. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   String parent =
   *       ParticipantName.ofProjectConversationParticipantName(
   *               "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
   *           .toString();
   *   SuggestFaqAnswersResponse response = participantsClient.suggestFaqAnswers(parent);
   * }
   * }
* * @param parent Required. The name of the participant to fetch suggestion for. Format: * `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation * ID>/participants/<Participant ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SuggestFaqAnswersResponse suggestFaqAnswers(String parent) { SuggestFaqAnswersRequest request = SuggestFaqAnswersRequest.newBuilder().setParent(parent).build(); return suggestFaqAnswers(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets suggested faq answers for a participant based on specific historical messages. * *

Sample code: * *

{@code
   * 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);
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SuggestFaqAnswersResponse suggestFaqAnswers(SuggestFaqAnswersRequest request) { return suggestFaqAnswersCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets suggested faq answers for a participant based on specific historical messages. * *

Sample code: * *

{@code
   * 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 future =
   *       participantsClient.suggestFaqAnswersCallable().futureCall(request);
   *   // Do something.
   *   SuggestFaqAnswersResponse response = future.get();
   * }
   * }
*/ public final UnaryCallable suggestFaqAnswersCallable() { return stub.suggestFaqAnswersCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets smart replies for a participant based on specific historical messages. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   ParticipantName parent =
   *       ParticipantName.ofProjectConversationParticipantName(
   *           "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]");
   *   SuggestSmartRepliesResponse response = participantsClient.suggestSmartReplies(parent);
   * }
   * }
* * @param parent Required. The name of the participant to fetch suggestion for. Format: * `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation * ID>/participants/<Participant ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SuggestSmartRepliesResponse suggestSmartReplies(ParticipantName parent) { SuggestSmartRepliesRequest request = SuggestSmartRepliesRequest.newBuilder() .setParent(parent == null ? null : parent.toString()) .build(); return suggestSmartReplies(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets smart replies for a participant based on specific historical messages. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   String parent =
   *       ParticipantName.ofProjectConversationParticipantName(
   *               "[PROJECT]", "[CONVERSATION]", "[PARTICIPANT]")
   *           .toString();
   *   SuggestSmartRepliesResponse response = participantsClient.suggestSmartReplies(parent);
   * }
   * }
* * @param parent Required. The name of the participant to fetch suggestion for. Format: * `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation * ID>/participants/<Participant ID>`. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SuggestSmartRepliesResponse suggestSmartReplies(String parent) { SuggestSmartRepliesRequest request = SuggestSmartRepliesRequest.newBuilder().setParent(parent).build(); return suggestSmartReplies(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets smart replies for a participant based on specific historical messages. * *

Sample code: * *

{@code
   * 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);
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails */ public final SuggestSmartRepliesResponse suggestSmartReplies(SuggestSmartRepliesRequest request) { return suggestSmartRepliesCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Gets smart replies for a participant based on specific historical messages. * *

Sample code: * *

{@code
   * 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 future =
   *       participantsClient.suggestSmartRepliesCallable().futureCall(request);
   *   // Do something.
   *   SuggestSmartRepliesResponse response = future.get();
   * }
   * }
*/ public final UnaryCallable suggestSmartRepliesCallable() { return stub.suggestSmartRepliesCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deprecated: Use inline suggestion, event based suggestion or Suggestion* API instead. See * [HumanAgentAssistantConfig.name][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.name] * for more details. Removal Date: 2020-09-01. * *

Retrieves suggestions for live agents. * *

This method should be used by human agent client software to fetch auto generated * suggestions in real-time, while the conversation with an end user is in progress. The * functionality is implemented in terms of the [list * pagination](https://cloud.google.com/apis/design/design_patterns#list_pagination) design * pattern. The client app should use the `next_page_token` field to fetch the next batch of * suggestions. `suggestions` are sorted by `create_time` in descending order. To fetch latest * suggestion, just set `page_size` to 1. To fetch new suggestions without duplication, send * request with filter `create_time_epoch_microseconds > [first item's create_time of previous * request]` and empty page_token. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   ListSuggestionsRequest request =
   *       ListSuggestionsRequest.newBuilder()
   *           .setParent("parent-995424086")
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .setFilter("filter-1274492040")
   *           .build();
   *   for (Suggestion element : participantsClient.listSuggestions(request).iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails * @deprecated This method is deprecated and will be removed in the next major version update. */ @Deprecated public final ListSuggestionsPagedResponse listSuggestions(ListSuggestionsRequest request) { return listSuggestionsPagedCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deprecated: Use inline suggestion, event based suggestion or Suggestion* API instead. See * [HumanAgentAssistantConfig.name][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.name] * for more details. Removal Date: 2020-09-01. * *

Retrieves suggestions for live agents. * *

This method should be used by human agent client software to fetch auto generated * suggestions in real-time, while the conversation with an end user is in progress. The * functionality is implemented in terms of the [list * pagination](https://cloud.google.com/apis/design/design_patterns#list_pagination) design * pattern. The client app should use the `next_page_token` field to fetch the next batch of * suggestions. `suggestions` are sorted by `create_time` in descending order. To fetch latest * suggestion, just set `page_size` to 1. To fetch new suggestions without duplication, send * request with filter `create_time_epoch_microseconds > [first item's create_time of previous * request]` and empty page_token. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   ListSuggestionsRequest request =
   *       ListSuggestionsRequest.newBuilder()
   *           .setParent("parent-995424086")
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .setFilter("filter-1274492040")
   *           .build();
   *   ApiFuture future =
   *       participantsClient.listSuggestionsPagedCallable().futureCall(request);
   *   // Do something.
   *   for (Suggestion element : future.get().iterateAll()) {
   *     // doThingsWith(element);
   *   }
   * }
   * }
* * @deprecated This method is deprecated and will be removed in the next major version update. */ @Deprecated public final UnaryCallable listSuggestionsPagedCallable() { return stub.listSuggestionsPagedCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deprecated: Use inline suggestion, event based suggestion or Suggestion* API instead. See * [HumanAgentAssistantConfig.name][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.name] * for more details. Removal Date: 2020-09-01. * *

Retrieves suggestions for live agents. * *

This method should be used by human agent client software to fetch auto generated * suggestions in real-time, while the conversation with an end user is in progress. The * functionality is implemented in terms of the [list * pagination](https://cloud.google.com/apis/design/design_patterns#list_pagination) design * pattern. The client app should use the `next_page_token` field to fetch the next batch of * suggestions. `suggestions` are sorted by `create_time` in descending order. To fetch latest * suggestion, just set `page_size` to 1. To fetch new suggestions without duplication, send * request with filter `create_time_epoch_microseconds > [first item's create_time of previous * request]` and empty page_token. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   ListSuggestionsRequest request =
   *       ListSuggestionsRequest.newBuilder()
   *           .setParent("parent-995424086")
   *           .setPageSize(883849137)
   *           .setPageToken("pageToken873572522")
   *           .setFilter("filter-1274492040")
   *           .build();
   *   while (true) {
   *     ListSuggestionsResponse response =
   *         participantsClient.listSuggestionsCallable().call(request);
   *     for (Suggestion element : response.getResponsesList()) {
   *       // doThingsWith(element);
   *     }
   *     String nextPageToken = response.getNextPageToken();
   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
   *       request = request.toBuilder().setPageToken(nextPageToken).build();
   *     } else {
   *       break;
   *     }
   *   }
   * }
   * }
* * @deprecated This method is deprecated and will be removed in the next major version update. */ @Deprecated public final UnaryCallable listSuggestionsCallable() { return stub.listSuggestionsCallable(); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deprecated. use [SuggestArticles][google.cloud.dialogflow.v2beta1.Participants.SuggestArticles] * and [SuggestFaqAnswers][google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers] * instead. * *

Gets suggestions for a participant based on specific historical messages. * *

Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] * will only list the auto-generated suggestions, while * [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to * compile suggestion based on the provided conversation context in the real time. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   CompileSuggestionRequest request =
   *       CompileSuggestionRequest.newBuilder()
   *           .setParent("parent-995424086")
   *           .setLatestMessage("latestMessage-1424305536")
   *           .setContextSize(1116903569)
   *           .build();
   *   CompileSuggestionResponse response = participantsClient.compileSuggestion(request);
   * }
   * }
* * @param request The request object containing all of the parameters for the API call. * @throws com.google.api.gax.rpc.ApiException if the remote call fails * @deprecated This method is deprecated and will be removed in the next major version update. */ @Deprecated public final CompileSuggestionResponse compileSuggestion(CompileSuggestionRequest request) { return compileSuggestionCallable().call(request); } // AUTO-GENERATED DOCUMENTATION AND METHOD. /** * Deprecated. use [SuggestArticles][google.cloud.dialogflow.v2beta1.Participants.SuggestArticles] * and [SuggestFaqAnswers][google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers] * instead. * *

Gets suggestions for a participant based on specific historical messages. * *

Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] * will only list the auto-generated suggestions, while * [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to * compile suggestion based on the provided conversation context in the real time. * *

Sample code: * *

{@code
   * try (ParticipantsClient participantsClient = ParticipantsClient.create()) {
   *   CompileSuggestionRequest request =
   *       CompileSuggestionRequest.newBuilder()
   *           .setParent("parent-995424086")
   *           .setLatestMessage("latestMessage-1424305536")
   *           .setContextSize(1116903569)
   *           .build();
   *   ApiFuture future =
   *       participantsClient.compileSuggestionCallable().futureCall(request);
   *   // Do something.
   *   CompileSuggestionResponse response = future.get();
   * }
   * }
* * @deprecated This method is deprecated and will be removed in the next major version update. */ @Deprecated public final UnaryCallable compileSuggestionCallable() { return stub.compileSuggestionCallable(); } @Override public final void close() { stub.close(); } @Override public void shutdown() { stub.shutdown(); } @Override public boolean isShutdown() { return stub.isShutdown(); } @Override public boolean isTerminated() { return stub.isTerminated(); } @Override public void shutdownNow() { stub.shutdownNow(); } @Override public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException { return stub.awaitTermination(duration, unit); } public static class ListParticipantsPagedResponse extends AbstractPagedListResponse< ListParticipantsRequest, ListParticipantsResponse, Participant, ListParticipantsPage, ListParticipantsFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = ListParticipantsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, input -> new ListParticipantsPagedResponse(input), MoreExecutors.directExecutor()); } private ListParticipantsPagedResponse(ListParticipantsPage page) { super(page, ListParticipantsFixedSizeCollection.createEmptyCollection()); } } public static class ListParticipantsPage extends AbstractPage< ListParticipantsRequest, ListParticipantsResponse, Participant, ListParticipantsPage> { private ListParticipantsPage( PageContext context, ListParticipantsResponse response) { super(context, response); } private static ListParticipantsPage createEmptyPage() { return new ListParticipantsPage(null, null); } @Override protected ListParticipantsPage createPage( PageContext context, ListParticipantsResponse response) { return new ListParticipantsPage(context, response); } @Override public ApiFuture createPageAsync( PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } } public static class ListParticipantsFixedSizeCollection extends AbstractFixedSizeCollection< ListParticipantsRequest, ListParticipantsResponse, Participant, ListParticipantsPage, ListParticipantsFixedSizeCollection> { private ListParticipantsFixedSizeCollection( List pages, int collectionSize) { super(pages, collectionSize); } private static ListParticipantsFixedSizeCollection createEmptyCollection() { return new ListParticipantsFixedSizeCollection(null, 0); } @Override protected ListParticipantsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListParticipantsFixedSizeCollection(pages, collectionSize); } } public static class ListSuggestionsPagedResponse extends AbstractPagedListResponse< ListSuggestionsRequest, ListSuggestionsResponse, Suggestion, ListSuggestionsPage, ListSuggestionsFixedSizeCollection> { public static ApiFuture createAsync( PageContext context, ApiFuture futureResponse) { ApiFuture futurePage = ListSuggestionsPage.createEmptyPage().createPageAsync(context, futureResponse); return ApiFutures.transform( futurePage, input -> new ListSuggestionsPagedResponse(input), MoreExecutors.directExecutor()); } private ListSuggestionsPagedResponse(ListSuggestionsPage page) { super(page, ListSuggestionsFixedSizeCollection.createEmptyCollection()); } } public static class ListSuggestionsPage extends AbstractPage< ListSuggestionsRequest, ListSuggestionsResponse, Suggestion, ListSuggestionsPage> { private ListSuggestionsPage( PageContext context, ListSuggestionsResponse response) { super(context, response); } private static ListSuggestionsPage createEmptyPage() { return new ListSuggestionsPage(null, null); } @Override protected ListSuggestionsPage createPage( PageContext context, ListSuggestionsResponse response) { return new ListSuggestionsPage(context, response); } @Override public ApiFuture createPageAsync( PageContext context, ApiFuture futureResponse) { return super.createPageAsync(context, futureResponse); } } public static class ListSuggestionsFixedSizeCollection extends AbstractFixedSizeCollection< ListSuggestionsRequest, ListSuggestionsResponse, Suggestion, ListSuggestionsPage, ListSuggestionsFixedSizeCollection> { private ListSuggestionsFixedSizeCollection( List pages, int collectionSize) { super(pages, collectionSize); } private static ListSuggestionsFixedSizeCollection createEmptyCollection() { return new ListSuggestionsFixedSizeCollection(null, 0); } @Override protected ListSuggestionsFixedSizeCollection createCollection( List pages, int collectionSize) { return new ListSuggestionsFixedSizeCollection(pages, collectionSize); } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy