@Generated(value="by gapic-generator") @BetaApi public class DocumentsClient extends Object implements BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
DocumentName name = DocumentName.of("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]");
Document response = documentsClient.getDocument(name);
}
Note: close() needs to be called on the documentsClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of DocumentsSettings to create(). For example:
To customize credentials:
DocumentsSettings documentsSettings =
DocumentsSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
DocumentsClient documentsClient =
DocumentsClient.create(documentsSettings);
To customize the endpoint:
DocumentsSettings documentsSettings =
DocumentsSettings.newBuilder().setEndpoint(myEndpoint).build();
DocumentsClient documentsClient =
DocumentsClient.create(documentsSettings);
Modifier and Type | Class and Description |
---|---|
static class |
DocumentsClient.ListDocumentsFixedSizeCollection |
static class |
DocumentsClient.ListDocumentsPage |
static class |
DocumentsClient.ListDocumentsPagedResponse |
Modifier | Constructor and Description |
---|---|
protected |
DocumentsClient(DocumentsSettings settings)
Constructs an instance of DocumentsClient, using the given settings.
|
protected |
DocumentsClient(DocumentsStub stub) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static DocumentsClient |
create()
Constructs an instance of DocumentsClient with default settings.
|
static DocumentsClient |
create(DocumentsSettings settings)
Constructs an instance of DocumentsClient, using the given settings.
|
static DocumentsClient |
create(DocumentsStub stub)
Constructs an instance of DocumentsClient, using the given stub for making calls.
|
OperationFuture<com.google.cloud.dialogflow.v2beta1.Document,com.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata> |
createDocumentAsync(com.google.cloud.dialogflow.v2beta1.CreateDocumentRequest request)
Creates a new document.
|
OperationFuture<com.google.cloud.dialogflow.v2beta1.Document,com.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata> |
createDocumentAsync(com.google.cloud.dialogflow.v2beta1.KnowledgeBaseName parent,
com.google.cloud.dialogflow.v2beta1.Document document)
Creates a new document.
|
OperationFuture<com.google.cloud.dialogflow.v2beta1.Document,com.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata> |
createDocumentAsync(String parent,
com.google.cloud.dialogflow.v2beta1.Document document)
Creates a new document.
|
UnaryCallable<com.google.cloud.dialogflow.v2beta1.CreateDocumentRequest,Operation> |
createDocumentCallable()
Creates a new document.
|
OperationCallable<com.google.cloud.dialogflow.v2beta1.CreateDocumentRequest,com.google.cloud.dialogflow.v2beta1.Document,com.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata> |
createDocumentOperationCallable()
Creates a new document.
|
OperationFuture<Empty,com.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata> |
deleteDocumentAsync(com.google.cloud.dialogflow.v2beta1.DeleteDocumentRequest request)
Deletes the specified document.
|
OperationFuture<Empty,com.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata> |
deleteDocumentAsync(com.google.cloud.dialogflow.v2beta1.DocumentName name)
Deletes the specified document.
|
OperationFuture<Empty,com.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata> |
deleteDocumentAsync(String name)
Deletes the specified document.
|
UnaryCallable<com.google.cloud.dialogflow.v2beta1.DeleteDocumentRequest,Operation> |
deleteDocumentCallable()
Deletes the specified document.
|
OperationCallable<com.google.cloud.dialogflow.v2beta1.DeleteDocumentRequest,Empty,com.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata> |
deleteDocumentOperationCallable()
Deletes the specified document.
|
com.google.cloud.dialogflow.v2beta1.Document |
getDocument(com.google.cloud.dialogflow.v2beta1.DocumentName name)
Retrieves the specified document.
|
com.google.cloud.dialogflow.v2beta1.Document |
getDocument(com.google.cloud.dialogflow.v2beta1.GetDocumentRequest request)
Retrieves the specified document.
|
com.google.cloud.dialogflow.v2beta1.Document |
getDocument(String name)
Retrieves the specified document.
|
UnaryCallable<com.google.cloud.dialogflow.v2beta1.GetDocumentRequest,com.google.cloud.dialogflow.v2beta1.Document> |
getDocumentCallable()
Retrieves the specified document.
|
OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
DocumentsSettings |
getSettings() |
DocumentsStub |
getStub() |
boolean |
isShutdown() |
boolean |
isTerminated() |
DocumentsClient.ListDocumentsPagedResponse |
listDocuments(com.google.cloud.dialogflow.v2beta1.KnowledgeBaseName parent)
Returns the list of all documents of the knowledge base.
|
DocumentsClient.ListDocumentsPagedResponse |
listDocuments(com.google.cloud.dialogflow.v2beta1.ListDocumentsRequest request)
Returns the list of all documents of the knowledge base.
|
DocumentsClient.ListDocumentsPagedResponse |
listDocuments(String parent)
Returns the list of all documents of the knowledge base.
|
UnaryCallable<com.google.cloud.dialogflow.v2beta1.ListDocumentsRequest,com.google.cloud.dialogflow.v2beta1.ListDocumentsResponse> |
listDocumentsCallable()
Returns the list of all documents of the knowledge base.
|
UnaryCallable<com.google.cloud.dialogflow.v2beta1.ListDocumentsRequest,DocumentsClient.ListDocumentsPagedResponse> |
listDocumentsPagedCallable()
Returns the list of all documents of the knowledge base.
|
Operation |
reloadDocument(com.google.cloud.dialogflow.v2beta1.ReloadDocumentRequest request)
Reloads the specified document from its specified source, content_uri or content.
|
UnaryCallable<com.google.cloud.dialogflow.v2beta1.ReloadDocumentRequest,Operation> |
reloadDocumentCallable()
Reloads the specified document from its specified source, content_uri or content.
|
void |
shutdown() |
void |
shutdownNow() |
Operation |
updateDocument(com.google.cloud.dialogflow.v2beta1.UpdateDocumentRequest request)
Updates the specified document.
|
UnaryCallable<com.google.cloud.dialogflow.v2beta1.UpdateDocumentRequest,Operation> |
updateDocumentCallable()
Updates the specified document.
|
protected DocumentsClient(DocumentsSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") protected DocumentsClient(DocumentsStub stub)
public static final DocumentsClient create() throws IOException
IOException
public static final DocumentsClient create(DocumentsSettings settings) throws IOException
IOException
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public static final DocumentsClient create(DocumentsStub stub)
public final DocumentsSettings getSettings()
@BetaApi(value="A restructuring of stub classes is planned, so this may break in the future") public DocumentsStub getStub()
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationsClient getOperationsClient()
public final DocumentsClient.ListDocumentsPagedResponse listDocuments(com.google.cloud.dialogflow.v2beta1.KnowledgeBaseName parent)
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
KnowledgeBaseName parent = KnowledgeBaseName.of("[PROJECT]", "[KNOWLEDGE_BASE]");
for (Document element : documentsClient.listDocuments(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The knowledge base to list all documents for. Format:
`projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`.ApiException
- if the remote call failspublic final DocumentsClient.ListDocumentsPagedResponse listDocuments(String parent)
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
KnowledgeBaseName parent = KnowledgeBaseName.of("[PROJECT]", "[KNOWLEDGE_BASE]");
for (Document element : documentsClient.listDocuments(parent.toString()).iterateAll()) {
// doThingsWith(element);
}
}
parent
- Required. The knowledge base to list all documents for. Format:
`projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`.ApiException
- if the remote call failspublic final DocumentsClient.ListDocumentsPagedResponse listDocuments(com.google.cloud.dialogflow.v2beta1.ListDocumentsRequest request)
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
KnowledgeBaseName parent = KnowledgeBaseName.of("[PROJECT]", "[KNOWLEDGE_BASE]");
ListDocumentsRequest request = ListDocumentsRequest.newBuilder()
.setParent(parent.toString())
.build();
for (Document element : documentsClient.listDocuments(request).iterateAll()) {
// doThingsWith(element);
}
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.dialogflow.v2beta1.ListDocumentsRequest,DocumentsClient.ListDocumentsPagedResponse> listDocumentsPagedCallable()
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
KnowledgeBaseName parent = KnowledgeBaseName.of("[PROJECT]", "[KNOWLEDGE_BASE]");
ListDocumentsRequest request = ListDocumentsRequest.newBuilder()
.setParent(parent.toString())
.build();
ApiFuture<ListDocumentsPagedResponse> future = documentsClient.listDocumentsPagedCallable().futureCall(request);
// Do something
for (Document element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final UnaryCallable<com.google.cloud.dialogflow.v2beta1.ListDocumentsRequest,com.google.cloud.dialogflow.v2beta1.ListDocumentsResponse> listDocumentsCallable()
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
KnowledgeBaseName parent = KnowledgeBaseName.of("[PROJECT]", "[KNOWLEDGE_BASE]");
ListDocumentsRequest request = ListDocumentsRequest.newBuilder()
.setParent(parent.toString())
.build();
while (true) {
ListDocumentsResponse response = documentsClient.listDocumentsCallable().call(request);
for (Document element : response.getDocumentsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.cloud.dialogflow.v2beta1.Document getDocument(com.google.cloud.dialogflow.v2beta1.DocumentName name)
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
DocumentName name = DocumentName.of("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]");
Document response = documentsClient.getDocument(name);
}
name
- Required. The name of the document to retrieve. Format `projects/<Project
ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.ApiException
- if the remote call failspublic final com.google.cloud.dialogflow.v2beta1.Document getDocument(String name)
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
DocumentName name = DocumentName.of("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]");
Document response = documentsClient.getDocument(name.toString());
}
name
- Required. The name of the document to retrieve. Format `projects/<Project
ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.ApiException
- if the remote call failspublic final com.google.cloud.dialogflow.v2beta1.Document getDocument(com.google.cloud.dialogflow.v2beta1.GetDocumentRequest request)
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
DocumentName name = DocumentName.of("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]");
GetDocumentRequest request = GetDocumentRequest.newBuilder()
.setName(name.toString())
.build();
Document response = documentsClient.getDocument(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.dialogflow.v2beta1.GetDocumentRequest,com.google.cloud.dialogflow.v2beta1.Document> getDocumentCallable()
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
DocumentName name = DocumentName.of("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]");
GetDocumentRequest request = GetDocumentRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Document> future = documentsClient.getDocumentCallable().futureCall(request);
// Do something
Document response = future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.cloud.dialogflow.v2beta1.Document,com.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata> createDocumentAsync(com.google.cloud.dialogflow.v2beta1.KnowledgeBaseName parent, com.google.cloud.dialogflow.v2beta1.Document document)
Operation <response: [Document][google.cloud.dialogflow.v2beta1.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata]>
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
KnowledgeBaseName parent = KnowledgeBaseName.of("[PROJECT]", "[KNOWLEDGE_BASE]");
Document document = Document.newBuilder().build();
Document response = documentsClient.createDocumentAsync(parent, document).get();
}
parent
- Required. The knoweldge base to create a document for. Format:
`projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`.document
- Required. The document to create.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.cloud.dialogflow.v2beta1.Document,com.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata> createDocumentAsync(String parent, com.google.cloud.dialogflow.v2beta1.Document document)
Operation <response: [Document][google.cloud.dialogflow.v2beta1.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata]>
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
KnowledgeBaseName parent = KnowledgeBaseName.of("[PROJECT]", "[KNOWLEDGE_BASE]");
Document document = Document.newBuilder().build();
Document response = documentsClient.createDocumentAsync(parent.toString(), document).get();
}
parent
- Required. The knoweldge base to create a document for. Format:
`projects/<Project ID>/knowledgeBases/<Knowledge Base ID>`.document
- Required. The document to create.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<com.google.cloud.dialogflow.v2beta1.Document,com.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata> createDocumentAsync(com.google.cloud.dialogflow.v2beta1.CreateDocumentRequest request)
Operation <response: [Document][google.cloud.dialogflow.v2beta1.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata]>
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
KnowledgeBaseName parent = KnowledgeBaseName.of("[PROJECT]", "[KNOWLEDGE_BASE]");
Document document = Document.newBuilder().build();
CreateDocumentRequest request = CreateDocumentRequest.newBuilder()
.setParent(parent.toString())
.setDocument(document)
.build();
Document response = documentsClient.createDocumentAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable<com.google.cloud.dialogflow.v2beta1.CreateDocumentRequest,com.google.cloud.dialogflow.v2beta1.Document,com.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata> createDocumentOperationCallable()
Operation <response: [Document][google.cloud.dialogflow.v2beta1.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata]>
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
KnowledgeBaseName parent = KnowledgeBaseName.of("[PROJECT]", "[KNOWLEDGE_BASE]");
Document document = Document.newBuilder().build();
CreateDocumentRequest request = CreateDocumentRequest.newBuilder()
.setParent(parent.toString())
.setDocument(document)
.build();
OperationFuture<Document, KnowledgeOperationMetadata> future = documentsClient.createDocumentOperationCallable().futureCall(request);
// Do something
Document response = future.get();
}
public final UnaryCallable<com.google.cloud.dialogflow.v2beta1.CreateDocumentRequest,Operation> createDocumentCallable()
Operation <response: [Document][google.cloud.dialogflow.v2beta1.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata]>
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
KnowledgeBaseName parent = KnowledgeBaseName.of("[PROJECT]", "[KNOWLEDGE_BASE]");
Document document = Document.newBuilder().build();
CreateDocumentRequest request = CreateDocumentRequest.newBuilder()
.setParent(parent.toString())
.setDocument(document)
.build();
ApiFuture<Operation> future = documentsClient.createDocumentCallable().futureCall(request);
// Do something
Operation response = future.get();
}
@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,com.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata> deleteDocumentAsync(com.google.cloud.dialogflow.v2beta1.DocumentName name)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata]>
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
DocumentName name = DocumentName.of("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]");
documentsClient.deleteDocumentAsync(name).get();
}
name
- The name of the document to delete. Format: `projects/<Project
ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,com.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata> deleteDocumentAsync(String name)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata]>
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
DocumentName name = DocumentName.of("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]");
documentsClient.deleteDocumentAsync(name.toString()).get();
}
name
- The name of the document to delete. Format: `projects/<Project
ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>`.ApiException
- if the remote call fails@BetaApi(value="The surface for long-running operations is not stable yet and may change in the future.") public final OperationFuture<Empty,com.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata> deleteDocumentAsync(com.google.cloud.dialogflow.v2beta1.DeleteDocumentRequest request)
Operation <response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata]>
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
DocumentName name = DocumentName.of("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]");
DeleteDocumentRequest request = DeleteDocumentRequest.newBuilder()
.setName(name.toString())
.build();
documentsClient.deleteDocumentAsync(request).get();
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call fails@BetaApi(value="The surface for use by generated code is not stable yet and may change in the future.") public final OperationCallable<com.google.cloud.dialogflow.v2beta1.DeleteDocumentRequest,Empty,com.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata> deleteDocumentOperationCallable()
Operation <response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata]>
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
DocumentName name = DocumentName.of("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]");
DeleteDocumentRequest request = DeleteDocumentRequest.newBuilder()
.setName(name.toString())
.build();
OperationFuture<Empty, KnowledgeOperationMetadata> future = documentsClient.deleteDocumentOperationCallable().futureCall(request);
// Do something
future.get();
}
public final UnaryCallable<com.google.cloud.dialogflow.v2beta1.DeleteDocumentRequest,Operation> deleteDocumentCallable()
Operation <response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata]>
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
DocumentName name = DocumentName.of("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]");
DeleteDocumentRequest request = DeleteDocumentRequest.newBuilder()
.setName(name.toString())
.build();
ApiFuture<Operation> future = documentsClient.deleteDocumentCallable().futureCall(request);
// Do something
future.get();
}
public final Operation updateDocument(com.google.cloud.dialogflow.v2beta1.UpdateDocumentRequest request)
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
UpdateDocumentRequest request = UpdateDocumentRequest.newBuilder().build();
Operation response = documentsClient.updateDocument(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.dialogflow.v2beta1.UpdateDocumentRequest,Operation> updateDocumentCallable()
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
UpdateDocumentRequest request = UpdateDocumentRequest.newBuilder().build();
ApiFuture<Operation> future = documentsClient.updateDocumentCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final Operation reloadDocument(com.google.cloud.dialogflow.v2beta1.ReloadDocumentRequest request)
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
ReloadDocumentRequest request = ReloadDocumentRequest.newBuilder().build();
Operation response = documentsClient.reloadDocument(request);
}
request
- The request object containing all of the parameters for the API call.ApiException
- if the remote call failspublic final UnaryCallable<com.google.cloud.dialogflow.v2beta1.ReloadDocumentRequest,Operation> reloadDocumentCallable()
Sample code:
try (DocumentsClient documentsClient = DocumentsClient.create()) {
ReloadDocumentRequest request = ReloadDocumentRequest.newBuilder().build();
ApiFuture<Operation> future = documentsClient.reloadDocumentCallable().futureCall(request);
// Do something
Operation response = future.get();
}
public final void close()
close
in interface AutoCloseable
public void shutdown()
shutdown
in interface BackgroundResource
public boolean isShutdown()
isShutdown
in interface BackgroundResource
public boolean isTerminated()
isTerminated
in interface BackgroundResource
public void shutdownNow()
shutdownNow
in interface BackgroundResource
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException
awaitTermination
in interface BackgroundResource
InterruptedException
Copyright © 2019 Google LLC. All rights reserved.