Class SessionEntityTypesClient

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

    @Generated("by gapic-generator-java")
    public class SessionEntityTypesClient
    extends Object
    implements com.google.api.gax.core.BackgroundResource
    Service Description: Service for managing [SessionEntityTypes][google.cloud.dialogflow.v2.SessionEntityType].

    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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
       SessionEntityTypeName name =
           SessionEntityTypeName.ofProjectSessionEntityTypeName(
               "[PROJECT]", "[SESSION]", "[ENTITY_TYPE]");
       SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name);
     }
     

    Note: close() needs to be called on the SessionEntityTypesClient 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 SessionEntityTypesSettings 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
     SessionEntityTypesSettings sessionEntityTypesSettings =
         SessionEntityTypesSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     SessionEntityTypesClient sessionEntityTypesClient =
         SessionEntityTypesClient.create(sessionEntityTypesSettings);
     

    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
     SessionEntityTypesSettings sessionEntityTypesSettings =
         SessionEntityTypesSettings.newBuilder().setEndpoint(myEndpoint).build();
     SessionEntityTypesClient sessionEntityTypesClient =
         SessionEntityTypesClient.create(sessionEntityTypesSettings);
     

    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
     SessionEntityTypesSettings sessionEntityTypesSettings =
         SessionEntityTypesSettings.newHttpJsonBuilder().build();
     SessionEntityTypesClient sessionEntityTypesClient =
         SessionEntityTypesClient.create(sessionEntityTypesSettings);
     

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

    • Constructor Detail

      • SessionEntityTypesClient

        protected SessionEntityTypesClient​(SessionEntityTypesSettings settings)
                                    throws IOException
        Constructs an instance of SessionEntityTypesClient, 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
    • Method Detail

      • create

        public static final SessionEntityTypesClient create​(SessionEntityTypesStub stub)
        Constructs an instance of SessionEntityTypesClient, using the given stub for making calls. This is for advanced usage - prefer using create(SessionEntityTypesSettings).
      • listSessionEntityTypes

        public final SessionEntityTypesClient.ListSessionEntityTypesPagedResponse listSessionEntityTypes​(SessionName parent)
        Returns the list of all session entity types in the specified session.

        This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

        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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           SessionName parent = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]");
           for (SessionEntityType element :
               sessionEntityTypesClient.listSessionEntityTypes(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The session to list all session entity types from. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/ sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listSessionEntityTypes

        public final SessionEntityTypesClient.ListSessionEntityTypesPagedResponse listSessionEntityTypes​(String parent)
        Returns the list of all session entity types in the specified session.

        This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

        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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           String parent = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]").toString();
           for (SessionEntityType element :
               sessionEntityTypesClient.listSessionEntityTypes(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The session to list all session entity types from. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/ sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listSessionEntityTypes

        public final SessionEntityTypesClient.ListSessionEntityTypesPagedResponse listSessionEntityTypes​(ListSessionEntityTypesRequest request)
        Returns the list of all session entity types in the specified session.

        This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

        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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           ListSessionEntityTypesRequest request =
               ListSessionEntityTypesRequest.newBuilder()
                   .setParent(SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           for (SessionEntityType element :
               sessionEntityTypesClient.listSessionEntityTypes(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
      • listSessionEntityTypesPagedCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListSessionEntityTypesRequest,​SessionEntityTypesClient.ListSessionEntityTypesPagedResponse> listSessionEntityTypesPagedCallable()
        Returns the list of all session entity types in the specified session.

        This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

        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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           ListSessionEntityTypesRequest request =
               ListSessionEntityTypesRequest.newBuilder()
                   .setParent(SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           ApiFuture<SessionEntityType> future =
               sessionEntityTypesClient.listSessionEntityTypesPagedCallable().futureCall(request);
           // Do something.
           for (SessionEntityType element : future.get().iterateAll()) {
             // doThingsWith(element);
           }
         }
         
      • listSessionEntityTypesCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListSessionEntityTypesRequest,​ListSessionEntityTypesResponse> listSessionEntityTypesCallable()
        Returns the list of all session entity types in the specified session.

        This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

        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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           ListSessionEntityTypesRequest request =
               ListSessionEntityTypesRequest.newBuilder()
                   .setParent(SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]").toString())
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           while (true) {
             ListSessionEntityTypesResponse response =
                 sessionEntityTypesClient.listSessionEntityTypesCallable().call(request);
             for (SessionEntityType element : response.getSessionEntityTypesList()) {
               // doThingsWith(element);
             }
             String nextPageToken = response.getNextPageToken();
             if (!Strings.isNullOrEmpty(nextPageToken)) {
               request = request.toBuilder().setPageToken(nextPageToken).build();
             } else {
               break;
             }
           }
         }
         
      • getSessionEntityType

        public final SessionEntityType getSessionEntityType​(SessionEntityTypeName name)
        Retrieves the specified session entity type.

        This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

        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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           SessionEntityTypeName name =
               SessionEntityTypeName.ofProjectSessionEntityTypeName(
                   "[PROJECT]", "[SESSION]", "[ENTITY_TYPE]");
           SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name);
         }
         
        Parameters:
        name - Required. The name of the session entity type. Format: `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type Display Name>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getSessionEntityType

        public final SessionEntityType getSessionEntityType​(String name)
        Retrieves the specified session entity type.

        This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

        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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           String name =
               SessionEntityTypeName.ofProjectSessionEntityTypeName(
                       "[PROJECT]", "[SESSION]", "[ENTITY_TYPE]")
                   .toString();
           SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(name);
         }
         
        Parameters:
        name - Required. The name of the session entity type. Format: `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type Display Name>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getSessionEntityType

        public final SessionEntityType getSessionEntityType​(GetSessionEntityTypeRequest request)
        Retrieves the specified session entity type.

        This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

        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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           GetSessionEntityTypeRequest request =
               GetSessionEntityTypeRequest.newBuilder()
                   .setName(
                       SessionEntityTypeName.ofProjectSessionEntityTypeName(
                               "[PROJECT]", "[SESSION]", "[ENTITY_TYPE]")
                           .toString())
                   .build();
           SessionEntityType response = sessionEntityTypesClient.getSessionEntityType(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
      • getSessionEntityTypeCallable

        public final com.google.api.gax.rpc.UnaryCallable<GetSessionEntityTypeRequest,​SessionEntityType> getSessionEntityTypeCallable()
        Retrieves the specified session entity type.

        This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

        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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           GetSessionEntityTypeRequest request =
               GetSessionEntityTypeRequest.newBuilder()
                   .setName(
                       SessionEntityTypeName.ofProjectSessionEntityTypeName(
                               "[PROJECT]", "[SESSION]", "[ENTITY_TYPE]")
                           .toString())
                   .build();
           ApiFuture<SessionEntityType> future =
               sessionEntityTypesClient.getSessionEntityTypeCallable().futureCall(request);
           // Do something.
           SessionEntityType response = future.get();
         }
         
      • createSessionEntityType

        public final SessionEntityType createSessionEntityType​(SessionName parent,
                                                               SessionEntityType sessionEntityType)
        Creates a session entity type.

        If the specified session entity type already exists, overrides the session entity type.

        This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

        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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           SessionName parent = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]");
           SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
           SessionEntityType response =
               sessionEntityTypesClient.createSessionEntityType(parent, sessionEntityType);
         }
         
        Parameters:
        parent - Required. The session to create a session entity type for. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/ sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
        sessionEntityType - Required. The session entity type to create.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createSessionEntityType

        public final SessionEntityType createSessionEntityType​(String parent,
                                                               SessionEntityType sessionEntityType)
        Creates a session entity type.

        If the specified session entity type already exists, overrides the session entity type.

        This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

        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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           String parent = SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]").toString();
           SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
           SessionEntityType response =
               sessionEntityTypesClient.createSessionEntityType(parent, sessionEntityType);
         }
         
        Parameters:
        parent - Required. The session to create a session entity type for. Format: `projects/<Project ID>/agent/sessions/<Session ID>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/ sessions/<Session ID>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
        sessionEntityType - Required. The session entity type to create.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createSessionEntityType

        public final SessionEntityType createSessionEntityType​(CreateSessionEntityTypeRequest request)
        Creates a session entity type.

        If the specified session entity type already exists, overrides the session entity type.

        This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

        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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           CreateSessionEntityTypeRequest request =
               CreateSessionEntityTypeRequest.newBuilder()
                   .setParent(SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]").toString())
                   .setSessionEntityType(SessionEntityType.newBuilder().build())
                   .build();
           SessionEntityType response = sessionEntityTypesClient.createSessionEntityType(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
      • createSessionEntityTypeCallable

        public final com.google.api.gax.rpc.UnaryCallable<CreateSessionEntityTypeRequest,​SessionEntityType> createSessionEntityTypeCallable()
        Creates a session entity type.

        If the specified session entity type already exists, overrides the session entity type.

        This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

        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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           CreateSessionEntityTypeRequest request =
               CreateSessionEntityTypeRequest.newBuilder()
                   .setParent(SessionName.ofProjectSessionName("[PROJECT]", "[SESSION]").toString())
                   .setSessionEntityType(SessionEntityType.newBuilder().build())
                   .build();
           ApiFuture<SessionEntityType> future =
               sessionEntityTypesClient.createSessionEntityTypeCallable().futureCall(request);
           // Do something.
           SessionEntityType response = future.get();
         }
         
      • updateSessionEntityType

        public final SessionEntityType updateSessionEntityType​(SessionEntityType sessionEntityType)
        Updates the specified session entity type.

        This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

        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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
           SessionEntityType response =
               sessionEntityTypesClient.updateSessionEntityType(sessionEntityType);
         }
         
        Parameters:
        sessionEntityType - Required. The session entity type to update.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateSessionEntityType

        public final SessionEntityType updateSessionEntityType​(SessionEntityType sessionEntityType,
                                                               com.google.protobuf.FieldMask updateMask)
        Updates the specified session entity type.

        This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

        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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           SessionEntityType sessionEntityType = SessionEntityType.newBuilder().build();
           FieldMask updateMask = FieldMask.newBuilder().build();
           SessionEntityType response =
               sessionEntityTypesClient.updateSessionEntityType(sessionEntityType, updateMask);
         }
         
        Parameters:
        sessionEntityType - Required. The session entity type to update.
        updateMask - Optional. The mask to control which fields get updated.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • updateSessionEntityType

        public final SessionEntityType updateSessionEntityType​(UpdateSessionEntityTypeRequest request)
        Updates the specified session entity type.

        This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

        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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           UpdateSessionEntityTypeRequest request =
               UpdateSessionEntityTypeRequest.newBuilder()
                   .setSessionEntityType(SessionEntityType.newBuilder().build())
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .build();
           SessionEntityType response = sessionEntityTypesClient.updateSessionEntityType(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
      • updateSessionEntityTypeCallable

        public final com.google.api.gax.rpc.UnaryCallable<UpdateSessionEntityTypeRequest,​SessionEntityType> updateSessionEntityTypeCallable()
        Updates the specified session entity type.

        This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

        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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           UpdateSessionEntityTypeRequest request =
               UpdateSessionEntityTypeRequest.newBuilder()
                   .setSessionEntityType(SessionEntityType.newBuilder().build())
                   .setUpdateMask(FieldMask.newBuilder().build())
                   .build();
           ApiFuture<SessionEntityType> future =
               sessionEntityTypesClient.updateSessionEntityTypeCallable().futureCall(request);
           // Do something.
           SessionEntityType response = future.get();
         }
         
      • deleteSessionEntityType

        public final void deleteSessionEntityType​(SessionEntityTypeName name)
        Deletes the specified session entity type.

        This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

        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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           SessionEntityTypeName name =
               SessionEntityTypeName.ofProjectSessionEntityTypeName(
                   "[PROJECT]", "[SESSION]", "[ENTITY_TYPE]");
           sessionEntityTypesClient.deleteSessionEntityType(name);
         }
         
        Parameters:
        name - Required. The name of the entity type to delete. Format: `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type Display Name>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteSessionEntityType

        public final void deleteSessionEntityType​(String name)
        Deletes the specified session entity type.

        This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

        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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           String name =
               SessionEntityTypeName.ofProjectSessionEntityTypeName(
                       "[PROJECT]", "[SESSION]", "[ENTITY_TYPE]")
                   .toString();
           sessionEntityTypesClient.deleteSessionEntityType(name);
         }
         
        Parameters:
        name - Required. The name of the entity type to delete. Format: `projects/<Project ID>/agent/sessions/<Session ID>/entityTypes/<Entity Type Display Name>` or `projects/<Project ID>/agent/environments/<Environment ID>/users/<User ID>/sessions/<Session ID>/entityTypes/<Entity Type Display Name>`. If `Environment ID` is not specified, we assume default 'draft' environment. If `User ID` is not specified, we assume default '-' user.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteSessionEntityType

        public final void deleteSessionEntityType​(DeleteSessionEntityTypeRequest request)
        Deletes the specified session entity type.

        This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

        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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           DeleteSessionEntityTypeRequest request =
               DeleteSessionEntityTypeRequest.newBuilder()
                   .setName(
                       SessionEntityTypeName.ofProjectSessionEntityTypeName(
                               "[PROJECT]", "[SESSION]", "[ENTITY_TYPE]")
                           .toString())
                   .build();
           sessionEntityTypesClient.deleteSessionEntityType(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
      • deleteSessionEntityTypeCallable

        public final com.google.api.gax.rpc.UnaryCallable<DeleteSessionEntityTypeRequest,​com.google.protobuf.Empty> deleteSessionEntityTypeCallable()
        Deletes the specified session entity type.

        This method doesn't work with Google Assistant integration. Contact Dialogflow support if you need to use session entities with Google Assistant integration.

        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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           DeleteSessionEntityTypeRequest request =
               DeleteSessionEntityTypeRequest.newBuilder()
                   .setName(
                       SessionEntityTypeName.ofProjectSessionEntityTypeName(
                               "[PROJECT]", "[SESSION]", "[ENTITY_TYPE]")
                           .toString())
                   .build();
           ApiFuture<Empty> future =
               sessionEntityTypesClient.deleteSessionEntityTypeCallable().futureCall(request);
           // Do something.
           future.get();
         }
         
      • listLocations

        public final SessionEntityTypesClient.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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           ListLocationsRequest request =
               ListLocationsRequest.newBuilder()
                   .setName("name3373707")
                   .setFilter("filter-1274492040")
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           for (Location element : sessionEntityTypesClient.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,​SessionEntityTypesClient.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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           ListLocationsRequest request =
               ListLocationsRequest.newBuilder()
                   .setName("name3373707")
                   .setFilter("filter-1274492040")
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           ApiFuture<Location> future =
               sessionEntityTypesClient.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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           ListLocationsRequest request =
               ListLocationsRequest.newBuilder()
                   .setName("name3373707")
                   .setFilter("filter-1274492040")
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           while (true) {
             ListLocationsResponse response =
                 sessionEntityTypesClient.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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
           Location response = sessionEntityTypesClient.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 (SessionEntityTypesClient sessionEntityTypesClient = SessionEntityTypesClient.create()) {
           GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
           ApiFuture<Location> future =
               sessionEntityTypesClient.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