Class ConversationModelsClient

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

    @Generated("by gapic-generator-java")
    public class ConversationModelsClient
    extends Object
    implements com.google.api.gax.core.BackgroundResource
    Service Description: Manages a collection of models for human agent assistant.

    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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
       String name = "name3373707";
       ConversationModel response = conversationModelsClient.getConversationModel(name);
     }
     

    Note: close() needs to be called on the ConversationModelsClient 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 ConversationModelsSettings 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
     ConversationModelsSettings conversationModelsSettings =
         ConversationModelsSettings.newBuilder()
             .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
             .build();
     ConversationModelsClient conversationModelsClient =
         ConversationModelsClient.create(conversationModelsSettings);
     

    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
     ConversationModelsSettings conversationModelsSettings =
         ConversationModelsSettings.newBuilder().setEndpoint(myEndpoint).build();
     ConversationModelsClient conversationModelsClient =
         ConversationModelsClient.create(conversationModelsSettings);
     

    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
     ConversationModelsSettings conversationModelsSettings =
         ConversationModelsSettings.newHttpJsonBuilder().build();
     ConversationModelsClient conversationModelsClient =
         ConversationModelsClient.create(conversationModelsSettings);
     

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

    • Constructor Detail

      • ConversationModelsClient

        protected ConversationModelsClient​(ConversationModelsSettings settings)
                                    throws IOException
        Constructs an instance of ConversationModelsClient, 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 ConversationModelsClient create​(ConversationModelsStub stub)
        Constructs an instance of ConversationModelsClient, using the given stub for making calls. This is for advanced usage - prefer using create(ConversationModelsSettings).
      • 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.
      • createConversationModelAsync

        public final com.google.api.gax.longrunning.OperationFuture<ConversationModel,​CreateConversationModelOperationMetadata> createConversationModelAsync​(String parent,
                                                                                                                                                                   ConversationModel conversationModel)
        Creates a model.

        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`: [CreateConversationModelOperationMetadata][google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata] - `response`: [ConversationModel][google.cloud.dialogflow.v2.ConversationModel]

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           String parent = "parent-995424086";
           ConversationModel conversationModel = ConversationModel.newBuilder().build();
           ConversationModel response =
               conversationModelsClient.createConversationModelAsync(parent, conversationModel).get();
         }
         
        Parameters:
        parent - The project to create conversation model for. Format: `projects/<Project ID>`
        conversationModel - Required. The conversation model to create.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createConversationModelAsync

        public final com.google.api.gax.longrunning.OperationFuture<ConversationModel,​CreateConversationModelOperationMetadata> createConversationModelAsync​(CreateConversationModelRequest request)
        Creates a model.

        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`: [CreateConversationModelOperationMetadata][google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata] - `response`: [ConversationModel][google.cloud.dialogflow.v2.ConversationModel]

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           CreateConversationModelRequest request =
               CreateConversationModelRequest.newBuilder()
                   .setParent("parent-995424086")
                   .setConversationModel(ConversationModel.newBuilder().build())
                   .build();
           ConversationModel response =
               conversationModelsClient.createConversationModelAsync(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
      • createConversationModelOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<CreateConversationModelRequest,​ConversationModel,​CreateConversationModelOperationMetadata> createConversationModelOperationCallable()
        Creates a model.

        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`: [CreateConversationModelOperationMetadata][google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata] - `response`: [ConversationModel][google.cloud.dialogflow.v2.ConversationModel]

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           CreateConversationModelRequest request =
               CreateConversationModelRequest.newBuilder()
                   .setParent("parent-995424086")
                   .setConversationModel(ConversationModel.newBuilder().build())
                   .build();
           OperationFuture<ConversationModel, CreateConversationModelOperationMetadata> future =
               conversationModelsClient.createConversationModelOperationCallable().futureCall(request);
           // Do something.
           ConversationModel response = future.get();
         }
         
      • createConversationModelCallable

        public final com.google.api.gax.rpc.UnaryCallable<CreateConversationModelRequest,​com.google.longrunning.Operation> createConversationModelCallable()
        Creates a model.

        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`: [CreateConversationModelOperationMetadata][google.cloud.dialogflow.v2.CreateConversationModelOperationMetadata] - `response`: [ConversationModel][google.cloud.dialogflow.v2.ConversationModel]

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           CreateConversationModelRequest request =
               CreateConversationModelRequest.newBuilder()
                   .setParent("parent-995424086")
                   .setConversationModel(ConversationModel.newBuilder().build())
                   .build();
           ApiFuture<Operation> future =
               conversationModelsClient.createConversationModelCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • getConversationModel

        public final ConversationModel getConversationModel​(String name)
        Gets conversation model.

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           String name = "name3373707";
           ConversationModel response = conversationModelsClient.getConversationModel(name);
         }
         
        Parameters:
        name - Required. The conversation model to retrieve. Format: `projects/<Project ID>/conversationModels/<Conversation Model ID>`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getConversationModel

        public final ConversationModel getConversationModel​(GetConversationModelRequest request)
        Gets conversation model.

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           GetConversationModelRequest request =
               GetConversationModelRequest.newBuilder().setName("name3373707").build();
           ConversationModel response = conversationModelsClient.getConversationModel(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
      • getConversationModelCallable

        public final com.google.api.gax.rpc.UnaryCallable<GetConversationModelRequest,​ConversationModel> getConversationModelCallable()
        Gets conversation model.

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           GetConversationModelRequest request =
               GetConversationModelRequest.newBuilder().setName("name3373707").build();
           ApiFuture<ConversationModel> future =
               conversationModelsClient.getConversationModelCallable().futureCall(request);
           // Do something.
           ConversationModel response = future.get();
         }
         
      • listConversationModels

        public final ConversationModelsClient.ListConversationModelsPagedResponse listConversationModels​(String parent)
        Lists conversation models.

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           String parent = "parent-995424086";
           for (ConversationModel element :
               conversationModelsClient.listConversationModels(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The project to list all conversation models for. Format: `projects/<Project ID>`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listConversationModels

        public final ConversationModelsClient.ListConversationModelsPagedResponse listConversationModels​(ListConversationModelsRequest request)
        Lists conversation models.

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           ListConversationModelsRequest request =
               ListConversationModelsRequest.newBuilder()
                   .setParent("parent-995424086")
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           for (ConversationModel element :
               conversationModelsClient.listConversationModels(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
      • listConversationModelsPagedCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListConversationModelsRequest,​ConversationModelsClient.ListConversationModelsPagedResponse> listConversationModelsPagedCallable()
        Lists conversation models.

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           ListConversationModelsRequest request =
               ListConversationModelsRequest.newBuilder()
                   .setParent("parent-995424086")
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           ApiFuture<ConversationModel> future =
               conversationModelsClient.listConversationModelsPagedCallable().futureCall(request);
           // Do something.
           for (ConversationModel element : future.get().iterateAll()) {
             // doThingsWith(element);
           }
         }
         
      • listConversationModelsCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListConversationModelsRequest,​ListConversationModelsResponse> listConversationModelsCallable()
        Lists conversation models.

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           ListConversationModelsRequest request =
               ListConversationModelsRequest.newBuilder()
                   .setParent("parent-995424086")
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           while (true) {
             ListConversationModelsResponse response =
                 conversationModelsClient.listConversationModelsCallable().call(request);
             for (ConversationModel element : response.getConversationModelsList()) {
               // doThingsWith(element);
             }
             String nextPageToken = response.getNextPageToken();
             if (!Strings.isNullOrEmpty(nextPageToken)) {
               request = request.toBuilder().setPageToken(nextPageToken).build();
             } else {
               break;
             }
           }
         }
         
      • deleteConversationModelAsync

        public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,​DeleteConversationModelOperationMetadata> deleteConversationModelAsync​(String name)
        Deletes a model.

        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`: [DeleteConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationModelOperationMetadata] - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           String name = "name3373707";
           conversationModelsClient.deleteConversationModelAsync(name).get();
         }
         
        Parameters:
        name - Required. The conversation model to delete. Format: `projects/<Project ID>/conversationModels/<Conversation Model ID>`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • deleteConversationModelAsync

        public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,​DeleteConversationModelOperationMetadata> deleteConversationModelAsync​(DeleteConversationModelRequest request)
        Deletes a model.

        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`: [DeleteConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationModelOperationMetadata] - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           DeleteConversationModelRequest request =
               DeleteConversationModelRequest.newBuilder().setName("name3373707").build();
           conversationModelsClient.deleteConversationModelAsync(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
      • deleteConversationModelOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<DeleteConversationModelRequest,​com.google.protobuf.Empty,​DeleteConversationModelOperationMetadata> deleteConversationModelOperationCallable()
        Deletes a model.

        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`: [DeleteConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationModelOperationMetadata] - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           DeleteConversationModelRequest request =
               DeleteConversationModelRequest.newBuilder().setName("name3373707").build();
           OperationFuture<Empty, DeleteConversationModelOperationMetadata> future =
               conversationModelsClient.deleteConversationModelOperationCallable().futureCall(request);
           // Do something.
           future.get();
         }
         
      • deleteConversationModelCallable

        public final com.google.api.gax.rpc.UnaryCallable<DeleteConversationModelRequest,​com.google.longrunning.Operation> deleteConversationModelCallable()
        Deletes a model.

        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`: [DeleteConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeleteConversationModelOperationMetadata] - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           DeleteConversationModelRequest request =
               DeleteConversationModelRequest.newBuilder().setName("name3373707").build();
           ApiFuture<Operation> future =
               conversationModelsClient.deleteConversationModelCallable().futureCall(request);
           // Do something.
           future.get();
         }
         
      • deployConversationModelAsync

        public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,​DeployConversationModelOperationMetadata> deployConversationModelAsync​(DeployConversationModelRequest request)
        Deploys a model. If a model is already deployed, deploying it has no effect. A model can only serve prediction requests after it gets deployed. For article suggestion, custom model will not be used unless it is deployed.

        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`: [DeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeployConversationModelOperationMetadata] - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           DeployConversationModelRequest request =
               DeployConversationModelRequest.newBuilder().setName("name3373707").build();
           conversationModelsClient.deployConversationModelAsync(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
      • deployConversationModelOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<DeployConversationModelRequest,​com.google.protobuf.Empty,​DeployConversationModelOperationMetadata> deployConversationModelOperationCallable()
        Deploys a model. If a model is already deployed, deploying it has no effect. A model can only serve prediction requests after it gets deployed. For article suggestion, custom model will not be used unless it is deployed.

        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`: [DeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeployConversationModelOperationMetadata] - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           DeployConversationModelRequest request =
               DeployConversationModelRequest.newBuilder().setName("name3373707").build();
           OperationFuture<Empty, DeployConversationModelOperationMetadata> future =
               conversationModelsClient.deployConversationModelOperationCallable().futureCall(request);
           // Do something.
           future.get();
         }
         
      • deployConversationModelCallable

        public final com.google.api.gax.rpc.UnaryCallable<DeployConversationModelRequest,​com.google.longrunning.Operation> deployConversationModelCallable()
        Deploys a model. If a model is already deployed, deploying it has no effect. A model can only serve prediction requests after it gets deployed. For article suggestion, custom model will not be used unless it is deployed.

        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`: [DeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.DeployConversationModelOperationMetadata] - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           DeployConversationModelRequest request =
               DeployConversationModelRequest.newBuilder().setName("name3373707").build();
           ApiFuture<Operation> future =
               conversationModelsClient.deployConversationModelCallable().futureCall(request);
           // Do something.
           future.get();
         }
         
      • undeployConversationModelAsync

        public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,​UndeployConversationModelOperationMetadata> undeployConversationModelAsync​(UndeployConversationModelRequest request)
        Undeploys a model. If the model is not deployed this method has no effect. If the model is currently being used: - For article suggestion, article suggestion will fallback to the default model if model is undeployed.

        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`: [UndeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.UndeployConversationModelOperationMetadata] - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           UndeployConversationModelRequest request =
               UndeployConversationModelRequest.newBuilder().setName("name3373707").build();
           conversationModelsClient.undeployConversationModelAsync(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
      • undeployConversationModelOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<UndeployConversationModelRequest,​com.google.protobuf.Empty,​UndeployConversationModelOperationMetadata> undeployConversationModelOperationCallable()
        Undeploys a model. If the model is not deployed this method has no effect. If the model is currently being used: - For article suggestion, article suggestion will fallback to the default model if model is undeployed.

        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`: [UndeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.UndeployConversationModelOperationMetadata] - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           UndeployConversationModelRequest request =
               UndeployConversationModelRequest.newBuilder().setName("name3373707").build();
           OperationFuture<Empty, UndeployConversationModelOperationMetadata> future =
               conversationModelsClient.undeployConversationModelOperationCallable().futureCall(request);
           // Do something.
           future.get();
         }
         
      • undeployConversationModelCallable

        public final com.google.api.gax.rpc.UnaryCallable<UndeployConversationModelRequest,​com.google.longrunning.Operation> undeployConversationModelCallable()
        Undeploys a model. If the model is not deployed this method has no effect. If the model is currently being used: - For article suggestion, article suggestion will fallback to the default model if model is undeployed.

        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`: [UndeployConversationModelOperationMetadata][google.cloud.dialogflow.v2.UndeployConversationModelOperationMetadata] - `response`: An [Empty message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           UndeployConversationModelRequest request =
               UndeployConversationModelRequest.newBuilder().setName("name3373707").build();
           ApiFuture<Operation> future =
               conversationModelsClient.undeployConversationModelCallable().futureCall(request);
           // Do something.
           future.get();
         }
         
      • getConversationModelEvaluation

        public final ConversationModelEvaluation getConversationModelEvaluation​(String name)
        Gets an evaluation of conversation model.

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           String name = "name3373707";
           ConversationModelEvaluation response =
               conversationModelsClient.getConversationModelEvaluation(name);
         }
         
        Parameters:
        name - Required. The conversation model evaluation resource name. Format: `projects/<Project ID>/conversationModels/<Conversation Model ID>/evaluations/<Evaluation ID>`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • getConversationModelEvaluation

        public final ConversationModelEvaluation getConversationModelEvaluation​(GetConversationModelEvaluationRequest request)
        Gets an evaluation of conversation model.

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           GetConversationModelEvaluationRequest request =
               GetConversationModelEvaluationRequest.newBuilder().setName("name3373707").build();
           ConversationModelEvaluation response =
               conversationModelsClient.getConversationModelEvaluation(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
      • getConversationModelEvaluationCallable

        public final com.google.api.gax.rpc.UnaryCallable<GetConversationModelEvaluationRequest,​ConversationModelEvaluation> getConversationModelEvaluationCallable()
        Gets an evaluation of conversation model.

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           GetConversationModelEvaluationRequest request =
               GetConversationModelEvaluationRequest.newBuilder().setName("name3373707").build();
           ApiFuture<ConversationModelEvaluation> future =
               conversationModelsClient.getConversationModelEvaluationCallable().futureCall(request);
           // Do something.
           ConversationModelEvaluation response = future.get();
         }
         
      • listConversationModelEvaluations

        public final ConversationModelsClient.ListConversationModelEvaluationsPagedResponse listConversationModelEvaluations​(String parent)
        Lists evaluations of a conversation model.

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           String parent = "parent-995424086";
           for (ConversationModelEvaluation element :
               conversationModelsClient.listConversationModelEvaluations(parent).iterateAll()) {
             // doThingsWith(element);
           }
         }
         
        Parameters:
        parent - Required. The conversation model resource name. Format: `projects/<Project ID>/conversationModels/<Conversation Model ID>`
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • listConversationModelEvaluations

        public final ConversationModelsClient.ListConversationModelEvaluationsPagedResponse listConversationModelEvaluations​(ListConversationModelEvaluationsRequest request)
        Lists evaluations of a conversation model.

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           ListConversationModelEvaluationsRequest request =
               ListConversationModelEvaluationsRequest.newBuilder()
                   .setParent("parent-995424086")
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           for (ConversationModelEvaluation element :
               conversationModelsClient.listConversationModelEvaluations(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
      • listConversationModelEvaluationsPagedCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListConversationModelEvaluationsRequest,​ConversationModelsClient.ListConversationModelEvaluationsPagedResponse> listConversationModelEvaluationsPagedCallable()
        Lists evaluations of a conversation model.

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           ListConversationModelEvaluationsRequest request =
               ListConversationModelEvaluationsRequest.newBuilder()
                   .setParent("parent-995424086")
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           ApiFuture<ConversationModelEvaluation> future =
               conversationModelsClient
                   .listConversationModelEvaluationsPagedCallable()
                   .futureCall(request);
           // Do something.
           for (ConversationModelEvaluation element : future.get().iterateAll()) {
             // doThingsWith(element);
           }
         }
         
      • listConversationModelEvaluationsCallable

        public final com.google.api.gax.rpc.UnaryCallable<ListConversationModelEvaluationsRequest,​ListConversationModelEvaluationsResponse> listConversationModelEvaluationsCallable()
        Lists evaluations of a conversation model.

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           ListConversationModelEvaluationsRequest request =
               ListConversationModelEvaluationsRequest.newBuilder()
                   .setParent("parent-995424086")
                   .setPageSize(883849137)
                   .setPageToken("pageToken873572522")
                   .build();
           while (true) {
             ListConversationModelEvaluationsResponse response =
                 conversationModelsClient.listConversationModelEvaluationsCallable().call(request);
             for (ConversationModelEvaluation element : response.getConversationModelEvaluationsList()) {
               // doThingsWith(element);
             }
             String nextPageToken = response.getNextPageToken();
             if (!Strings.isNullOrEmpty(nextPageToken)) {
               request = request.toBuilder().setPageToken(nextPageToken).build();
             } else {
               break;
             }
           }
         }
         
      • createConversationModelEvaluationAsync

        public final com.google.api.gax.longrunning.OperationFuture<ConversationModelEvaluation,​CreateConversationModelEvaluationOperationMetadata> createConversationModelEvaluationAsync​(ConversationModelName parent,
                                                                                                                                                                                                 ConversationModelEvaluation conversationModelEvaluation)
        Creates evaluation of a conversation model.

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           ConversationModelName parent =
               ConversationModelName.ofProjectLocationConversationModelName(
                   "[PROJECT]", "[LOCATION]", "[CONVERSATION_MODEL]");
           ConversationModelEvaluation conversationModelEvaluation =
               ConversationModelEvaluation.newBuilder().build();
           ConversationModelEvaluation response =
               conversationModelsClient
                   .createConversationModelEvaluationAsync(parent, conversationModelEvaluation)
                   .get();
         }
         
        Parameters:
        parent - Required. The conversation model resource name. Format: `projects/<Project ID>/locations/<Location ID>/conversationModels/<Conversation Model ID>`
        conversationModelEvaluation - Required. The conversation model evaluation to be created.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createConversationModelEvaluationAsync

        public final com.google.api.gax.longrunning.OperationFuture<ConversationModelEvaluation,​CreateConversationModelEvaluationOperationMetadata> createConversationModelEvaluationAsync​(String parent,
                                                                                                                                                                                                 ConversationModelEvaluation conversationModelEvaluation)
        Creates evaluation of a conversation model.

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           String parent =
               ConversationModelName.ofProjectLocationConversationModelName(
                       "[PROJECT]", "[LOCATION]", "[CONVERSATION_MODEL]")
                   .toString();
           ConversationModelEvaluation conversationModelEvaluation =
               ConversationModelEvaluation.newBuilder().build();
           ConversationModelEvaluation response =
               conversationModelsClient
                   .createConversationModelEvaluationAsync(parent, conversationModelEvaluation)
                   .get();
         }
         
        Parameters:
        parent - Required. The conversation model resource name. Format: `projects/<Project ID>/locations/<Location ID>/conversationModels/<Conversation Model ID>`
        conversationModelEvaluation - Required. The conversation model evaluation to be created.
        Throws:
        com.google.api.gax.rpc.ApiException - if the remote call fails
      • createConversationModelEvaluationAsync

        public final com.google.api.gax.longrunning.OperationFuture<ConversationModelEvaluation,​CreateConversationModelEvaluationOperationMetadata> createConversationModelEvaluationAsync​(CreateConversationModelEvaluationRequest request)
        Creates evaluation of a conversation model.

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           CreateConversationModelEvaluationRequest request =
               CreateConversationModelEvaluationRequest.newBuilder()
                   .setParent(
                       ConversationModelName.ofProjectLocationConversationModelName(
                               "[PROJECT]", "[LOCATION]", "[CONVERSATION_MODEL]")
                           .toString())
                   .setConversationModelEvaluation(ConversationModelEvaluation.newBuilder().build())
                   .build();
           ConversationModelEvaluation response =
               conversationModelsClient.createConversationModelEvaluationAsync(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
      • createConversationModelEvaluationOperationCallable

        public final com.google.api.gax.rpc.OperationCallable<CreateConversationModelEvaluationRequest,​ConversationModelEvaluation,​CreateConversationModelEvaluationOperationMetadata> createConversationModelEvaluationOperationCallable()
        Creates evaluation of a conversation model.

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           CreateConversationModelEvaluationRequest request =
               CreateConversationModelEvaluationRequest.newBuilder()
                   .setParent(
                       ConversationModelName.ofProjectLocationConversationModelName(
                               "[PROJECT]", "[LOCATION]", "[CONVERSATION_MODEL]")
                           .toString())
                   .setConversationModelEvaluation(ConversationModelEvaluation.newBuilder().build())
                   .build();
           OperationFuture<
                   ConversationModelEvaluation, CreateConversationModelEvaluationOperationMetadata>
               future =
                   conversationModelsClient
                       .createConversationModelEvaluationOperationCallable()
                       .futureCall(request);
           // Do something.
           ConversationModelEvaluation response = future.get();
         }
         
      • createConversationModelEvaluationCallable

        public final com.google.api.gax.rpc.UnaryCallable<CreateConversationModelEvaluationRequest,​com.google.longrunning.Operation> createConversationModelEvaluationCallable()
        Creates evaluation of a conversation model.

        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 (ConversationModelsClient conversationModelsClient = ConversationModelsClient.create()) {
           CreateConversationModelEvaluationRequest request =
               CreateConversationModelEvaluationRequest.newBuilder()
                   .setParent(
                       ConversationModelName.ofProjectLocationConversationModelName(
                               "[PROJECT]", "[LOCATION]", "[CONVERSATION_MODEL]")
                           .toString())
                   .setConversationModelEvaluation(ConversationModelEvaluation.newBuilder().build())
                   .build();
           ApiFuture<Operation> future =
               conversationModelsClient.createConversationModelEvaluationCallable().futureCall(request);
           // Do something.
           Operation response = future.get();
         }
         
      • listLocations

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