Class IntentsClient

  • All Implemented Interfaces:
    com.google.api.gax.core.BackgroundResource, AutoCloseable

    @BetaApi
    @Generated("by gapic-generator-java")
    public class IntentsClient
    extends Object
    implements com.google.api.gax.core.BackgroundResource
    Service Description: Service for managing [Intents][google.cloud.dialogflow.v2beta1.Intent].

    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 (IntentsClient intentsClient = IntentsClient.create()) {
       IntentName name = IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]");
       Intent response = intentsClient.getIntent(name);
     }
     

    Note: close() needs to be called on the IntentsClient 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 IntentsSettings 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
     IntentsSettings intentsSettings =
         IntentsSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     IntentsClient intentsClient = IntentsClient.create(intentsSettings);
     

    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
     IntentsSettings intentsSettings = IntentsSettings.newBuilder().setEndpoint(myEndpoint).build();
     IntentsClient intentsClient = IntentsClient.create(intentsSettings);
     

    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
     IntentsSettings intentsSettings = IntentsSettings.newHttpJsonBuilder().build();
     IntentsClient intentsClient = IntentsClient.create(intentsSettings);
     

    Please refer to the GitHub repository's samples for more quickstart code snippets.

    • Constructor Detail

      • IntentsClient

        protected IntentsClient​(IntentsSettings settings)
                         throws IOException
        Constructs an instance of IntentsClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
        Throws:
        IOException
      • IntentsClient

        protected IntentsClient​(IntentsStub stub)
    • Method Detail

      • create

        public static final IntentsClient create​(IntentsSettings settings)
                                          throws IOException
        Constructs an instance of IntentsClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
        Throws:
        IOException
      • create

        public static final IntentsClient create​(IntentsStub stub)
        Constructs an instance of IntentsClient, using the given stub for making calls. This is for advanced usage - prefer using create(IntentsSettings).
      • getOperationsClient

        public final com.google.longrunning.OperationsClient getOperationsClient()
        Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
      • getHttpJsonOperationsClient

        @BetaApi
        public final com.google.api.gax.httpjson.longrunning.OperationsClient getHttpJsonOperationsClient()
        Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
      • listIntents

        public final IntentsClient.ListIntentsPagedResponse listIntents​(AgentName parent)
        Returns the list of all intents in the specified agent.

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           AgentName parent = AgentName.ofProjectName("[PROJECT]");
           for (Intent element : intentsClient.listIntents(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The agent to list all intents from. Format: `projects/<Project ID>/agent` or `projects/<Project ID>/locations/<Location ID>/agent`.

        Alternatively, you can specify the environment to list intents for. Format: `projects/<Project ID>/agent/environments/<Environment ID>` or `projects/<Project ID>/locations/<Location ID>/agent/environments/<Environment ID>`. Note: training phrases of the intents will not be returned for non-draft environment.

        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listIntents

        public final IntentsClient.ListIntentsPagedResponse listIntents​(String parent)
        Returns the list of all intents in the specified agent.

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           String parent = AgentName.ofProjectName("[PROJECT]").toString();
           for (Intent element : intentsClient.listIntents(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The agent to list all intents from. Format: `projects/<Project ID>/agent` or `projects/<Project ID>/locations/<Location ID>/agent`.

        Alternatively, you can specify the environment to list intents for. Format: `projects/<Project ID>/agent/environments/<Environment ID>` or `projects/<Project ID>/locations/<Location ID>/agent/environments/<Environment ID>`. Note: training phrases of the intents will not be returned for non-draft environment.

        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listIntents

        public final IntentsClient.ListIntentsPagedResponse listIntents​(AgentName parent,
                                                                        String languageCode)
        Returns the list of all intents in the specified agent.

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           AgentName parent = AgentName.ofProjectName("[PROJECT]");
           String languageCode = "languageCode-2092349083";
           for (Intent element : intentsClient.listIntents(parent, languageCode).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The agent to list all intents from. Format: `projects/<Project ID>/agent` or `projects/<Project ID>/locations/<Location ID>/agent`.

        Alternatively, you can specify the environment to list intents for. Format: `projects/<Project ID>/agent/environments/<Environment ID>` or `projects/<Project ID>/locations/<Location ID>/agent/environments/<Environment ID>`. Note: training phrases of the intents will not be returned for non-draft environment.

        languageCode - Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listIntents

        public final IntentsClient.ListIntentsPagedResponse listIntents​(String parent,
                                                                        String languageCode)
        Returns the list of all intents in the specified agent.

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           String parent = AgentName.ofProjectName("[PROJECT]").toString();
           String languageCode = "languageCode-2092349083";
           for (Intent element : intentsClient.listIntents(parent, languageCode).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The agent to list all intents from. Format: `projects/<Project ID>/agent` or `projects/<Project ID>/locations/<Location ID>/agent`.

        Alternatively, you can specify the environment to list intents for. Format: `projects/<Project ID>/agent/environments/<Environment ID>` or `projects/<Project ID>/locations/<Location ID>/agent/environments/<Environment ID>`. Note: training phrases of the intents will not be returned for non-draft environment.

        languageCode - Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listIntents

        public final IntentsClient.ListIntentsPagedResponse listIntents​(ListIntentsRequest request)
        Returns the list of all intents in the specified agent.

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           ListIntentsRequest request =
               ListIntentsRequest.newBuilder()
                   .setParent(AgentName.ofProjectName("[PROJECT]").toString())
                   .setLanguageCode("languageCode-2092349083")
                   .setIntentView(IntentView.forNumber(0))
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           for (Intent element : intentsClient.listIntents(request).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listIntentsPagedCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListIntentsRequest,​IntentsClient.ListIntentsPagedResponse> listIntentsPagedCallable()
        Returns the list of all intents in the specified agent.

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           ListIntentsRequest request =
               ListIntentsRequest.newBuilder()
                   .setParent(AgentName.ofProjectName("[PROJECT]").toString())
                   .setLanguageCode("languageCode-2092349083")
                   .setIntentView(IntentView.forNumber(0))
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           ApiFuture<Intent> future = intentsClient.listIntentsPagedCallable().futureCall(request);
           // Do something.
           for (Intent element : future.get().iterateAll()) {
             // doThingsWith(element);
           }
         }
         
      • listIntentsCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListIntentsRequest,​ListIntentsResponse> listIntentsCallable()
        Returns the list of all intents in the specified agent.

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           ListIntentsRequest request =
               ListIntentsRequest.newBuilder()
                   .setParent(AgentName.ofProjectName("[PROJECT]").toString())
                   .setLanguageCode("languageCode-2092349083")
                   .setIntentView(IntentView.forNumber(0))
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           while (true) {
             ListIntentsResponse response = intentsClient.listIntentsCallable().call(request);
             for (Intent element : response.getIntentsList()) {
               // doThingsWith(element);
             }
             String nextPageToken = response.getNextPageToken();
             if (!Strings.isNullOrEmpty(nextPageToken)) {
               request = request.toBuilder().setPageToken(nextPageToken).build();
             } else {
               break;
             }
           }
         }
         
      • getIntent

        public final Intent getIntent​(IntentName name)
        Retrieves the specified intent.

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           IntentName name = IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]");
           Intent response = intentsClient.getIntent(name);
         }
         
        Parameters:
        name - Required. The name of the intent. Supported formats:

        - `projects/<Project ID>/agent/intents/<Intent ID>` - `projects/<Project ID>/locations/<Location ID>/agent/intents/<Intent ID>`

        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getIntent

        public final Intent getIntent​(String name)
        Retrieves the specified intent.

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           String name = IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]").toString();
           Intent response = intentsClient.getIntent(name);
         }
         
        Parameters:
        name - Required. The name of the intent. Supported formats:

        - `projects/<Project ID>/agent/intents/<Intent ID>` - `projects/<Project ID>/locations/<Location ID>/agent/intents/<Intent ID>`

        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getIntent

        public final Intent getIntent​(IntentName name,
                                      String languageCode)
        Retrieves the specified intent.

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           IntentName name = IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]");
           String languageCode = "languageCode-2092349083";
           Intent response = intentsClient.getIntent(name, languageCode);
         }
         
        Parameters:
        name - Required. The name of the intent. Supported formats:

        - `projects/<Project ID>/agent/intents/<Intent ID>` - `projects/<Project ID>/locations/<Location ID>/agent/intents/<Intent ID>`

        languageCode - Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getIntent

        public final Intent getIntent​(String name,
                                      String languageCode)
        Retrieves the specified intent.

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           String name = IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]").toString();
           String languageCode = "languageCode-2092349083";
           Intent response = intentsClient.getIntent(name, languageCode);
         }
         
        Parameters:
        name - Required. The name of the intent. Supported formats:

        - `projects/<Project ID>/agent/intents/<Intent ID>` - `projects/<Project ID>/locations/<Location ID>/agent/intents/<Intent ID>`

        languageCode - Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getIntent

        public final Intent getIntent​(GetIntentRequest request)
        Retrieves the specified intent.

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           GetIntentRequest request =
               GetIntentRequest.newBuilder()
                   .setName(IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]").toString())
                   .setLanguageCode("languageCode-2092349083")
                   .setIntentView(IntentView.forNumber(0))
                   .build();
           Intent response = intentsClient.getIntent(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getIntentCallable

        public final com.google.api.gax.rpc.UnaryCallable<GetIntentRequest,​Intent> getIntentCallable()
        Retrieves the specified intent.

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           GetIntentRequest request =
               GetIntentRequest.newBuilder()
                   .setName(IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]").toString())
                   .setLanguageCode("languageCode-2092349083")
                   .setIntentView(IntentView.forNumber(0))
                   .build();
           ApiFuture<Intent> future = intentsClient.getIntentCallable().futureCall(request);
           // Do something.
           Intent response = future.get();
         }
         
      • createIntent

        public final Intent createIntent​(AgentName parent,
                                         Intent intent)
        Creates an intent in the specified agent.

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           AgentName parent = AgentName.ofProjectName("[PROJECT]");
           Intent intent = Intent.newBuilder().build();
           Intent response = intentsClient.createIntent(parent, intent);
         }
         
        Parameters:
        parent - Required. The agent to create a intent for. Supported formats:

        - `projects/<Project ID>/agent` - `projects/<Project ID>/locations/<Location ID>/agent`

        intent - Required. The intent to create.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createIntent

        public final Intent createIntent​(String parent,
                                         Intent intent)
        Creates an intent in the specified agent.

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           String parent = AgentName.ofProjectName("[PROJECT]").toString();
           Intent intent = Intent.newBuilder().build();
           Intent response = intentsClient.createIntent(parent, intent);
         }
         
        Parameters:
        parent - Required. The agent to create a intent for. Supported formats:

        - `projects/<Project ID>/agent` - `projects/<Project ID>/locations/<Location ID>/agent`

        intent - Required. The intent to create.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createIntent

        public final Intent createIntent​(AgentName parent,
                                         Intent intent,
                                         String languageCode)
        Creates an intent in the specified agent.

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           AgentName parent = AgentName.ofProjectName("[PROJECT]");
           Intent intent = Intent.newBuilder().build();
           String languageCode = "languageCode-2092349083";
           Intent response = intentsClient.createIntent(parent, intent, languageCode);
         }
         
        Parameters:
        parent - Required. The agent to create a intent for. Supported formats:

        - `projects/<Project ID>/agent` - `projects/<Project ID>/locations/<Location ID>/agent`

        intent - Required. The intent to create.
        languageCode - Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createIntent

        public final Intent createIntent​(String parent,
                                         Intent intent,
                                         String languageCode)
        Creates an intent in the specified agent.

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           String parent = AgentName.ofProjectName("[PROJECT]").toString();
           Intent intent = Intent.newBuilder().build();
           String languageCode = "languageCode-2092349083";
           Intent response = intentsClient.createIntent(parent, intent, languageCode);
         }
         
        Parameters:
        parent - Required. The agent to create a intent for. Supported formats:

        - `projects/<Project ID>/agent` - `projects/<Project ID>/locations/<Location ID>/agent`

        intent - Required. The intent to create.
        languageCode - Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createIntent

        public final Intent createIntent​(CreateIntentRequest request)
        Creates an intent in the specified agent.

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           CreateIntentRequest request =
               CreateIntentRequest.newBuilder()
                   .setParent(AgentName.ofProjectName("[PROJECT]").toString())
                   .setIntent(Intent.newBuilder().build())
                   .setLanguageCode("languageCode-2092349083")
                   .setIntentView(IntentView.forNumber(0))
                   .build();
           Intent response = intentsClient.createIntent(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createIntentCallable

        public final com.google.api.gax.rpc.UnaryCallable<CreateIntentRequest,​Intent> createIntentCallable()
        Creates an intent in the specified agent.

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           CreateIntentRequest request =
               CreateIntentRequest.newBuilder()
                   .setParent(AgentName.ofProjectName("[PROJECT]").toString())
                   .setIntent(Intent.newBuilder().build())
                   .setLanguageCode("languageCode-2092349083")
                   .setIntentView(IntentView.forNumber(0))
                   .build();
           ApiFuture<Intent> future = intentsClient.createIntentCallable().futureCall(request);
           // Do something.
           Intent response = future.get();
         }
         
      • updateIntent

        public final Intent updateIntent​(Intent intent)
        Updates the specified intent.

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           Intent intent = Intent.newBuilder().build();
           Intent response = intentsClient.updateIntent(intent);
         }
         
        Parameters:
        intent - Required. The intent to update.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateIntent

        public final Intent updateIntent​(Intent intent,
                                         com.google.protobuf.FieldMask updateMask)
        Updates the specified intent.

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           Intent intent = Intent.newBuilder().build();
           FieldMask updateMask = FieldMask.newBuilder().build();
           Intent response = intentsClient.updateIntent(intent, updateMask);
         }
         
        Parameters:
        intent - Required. The intent to update.
        updateMask - Optional. The mask to control which fields get updated.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateIntent

        public final Intent updateIntent​(Intent intent,
                                         String languageCode)
        Updates the specified intent.

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           Intent intent = Intent.newBuilder().build();
           String languageCode = "languageCode-2092349083";
           Intent response = intentsClient.updateIntent(intent, languageCode);
         }
         
        Parameters:
        intent - Required. The intent to update.
        languageCode - Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateIntent

        public final Intent updateIntent​(Intent intent,
                                         String languageCode,
                                         com.google.protobuf.FieldMask updateMask)
        Updates the specified intent.

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           Intent intent = Intent.newBuilder().build();
           String languageCode = "languageCode-2092349083";
           FieldMask updateMask = FieldMask.newBuilder().build();
           Intent response = intentsClient.updateIntent(intent, languageCode, updateMask);
         }
         
        Parameters:
        intent - Required. The intent to update.
        languageCode - Optional. The language used to access language-specific data. If not specified, the agent's default language is used. For more information, see [Multilingual intent and entity data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
        updateMask - Optional. The mask to control which fields get updated.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateIntent

        public final Intent updateIntent​(UpdateIntentRequest request)
        Updates the specified intent.

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           UpdateIntentRequest request =
               UpdateIntentRequest.newBuilder()
                   .setIntent(Intent.newBuilder().build())
                   .setLanguageCode("languageCode-2092349083")
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .setIntentView(IntentView.forNumber(0))
                   .build();
           Intent response = intentsClient.updateIntent(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateIntentCallable

        public final com.google.api.gax.rpc.UnaryCallable<UpdateIntentRequest,​Intent> updateIntentCallable()
        Updates the specified intent.

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           UpdateIntentRequest request =
               UpdateIntentRequest.newBuilder()
                   .setIntent(Intent.newBuilder().build())
                   .setLanguageCode("languageCode-2092349083")
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .setIntentView(IntentView.forNumber(0))
                   .build();
           ApiFuture<Intent> future = intentsClient.updateIntentCallable().futureCall(request);
           // Do something.
           Intent response = future.get();
         }
         
      • deleteIntent

        public final void deleteIntent​(IntentName name)
        Deletes the specified intent and its direct or indirect followup intents.

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           IntentName name = IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]");
           intentsClient.deleteIntent(name);
         }
         
        Parameters:
        name - Required. The name of the intent to delete. If this intent has direct or indirect followup intents, we also delete them.

        Supported formats:

        - `projects/<Project ID>/agent/intents/<Intent ID>` - `projects/<Project ID>/locations/<Location ID>/agent/intents/<Intent ID>`

        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteIntent

        public final void deleteIntent​(String name)
        Deletes the specified intent and its direct or indirect followup intents.

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           String name = IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]").toString();
           intentsClient.deleteIntent(name);
         }
         
        Parameters:
        name - Required. The name of the intent to delete. If this intent has direct or indirect followup intents, we also delete them.

        Supported formats:

        - `projects/<Project ID>/agent/intents/<Intent ID>` - `projects/<Project ID>/locations/<Location ID>/agent/intents/<Intent ID>`

        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteIntent

        public final void deleteIntent​(DeleteIntentRequest request)
        Deletes the specified intent and its direct or indirect followup intents.

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           DeleteIntentRequest request =
               DeleteIntentRequest.newBuilder()
                   .setName(IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]").toString())
                   .build();
           intentsClient.deleteIntent(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteIntentCallable

        public final com.google.api.gax.rpc.UnaryCallable<DeleteIntentRequest,​com.google.protobuf.Empty> deleteIntentCallable()
        Deletes the specified intent and its direct or indirect followup intents.

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           DeleteIntentRequest request =
               DeleteIntentRequest.newBuilder()
                   .setName(IntentName.ofProjectIntentName("[PROJECT]", "[INTENT]").toString())
                   .build();
           ApiFuture<Empty> future = intentsClient.deleteIntentCallable().futureCall(request);
           // Do something.
           future.get();
         }
         
      • batchUpdateIntentsAsync

        public final com.google.api.gax.longrunning.OperationFuture<BatchUpdateIntentsResponse,​com.google.protobuf.Struct> batchUpdateIntentsAsync​(AgentName parent,
                                                                                                                                                         IntentBatch intentBatchInline)
        Updates/Creates multiple intents in the specified agent.

        This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:

        - `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse]

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           AgentName parent = AgentName.ofProjectName("[PROJECT]");
           IntentBatch intentBatchInline = IntentBatch.newBuilder().build();
           BatchUpdateIntentsResponse response =
               intentsClient.batchUpdateIntentsAsync(parent, intentBatchInline).get();
         }
         
        Parameters:
        parent - Required. The name of the agent to update or create intents in. Supported formats:

        - `projects/<Project ID>/agent` - `projects/<Project ID>/locations/<Location ID>/agent`

        intentBatchInline - The collection of intents to update or create.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • batchUpdateIntentsAsync

        public final com.google.api.gax.longrunning.OperationFuture<BatchUpdateIntentsResponse,​com.google.protobuf.Struct> batchUpdateIntentsAsync​(AgentName parent,
                                                                                                                                                         String intentBatchUri)
        Updates/Creates multiple intents in the specified agent.

        This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:

        - `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse]

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           AgentName parent = AgentName.ofProjectName("[PROJECT]");
           String intentBatchUri = "intentBatchUri544125582";
           BatchUpdateIntentsResponse response =
               intentsClient.batchUpdateIntentsAsync(parent, intentBatchUri).get();
         }
         
        Parameters:
        parent - Required. The name of the agent to update or create intents in. Supported formats:

        - `projects/<Project ID>/agent` - `projects/<Project ID>/locations/<Location ID>/agent`

        intentBatchUri - The URI to a Google Cloud Storage file containing intents to update or create. The file format can either be a serialized proto (of IntentBatch type) or JSON object. Note: The URI must start with "gs://".
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • batchUpdateIntentsAsync

        public final com.google.api.gax.longrunning.OperationFuture<BatchUpdateIntentsResponse,​com.google.protobuf.Struct> batchUpdateIntentsAsync​(String parent,
                                                                                                                                                         IntentBatch intentBatchInline)
        Updates/Creates multiple intents in the specified agent.

        This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:

        - `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse]

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           String parent = AgentName.ofProjectName("[PROJECT]").toString();
           IntentBatch intentBatchInline = IntentBatch.newBuilder().build();
           BatchUpdateIntentsResponse response =
               intentsClient.batchUpdateIntentsAsync(parent, intentBatchInline).get();
         }
         
        Parameters:
        parent - Required. The name of the agent to update or create intents in. Supported formats:

        - `projects/<Project ID>/agent` - `projects/<Project ID>/locations/<Location ID>/agent`

        intentBatchInline - The collection of intents to update or create.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • batchUpdateIntentsAsync

        public final com.google.api.gax.longrunning.OperationFuture<BatchUpdateIntentsResponse,​com.google.protobuf.Struct> batchUpdateIntentsAsync​(String parent,
                                                                                                                                                         String intentBatchUri)
        Updates/Creates multiple intents in the specified agent.

        This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:

        - `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse]

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           String parent = AgentName.ofProjectName("[PROJECT]").toString();
           String intentBatchUri = "intentBatchUri544125582";
           BatchUpdateIntentsResponse response =
               intentsClient.batchUpdateIntentsAsync(parent, intentBatchUri).get();
         }
         
        Parameters:
        parent - Required. The name of the agent to update or create intents in. Supported formats:

        - `projects/<Project ID>/agent` - `projects/<Project ID>/locations/<Location ID>/agent`

        intentBatchUri - The URI to a Google Cloud Storage file containing intents to update or create. The file format can either be a serialized proto (of IntentBatch type) or JSON object. Note: The URI must start with "gs://".
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • batchUpdateIntentsAsync

        public final com.google.api.gax.longrunning.OperationFuture<BatchUpdateIntentsResponse,​com.google.protobuf.Struct> batchUpdateIntentsAsync​(BatchUpdateIntentsRequest request)
        Updates/Creates multiple intents in the specified agent.

        This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:

        - `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse]

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           BatchUpdateIntentsRequest request =
               BatchUpdateIntentsRequest.newBuilder()
                   .setParent(AgentName.ofProjectName("[PROJECT]").toString())
                   .setLanguageCode("languageCode-2092349083")
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .setIntentView(IntentView.forNumber(0))
                   .build();
           BatchUpdateIntentsResponse response = intentsClient.batchUpdateIntentsAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • batchUpdateIntentsOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<BatchUpdateIntentsRequest,​BatchUpdateIntentsResponse,​com.google.protobuf.Struct> batchUpdateIntentsOperationCallable()
        Updates/Creates multiple intents in the specified agent.

        This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:

        - `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse]

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           BatchUpdateIntentsRequest request =
               BatchUpdateIntentsRequest.newBuilder()
                   .setParent(AgentName.ofProjectName("[PROJECT]").toString())
                   .setLanguageCode("languageCode-2092349083")
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .setIntentView(IntentView.forNumber(0))
                   .build();
           OperationFuture<BatchUpdateIntentsResponse, Struct> future =
               intentsClient.batchUpdateIntentsOperationCallable().futureCall(request);
           // Do something.
           BatchUpdateIntentsResponse response = future.get();
         }
         
      • batchUpdateIntentsCallable

        public final com.google.api.gax.rpc.UnaryCallable<BatchUpdateIntentsRequest,​com.google.longrunning.Operation> batchUpdateIntentsCallable()
        Updates/Creates multiple intents in the specified agent.

        This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:

        - `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse]

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           BatchUpdateIntentsRequest request =
               BatchUpdateIntentsRequest.newBuilder()
                   .setParent(AgentName.ofProjectName("[PROJECT]").toString())
                   .setLanguageCode("languageCode-2092349083")
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .setIntentView(IntentView.forNumber(0))
                   .build();
           ApiFuture<Operation> future = intentsClient.batchUpdateIntentsCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • batchDeleteIntentsAsync

        public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,​com.google.protobuf.Struct> batchDeleteIntentsAsync​(AgentName parent,
                                                                                                                                                        List<Intent> intents)
        Deletes intents in the specified agent.

        This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:

        - `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           AgentName parent = AgentName.ofProjectName("[PROJECT]");
           List<Intent> intents = new ArrayList<>();
           intentsClient.batchDeleteIntentsAsync(parent, intents).get();
         }
         
        Parameters:
        parent - Required. The name of the agent to delete all entities types for. Supported formats:

        - `projects/<Project ID>/agent` - `projects/<Project ID>/locations/<Location ID>/agent`

        intents - Required. The collection of intents to delete. Only intent `name` must be filled in.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • batchDeleteIntentsAsync

        public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,​com.google.protobuf.Struct> batchDeleteIntentsAsync​(String parent,
                                                                                                                                                        List<Intent> intents)
        Deletes intents in the specified agent.

        This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:

        - `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           String parent = AgentName.ofProjectName("[PROJECT]").toString();
           List<Intent> intents = new ArrayList<>();
           intentsClient.batchDeleteIntentsAsync(parent, intents).get();
         }
         
        Parameters:
        parent - Required. The name of the agent to delete all entities types for. Supported formats:

        - `projects/<Project ID>/agent` - `projects/<Project ID>/locations/<Location ID>/agent`

        intents - Required. The collection of intents to delete. Only intent `name` must be filled in.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • batchDeleteIntentsAsync

        public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,​com.google.protobuf.Struct> batchDeleteIntentsAsync​(BatchDeleteIntentsRequest request)
        Deletes intents in the specified agent.

        This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:

        - `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           BatchDeleteIntentsRequest request =
               BatchDeleteIntentsRequest.newBuilder()
                   .setParent(AgentName.ofProjectName("[PROJECT]").toString())
                   .addAllIntents(new ArrayList<Intent>())
                   .build();
           intentsClient.batchDeleteIntentsAsync(request).get();
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • batchDeleteIntentsOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<BatchDeleteIntentsRequest,​com.google.protobuf.Empty,​com.google.protobuf.Struct> batchDeleteIntentsOperationCallable()
        Deletes intents in the specified agent.

        This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:

        - `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           BatchDeleteIntentsRequest request =
               BatchDeleteIntentsRequest.newBuilder()
                   .setParent(AgentName.ofProjectName("[PROJECT]").toString())
                   .addAllIntents(new ArrayList<Intent>())
                   .build();
           OperationFuture<Empty, Struct> future =
               intentsClient.batchDeleteIntentsOperationCallable().futureCall(request);
           // Do something.
           future.get();
         }
         
      • batchDeleteIntentsCallable

        public final com.google.api.gax.rpc.UnaryCallable<BatchDeleteIntentsRequest,​com.google.longrunning.Operation> batchDeleteIntentsCallable()
        Deletes intents in the specified agent.

        This method is a [long-running operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations). The returned `Operation` type has the following method-specific fields:

        - `metadata`: An empty [Struct message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct) - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

        Note: You should always train an agent prior to sending it queries. See the [training documentation](https://cloud.google.com/dialogflow/es/docs/training).

        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 (IntentsClient intentsClient = IntentsClient.create()) {
           BatchDeleteIntentsRequest request =
               BatchDeleteIntentsRequest.newBuilder()
                   .setParent(AgentName.ofProjectName("[PROJECT]").toString())
                   .addAllIntents(new ArrayList<Intent>())
                   .build();
           ApiFuture<Operation> future = intentsClient.batchDeleteIntentsCallable().futureCall(request);
           // Do something.
           future.get();
         }
         
      • listLocations

        public final IntentsClient.ListLocationsPagedResponse listLocations​(com.google.cloud.location.ListLocationsRequest request)
        Lists information about the supported locations for this service.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (IntentsClient intentsClient = IntentsClient.create()) {
           ListLocationsRequest request =
               ListLocationsRequest.newBuilder()
                   .setName("name3373707")
                   .setFilter("filter-1274492040")
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           for (Location element : intentsClient.listLocations(request).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listLocationsPagedCallable

        public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,​IntentsClient.ListLocationsPagedResponse> listLocationsPagedCallable()
        Lists information about the supported locations for this service.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (IntentsClient intentsClient = IntentsClient.create()) {
           ListLocationsRequest request =
               ListLocationsRequest.newBuilder()
                   .setName("name3373707")
                   .setFilter("filter-1274492040")
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           ApiFuture<Location> future = intentsClient.listLocationsPagedCallable().futureCall(request);
           // Do something.
           for (Location element : future.get().iterateAll()) {
             // doThingsWith(element);
           }
         }
         
      • listLocationsCallable

        public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,​com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
        Lists information about the supported locations for this service.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (IntentsClient intentsClient = IntentsClient.create()) {
           ListLocationsRequest request =
               ListLocationsRequest.newBuilder()
                   .setName("name3373707")
                   .setFilter("filter-1274492040")
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           while (true) {
             ListLocationsResponse response = intentsClient.listLocationsCallable().call(request);
             for (Location element : response.getLocationsList()) {
               // doThingsWith(element);
             }
             String nextPageToken = response.getNextPageToken();
             if (!Strings.isNullOrEmpty(nextPageToken)) {
               request = request.toBuilder().setPageToken(nextPageToken).build();
             } else {
               break;
             }
           }
         }
         
      • getLocation

        public final com.google.cloud.location.Location getLocation​(com.google.cloud.location.GetLocationRequest request)
        Gets information about a location.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (IntentsClient intentsClient = IntentsClient.create()) {
           GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
           Location response = intentsClient.getLocation(request);
         }
         
        Parameters:
        request - The request object containing all of the parameters for the API call.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getLocationCallable

        public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,​com.google.cloud.location.Location> getLocationCallable()
        Gets information about a location.

        Sample code:

        
         // This snippet has been automatically generated and should be regarded as a code template only.
         // It will require modifications to work:
         // - It may require correct/in-range values for request initialization.
         // - It may require specifying regional endpoints when creating the service client as shown in
         // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
         try (IntentsClient intentsClient = IntentsClient.create()) {
           GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
           ApiFuture<Location> future = intentsClient.getLocationCallable().futureCall(request);
           // Do something.
           Location response = future.get();
         }
         
      • shutdown

        public void shutdown()
        Specified by:
        shutdown in interface com.google.api.gax.core.BackgroundResource
      • isShutdown

        public boolean isShutdown()
        Specified by:
        isShutdown in interface com.google.api.gax.core.BackgroundResource
      • isTerminated

        public boolean isTerminated()
        Specified by:
        isTerminated in interface com.google.api.gax.core.BackgroundResource
      • shutdownNow

        public void shutdownNow()
        Specified by:
        shutdownNow in interface com.google.api.gax.core.BackgroundResource