public abstract class DocumentsClient
Documents client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Dialogflow.V2Assembly
Google.Cloud.Dialogflow.V2.dll
Remarks
Service for managing knowledge [Documents][google.cloud.dialogflow.v2.Document].
Properties
CreateDocumentOperationsClient
public virtual OperationsClient CreateDocumentOperationsClient { get; }
The long-running operations client for CreateDocument
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the Documents service, which is a host of "dialogflow.googleapis.com" and a port of 443.
Property Value | |
---|---|
Type | Description |
String |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default Documents scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyList<String> |
The default Documents scopes are:
DeleteDocumentOperationsClient
public virtual OperationsClient DeleteDocumentOperationsClient { get; }
The long-running operations client for DeleteDocument
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
GrpcClient
public virtual Documents.DocumentsClient GrpcClient { get; }
The underlying gRPC Documents client
Property Value | |
---|---|
Type | Description |
Documents.DocumentsClient |
ReloadDocumentOperationsClient
public virtual OperationsClient ReloadDocumentOperationsClient { get; }
The long-running operations client for ReloadDocument
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
UpdateDocumentOperationsClient
public virtual OperationsClient UpdateDocumentOperationsClient { get; }
The long-running operations client for UpdateDocument
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
Methods
Create()
public static DocumentsClient Create()
Synchronously creates a DocumentsClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use DocumentsClientBuilder.
Returns | |
---|---|
Type | Description |
DocumentsClient | The created DocumentsClient. |
CreateAsync(CancellationToken)
public static Task<DocumentsClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))
Asynchronously creates a DocumentsClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use DocumentsClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
Task<DocumentsClient> | The task representing the created DocumentsClient. |
CreateDocument(CreateDocumentRequest, CallSettings)
public virtual Operation<Document, KnowledgeOperationMetadata> CreateDocument(CreateDocumentRequest request, CallSettings callSettings = null)
Creates a new document.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
request | CreateDocumentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Document, KnowledgeOperationMetadata> | The RPC response. |
// Create client
DocumentsClient documentsClient = DocumentsClient.Create();
// Initialize request argument(s)
CreateDocumentRequest request = new CreateDocumentRequest
{
ParentAsKnowledgeBaseName = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]"),
Document = new Document(),
};
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = documentsClient.CreateDocument(request);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = documentsClient.PollOnceCreateDocument(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
CreateDocument(KnowledgeBaseName, Document, CallSettings)
public virtual Operation<Document, KnowledgeOperationMetadata> CreateDocument(KnowledgeBaseName parent, Document document, CallSettings callSettings = null)
Creates a new document.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
parent | KnowledgeBaseName Required. The knowledge base to create a document for.
Format: |
document | Document Required. The document to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Document, KnowledgeOperationMetadata> | The RPC response. |
// Create client
DocumentsClient documentsClient = DocumentsClient.Create();
// Initialize request argument(s)
KnowledgeBaseName parent = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]");
Document document = new Document();
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = documentsClient.CreateDocument(parent, document);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = documentsClient.PollOnceCreateDocument(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
CreateDocument(String, Document, CallSettings)
public virtual Operation<Document, KnowledgeOperationMetadata> CreateDocument(string parent, Document document, CallSettings callSettings = null)
Creates a new document.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
parent | String Required. The knowledge base to create a document for.
Format: |
document | Document Required. The document to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Document, KnowledgeOperationMetadata> | The RPC response. |
// Create client
DocumentsClient documentsClient = DocumentsClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/knowledgeBases/[KNOWLEDGE_BASE]";
Document document = new Document();
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = documentsClient.CreateDocument(parent, document);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = documentsClient.PollOnceCreateDocument(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
CreateDocumentAsync(CreateDocumentRequest, CallSettings)
public virtual Task<Operation<Document, KnowledgeOperationMetadata>> CreateDocumentAsync(CreateDocumentRequest request, CallSettings callSettings = null)
Creates a new document.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
request | CreateDocumentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Document, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
CreateDocumentRequest request = new CreateDocumentRequest
{
ParentAsKnowledgeBaseName = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]"),
Document = new Document(),
};
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = await documentsClient.CreateDocumentAsync(request);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceCreateDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
CreateDocumentAsync(CreateDocumentRequest, CancellationToken)
public virtual Task<Operation<Document, KnowledgeOperationMetadata>> CreateDocumentAsync(CreateDocumentRequest request, CancellationToken cancellationToken)
Creates a new document.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
request | CreateDocumentRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Document, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
CreateDocumentRequest request = new CreateDocumentRequest
{
ParentAsKnowledgeBaseName = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]"),
Document = new Document(),
};
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = await documentsClient.CreateDocumentAsync(request);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceCreateDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
CreateDocumentAsync(KnowledgeBaseName, Document, CallSettings)
public virtual Task<Operation<Document, KnowledgeOperationMetadata>> CreateDocumentAsync(KnowledgeBaseName parent, Document document, CallSettings callSettings = null)
Creates a new document.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
parent | KnowledgeBaseName Required. The knowledge base to create a document for.
Format: |
document | Document Required. The document to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Document, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
KnowledgeBaseName parent = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]");
Document document = new Document();
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = await documentsClient.CreateDocumentAsync(parent, document);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceCreateDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
CreateDocumentAsync(KnowledgeBaseName, Document, CancellationToken)
public virtual Task<Operation<Document, KnowledgeOperationMetadata>> CreateDocumentAsync(KnowledgeBaseName parent, Document document, CancellationToken cancellationToken)
Creates a new document.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
parent | KnowledgeBaseName Required. The knowledge base to create a document for.
Format: |
document | Document Required. The document to create. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Document, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
KnowledgeBaseName parent = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]");
Document document = new Document();
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = await documentsClient.CreateDocumentAsync(parent, document);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceCreateDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
CreateDocumentAsync(String, Document, CallSettings)
public virtual Task<Operation<Document, KnowledgeOperationMetadata>> CreateDocumentAsync(string parent, Document document, CallSettings callSettings = null)
Creates a new document.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
parent | String Required. The knowledge base to create a document for.
Format: |
document | Document Required. The document to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Document, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/knowledgeBases/[KNOWLEDGE_BASE]";
Document document = new Document();
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = await documentsClient.CreateDocumentAsync(parent, document);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceCreateDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
CreateDocumentAsync(String, Document, CancellationToken)
public virtual Task<Operation<Document, KnowledgeOperationMetadata>> CreateDocumentAsync(string parent, Document document, CancellationToken cancellationToken)
Creates a new document.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
parent | String Required. The knowledge base to create a document for.
Format: |
document | Document Required. The document to create. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Document, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/knowledgeBases/[KNOWLEDGE_BASE]";
Document document = new Document();
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = await documentsClient.CreateDocumentAsync(parent, document);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceCreateDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
DeleteDocument(DeleteDocumentRequest, CallSettings)
public virtual Operation<Empty, KnowledgeOperationMetadata> DeleteDocument(DeleteDocumentRequest request, CallSettings callSettings = null)
Deletes the specified document.
Operation <response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
request | DeleteDocumentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Empty, KnowledgeOperationMetadata> | The RPC response. |
// Create client
DocumentsClient documentsClient = DocumentsClient.Create();
// Initialize request argument(s)
DeleteDocumentRequest request = new DeleteDocumentRequest
{
DocumentName = DocumentName.FromProjectKnowledgeBaseDocument("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]"),
};
// Make the request
Operation<Empty, KnowledgeOperationMetadata> response = documentsClient.DeleteDocument(request);
// Poll until the returned long-running operation is complete
Operation<Empty, KnowledgeOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, KnowledgeOperationMetadata> retrievedResponse = documentsClient.PollOnceDeleteDocument(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteDocument(DocumentName, CallSettings)
public virtual Operation<Empty, KnowledgeOperationMetadata> DeleteDocument(DocumentName name, CallSettings callSettings = null)
Deletes the specified document.
Operation <response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
name | DocumentName Required. The name of the document to delete.
Format: |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Empty, KnowledgeOperationMetadata> | The RPC response. |
// Create client
DocumentsClient documentsClient = DocumentsClient.Create();
// Initialize request argument(s)
DocumentName name = DocumentName.FromProjectKnowledgeBaseDocument("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]");
// Make the request
Operation<Empty, KnowledgeOperationMetadata> response = documentsClient.DeleteDocument(name);
// Poll until the returned long-running operation is complete
Operation<Empty, KnowledgeOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, KnowledgeOperationMetadata> retrievedResponse = documentsClient.PollOnceDeleteDocument(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteDocument(String, CallSettings)
public virtual Operation<Empty, KnowledgeOperationMetadata> DeleteDocument(string name, CallSettings callSettings = null)
Deletes the specified document.
Operation <response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the document to delete.
Format: |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Empty, KnowledgeOperationMetadata> | The RPC response. |
// Create client
DocumentsClient documentsClient = DocumentsClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/knowledgeBases/[KNOWLEDGE_BASE]/documents/[DOCUMENT]";
// Make the request
Operation<Empty, KnowledgeOperationMetadata> response = documentsClient.DeleteDocument(name);
// Poll until the returned long-running operation is complete
Operation<Empty, KnowledgeOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, KnowledgeOperationMetadata> retrievedResponse = documentsClient.PollOnceDeleteDocument(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteDocumentAsync(DeleteDocumentRequest, CallSettings)
public virtual Task<Operation<Empty, KnowledgeOperationMetadata>> DeleteDocumentAsync(DeleteDocumentRequest request, CallSettings callSettings = null)
Deletes the specified document.
Operation <response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
request | DeleteDocumentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Empty, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
DeleteDocumentRequest request = new DeleteDocumentRequest
{
DocumentName = DocumentName.FromProjectKnowledgeBaseDocument("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]"),
};
// Make the request
Operation<Empty, KnowledgeOperationMetadata> response = await documentsClient.DeleteDocumentAsync(request);
// Poll until the returned long-running operation is complete
Operation<Empty, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceDeleteDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteDocumentAsync(DeleteDocumentRequest, CancellationToken)
public virtual Task<Operation<Empty, KnowledgeOperationMetadata>> DeleteDocumentAsync(DeleteDocumentRequest request, CancellationToken cancellationToken)
Deletes the specified document.
Operation <response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
request | DeleteDocumentRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Empty, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
DeleteDocumentRequest request = new DeleteDocumentRequest
{
DocumentName = DocumentName.FromProjectKnowledgeBaseDocument("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]"),
};
// Make the request
Operation<Empty, KnowledgeOperationMetadata> response = await documentsClient.DeleteDocumentAsync(request);
// Poll until the returned long-running operation is complete
Operation<Empty, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceDeleteDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteDocumentAsync(DocumentName, CallSettings)
public virtual Task<Operation<Empty, KnowledgeOperationMetadata>> DeleteDocumentAsync(DocumentName name, CallSettings callSettings = null)
Deletes the specified document.
Operation <response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
name | DocumentName Required. The name of the document to delete.
Format: |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Empty, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
DocumentName name = DocumentName.FromProjectKnowledgeBaseDocument("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]");
// Make the request
Operation<Empty, KnowledgeOperationMetadata> response = await documentsClient.DeleteDocumentAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceDeleteDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteDocumentAsync(DocumentName, CancellationToken)
public virtual Task<Operation<Empty, KnowledgeOperationMetadata>> DeleteDocumentAsync(DocumentName name, CancellationToken cancellationToken)
Deletes the specified document.
Operation <response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
name | DocumentName Required. The name of the document to delete.
Format: |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Empty, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
DocumentName name = DocumentName.FromProjectKnowledgeBaseDocument("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]");
// Make the request
Operation<Empty, KnowledgeOperationMetadata> response = await documentsClient.DeleteDocumentAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceDeleteDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteDocumentAsync(String, CallSettings)
public virtual Task<Operation<Empty, KnowledgeOperationMetadata>> DeleteDocumentAsync(string name, CallSettings callSettings = null)
Deletes the specified document.
Operation <response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the document to delete.
Format: |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Empty, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/knowledgeBases/[KNOWLEDGE_BASE]/documents/[DOCUMENT]";
// Make the request
Operation<Empty, KnowledgeOperationMetadata> response = await documentsClient.DeleteDocumentAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceDeleteDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
DeleteDocumentAsync(String, CancellationToken)
public virtual Task<Operation<Empty, KnowledgeOperationMetadata>> DeleteDocumentAsync(string name, CancellationToken cancellationToken)
Deletes the specified document.
Operation <response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the document to delete.
Format: |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Empty, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/knowledgeBases/[KNOWLEDGE_BASE]/documents/[DOCUMENT]";
// Make the request
Operation<Empty, KnowledgeOperationMetadata> response = await documentsClient.DeleteDocumentAsync(name);
// Poll until the returned long-running operation is complete
Operation<Empty, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceDeleteDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Empty retrievedResult = retrievedResponse.Result;
}
GetDocument(DocumentName, CallSettings)
public virtual Document GetDocument(DocumentName name, CallSettings callSettings = null)
Retrieves the specified document.
Parameters | |
---|---|
Name | Description |
name | DocumentName Required. The name of the document to retrieve.
Format |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Document | The RPC response. |
// Create client
DocumentsClient documentsClient = DocumentsClient.Create();
// Initialize request argument(s)
DocumentName name = DocumentName.FromProjectKnowledgeBaseDocument("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]");
// Make the request
Document response = documentsClient.GetDocument(name);
GetDocument(GetDocumentRequest, CallSettings)
public virtual Document GetDocument(GetDocumentRequest request, CallSettings callSettings = null)
Retrieves the specified document.
Parameters | |
---|---|
Name | Description |
request | GetDocumentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Document | The RPC response. |
// Create client
DocumentsClient documentsClient = DocumentsClient.Create();
// Initialize request argument(s)
GetDocumentRequest request = new GetDocumentRequest
{
DocumentName = DocumentName.FromProjectKnowledgeBaseDocument("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]"),
};
// Make the request
Document response = documentsClient.GetDocument(request);
GetDocument(String, CallSettings)
public virtual Document GetDocument(string name, CallSettings callSettings = null)
Retrieves the specified document.
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the document to retrieve.
Format |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Document | The RPC response. |
// Create client
DocumentsClient documentsClient = DocumentsClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/knowledgeBases/[KNOWLEDGE_BASE]/documents/[DOCUMENT]";
// Make the request
Document response = documentsClient.GetDocument(name);
GetDocumentAsync(DocumentName, CallSettings)
public virtual Task<Document> GetDocumentAsync(DocumentName name, CallSettings callSettings = null)
Retrieves the specified document.
Parameters | |
---|---|
Name | Description |
name | DocumentName Required. The name of the document to retrieve.
Format |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Document> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
DocumentName name = DocumentName.FromProjectKnowledgeBaseDocument("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]");
// Make the request
Document response = await documentsClient.GetDocumentAsync(name);
GetDocumentAsync(DocumentName, CancellationToken)
public virtual Task<Document> GetDocumentAsync(DocumentName name, CancellationToken cancellationToken)
Retrieves the specified document.
Parameters | |
---|---|
Name | Description |
name | DocumentName Required. The name of the document to retrieve.
Format |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Document> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
DocumentName name = DocumentName.FromProjectKnowledgeBaseDocument("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]");
// Make the request
Document response = await documentsClient.GetDocumentAsync(name);
GetDocumentAsync(GetDocumentRequest, CallSettings)
public virtual Task<Document> GetDocumentAsync(GetDocumentRequest request, CallSettings callSettings = null)
Retrieves the specified document.
Parameters | |
---|---|
Name | Description |
request | GetDocumentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Document> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
GetDocumentRequest request = new GetDocumentRequest
{
DocumentName = DocumentName.FromProjectKnowledgeBaseDocument("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]"),
};
// Make the request
Document response = await documentsClient.GetDocumentAsync(request);
GetDocumentAsync(GetDocumentRequest, CancellationToken)
public virtual Task<Document> GetDocumentAsync(GetDocumentRequest request, CancellationToken cancellationToken)
Retrieves the specified document.
Parameters | |
---|---|
Name | Description |
request | GetDocumentRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Document> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
GetDocumentRequest request = new GetDocumentRequest
{
DocumentName = DocumentName.FromProjectKnowledgeBaseDocument("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]"),
};
// Make the request
Document response = await documentsClient.GetDocumentAsync(request);
GetDocumentAsync(String, CallSettings)
public virtual Task<Document> GetDocumentAsync(string name, CallSettings callSettings = null)
Retrieves the specified document.
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the document to retrieve.
Format |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Document> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/knowledgeBases/[KNOWLEDGE_BASE]/documents/[DOCUMENT]";
// Make the request
Document response = await documentsClient.GetDocumentAsync(name);
GetDocumentAsync(String, CancellationToken)
public virtual Task<Document> GetDocumentAsync(string name, CancellationToken cancellationToken)
Retrieves the specified document.
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the document to retrieve.
Format |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Document> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/knowledgeBases/[KNOWLEDGE_BASE]/documents/[DOCUMENT]";
// Make the request
Document response = await documentsClient.GetDocumentAsync(name);
ListDocuments(KnowledgeBaseName, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListDocumentsResponse, Document> ListDocuments(KnowledgeBaseName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
Returns the list of all documents of the knowledge base.
Parameters | |
---|---|
Name | Description |
parent | KnowledgeBaseName Required. The knowledge base to list all documents for.
Format: |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListDocumentsResponse, Document> | A pageable sequence of Document resources. |
// Create client
DocumentsClient documentsClient = DocumentsClient.Create();
// Initialize request argument(s)
KnowledgeBaseName parent = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]");
// Make the request
PagedEnumerable<ListDocumentsResponse, Document> response = documentsClient.ListDocuments(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Document item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListDocumentsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Document item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Document> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Document item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListDocuments(ListDocumentsRequest, CallSettings)
public virtual PagedEnumerable<ListDocumentsResponse, Document> ListDocuments(ListDocumentsRequest request, CallSettings callSettings = null)
Returns the list of all documents of the knowledge base.
Parameters | |
---|---|
Name | Description |
request | ListDocumentsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListDocumentsResponse, Document> | A pageable sequence of Document resources. |
// Create client
DocumentsClient documentsClient = DocumentsClient.Create();
// Initialize request argument(s)
ListDocumentsRequest request = new ListDocumentsRequest
{
ParentAsKnowledgeBaseName = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]"),
};
// Make the request
PagedEnumerable<ListDocumentsResponse, Document> response = documentsClient.ListDocuments(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Document item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListDocumentsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Document item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Document> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Document item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListDocuments(String, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListDocumentsResponse, Document> ListDocuments(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
Returns the list of all documents of the knowledge base.
Parameters | |
---|---|
Name | Description |
parent | String Required. The knowledge base to list all documents for.
Format: |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerable<ListDocumentsResponse, Document> | A pageable sequence of Document resources. |
// Create client
DocumentsClient documentsClient = DocumentsClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/knowledgeBases/[KNOWLEDGE_BASE]";
// Make the request
PagedEnumerable<ListDocumentsResponse, Document> response = documentsClient.ListDocuments(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Document item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListDocumentsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Document item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Document> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Document item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListDocumentsAsync(KnowledgeBaseName, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListDocumentsResponse, Document> ListDocumentsAsync(KnowledgeBaseName parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
Returns the list of all documents of the knowledge base.
Parameters | |
---|---|
Name | Description |
parent | KnowledgeBaseName Required. The knowledge base to list all documents for.
Format: |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListDocumentsResponse, Document> | A pageable asynchronous sequence of Document resources. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
KnowledgeBaseName parent = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]");
// Make the request
PagedAsyncEnumerable<ListDocumentsResponse, Document> response = documentsClient.ListDocumentsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Document item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListDocumentsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Document item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Document> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Document item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListDocumentsAsync(ListDocumentsRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListDocumentsResponse, Document> ListDocumentsAsync(ListDocumentsRequest request, CallSettings callSettings = null)
Returns the list of all documents of the knowledge base.
Parameters | |
---|---|
Name | Description |
request | ListDocumentsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListDocumentsResponse, Document> | A pageable asynchronous sequence of Document resources. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
ListDocumentsRequest request = new ListDocumentsRequest
{
ParentAsKnowledgeBaseName = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]"),
};
// Make the request
PagedAsyncEnumerable<ListDocumentsResponse, Document> response = documentsClient.ListDocumentsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Document item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListDocumentsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Document item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Document> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Document item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListDocumentsAsync(String, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListDocumentsResponse, Document> ListDocumentsAsync(string parent, string pageToken = null, int? pageSize = default(int? ), CallSettings callSettings = null)
Returns the list of all documents of the knowledge base.
Parameters | |
---|---|
Name | Description |
parent | String Required. The knowledge base to list all documents for.
Format: |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerable<ListDocumentsResponse, Document> | A pageable asynchronous sequence of Document resources. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/knowledgeBases/[KNOWLEDGE_BASE]";
// Make the request
PagedAsyncEnumerable<ListDocumentsResponse, Document> response = documentsClient.ListDocumentsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Document item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListDocumentsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Document item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Document> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Document item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
PollOnceCreateDocument(String, CallSettings)
public virtual Operation<Document, KnowledgeOperationMetadata> PollOnceCreateDocument(string operationName, CallSettings callSettings = null)
Poll an operation once, using an operationName
from a previous invocation of CreateDocument
.
Parameters | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Document, KnowledgeOperationMetadata> | The result of polling the operation. |
PollOnceCreateDocumentAsync(String, CallSettings)
public virtual Task<Operation<Document, KnowledgeOperationMetadata>> PollOnceCreateDocumentAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
CreateDocument
.
Parameters | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Document, KnowledgeOperationMetadata>> | A task representing the result of polling the operation. |
PollOnceDeleteDocument(String, CallSettings)
public virtual Operation<Empty, KnowledgeOperationMetadata> PollOnceDeleteDocument(string operationName, CallSettings callSettings = null)
Poll an operation once, using an operationName
from a previous invocation of DeleteDocument
.
Parameters | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Empty, KnowledgeOperationMetadata> | The result of polling the operation. |
PollOnceDeleteDocumentAsync(String, CallSettings)
public virtual Task<Operation<Empty, KnowledgeOperationMetadata>> PollOnceDeleteDocumentAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
DeleteDocument
.
Parameters | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Empty, KnowledgeOperationMetadata>> | A task representing the result of polling the operation. |
PollOnceReloadDocument(String, CallSettings)
public virtual Operation<Document, KnowledgeOperationMetadata> PollOnceReloadDocument(string operationName, CallSettings callSettings = null)
Poll an operation once, using an operationName
from a previous invocation of ReloadDocument
.
Parameters | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Document, KnowledgeOperationMetadata> | The result of polling the operation. |
PollOnceReloadDocumentAsync(String, CallSettings)
public virtual Task<Operation<Document, KnowledgeOperationMetadata>> PollOnceReloadDocumentAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
ReloadDocument
.
Parameters | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Document, KnowledgeOperationMetadata>> | A task representing the result of polling the operation. |
PollOnceUpdateDocument(String, CallSettings)
public virtual Operation<Document, KnowledgeOperationMetadata> PollOnceUpdateDocument(string operationName, CallSettings callSettings = null)
Poll an operation once, using an operationName
from a previous invocation of UpdateDocument
.
Parameters | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Document, KnowledgeOperationMetadata> | The result of polling the operation. |
PollOnceUpdateDocumentAsync(String, CallSettings)
public virtual Task<Operation<Document, KnowledgeOperationMetadata>> PollOnceUpdateDocumentAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
UpdateDocument
.
Parameters | |
---|---|
Name | Description |
operationName | String The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Document, KnowledgeOperationMetadata>> | A task representing the result of polling the operation. |
ReloadDocument(DocumentName, String, CallSettings)
public virtual Operation<Document, KnowledgeOperationMetadata> ReloadDocument(DocumentName name, string contentUri, CallSettings callSettings = null)
Reloads the specified document from its specified source, content_uri or content. The previously loaded content of the document will be deleted. Note: Even when the content of the document has not changed, there still may be side effects because of internal implementation changes.
Note: The projects.agent.knowledgeBases.documents
resource is deprecated;
only use projects.knowledgeBases.documents
.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
name | DocumentName Required. The name of the document to reload.
Format: |
contentUri | String Optional. The path of gcs source file for reloading document content. For now, only gcs uri is supported. For documents stored in Google Cloud Storage, these URIs must have
the form |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Document, KnowledgeOperationMetadata> | The RPC response. |
// Create client
DocumentsClient documentsClient = DocumentsClient.Create();
// Initialize request argument(s)
DocumentName name = DocumentName.FromProjectKnowledgeBaseDocument("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]");
string contentUri = "";
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = documentsClient.ReloadDocument(name, contentUri);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = documentsClient.PollOnceReloadDocument(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
ReloadDocument(ReloadDocumentRequest, CallSettings)
public virtual Operation<Document, KnowledgeOperationMetadata> ReloadDocument(ReloadDocumentRequest request, CallSettings callSettings = null)
Reloads the specified document from its specified source, content_uri or content. The previously loaded content of the document will be deleted. Note: Even when the content of the document has not changed, there still may be side effects because of internal implementation changes.
Note: The projects.agent.knowledgeBases.documents
resource is deprecated;
only use projects.knowledgeBases.documents
.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
request | ReloadDocumentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Document, KnowledgeOperationMetadata> | The RPC response. |
// Create client
DocumentsClient documentsClient = DocumentsClient.Create();
// Initialize request argument(s)
ReloadDocumentRequest request = new ReloadDocumentRequest
{
DocumentName = DocumentName.FromProjectKnowledgeBaseDocument("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]"),
ContentUri = "",
};
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = documentsClient.ReloadDocument(request);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = documentsClient.PollOnceReloadDocument(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
ReloadDocument(String, String, CallSettings)
public virtual Operation<Document, KnowledgeOperationMetadata> ReloadDocument(string name, string contentUri, CallSettings callSettings = null)
Reloads the specified document from its specified source, content_uri or content. The previously loaded content of the document will be deleted. Note: Even when the content of the document has not changed, there still may be side effects because of internal implementation changes.
Note: The projects.agent.knowledgeBases.documents
resource is deprecated;
only use projects.knowledgeBases.documents
.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the document to reload.
Format: |
contentUri | String Optional. The path of gcs source file for reloading document content. For now, only gcs uri is supported. For documents stored in Google Cloud Storage, these URIs must have
the form |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Document, KnowledgeOperationMetadata> | The RPC response. |
// Create client
DocumentsClient documentsClient = DocumentsClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/knowledgeBases/[KNOWLEDGE_BASE]/documents/[DOCUMENT]";
string contentUri = "";
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = documentsClient.ReloadDocument(name, contentUri);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = documentsClient.PollOnceReloadDocument(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
ReloadDocumentAsync(DocumentName, String, CallSettings)
public virtual Task<Operation<Document, KnowledgeOperationMetadata>> ReloadDocumentAsync(DocumentName name, string contentUri, CallSettings callSettings = null)
Reloads the specified document from its specified source, content_uri or content. The previously loaded content of the document will be deleted. Note: Even when the content of the document has not changed, there still may be side effects because of internal implementation changes.
Note: The projects.agent.knowledgeBases.documents
resource is deprecated;
only use projects.knowledgeBases.documents
.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
name | DocumentName Required. The name of the document to reload.
Format: |
contentUri | String Optional. The path of gcs source file for reloading document content. For now, only gcs uri is supported. For documents stored in Google Cloud Storage, these URIs must have
the form |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Document, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
DocumentName name = DocumentName.FromProjectKnowledgeBaseDocument("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]");
string contentUri = "";
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = await documentsClient.ReloadDocumentAsync(name, contentUri);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceReloadDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
ReloadDocumentAsync(DocumentName, String, CancellationToken)
public virtual Task<Operation<Document, KnowledgeOperationMetadata>> ReloadDocumentAsync(DocumentName name, string contentUri, CancellationToken cancellationToken)
Reloads the specified document from its specified source, content_uri or content. The previously loaded content of the document will be deleted. Note: Even when the content of the document has not changed, there still may be side effects because of internal implementation changes.
Note: The projects.agent.knowledgeBases.documents
resource is deprecated;
only use projects.knowledgeBases.documents
.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
name | DocumentName Required. The name of the document to reload.
Format: |
contentUri | String Optional. The path of gcs source file for reloading document content. For now, only gcs uri is supported. For documents stored in Google Cloud Storage, these URIs must have
the form |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Document, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
DocumentName name = DocumentName.FromProjectKnowledgeBaseDocument("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]");
string contentUri = "";
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = await documentsClient.ReloadDocumentAsync(name, contentUri);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceReloadDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
ReloadDocumentAsync(ReloadDocumentRequest, CallSettings)
public virtual Task<Operation<Document, KnowledgeOperationMetadata>> ReloadDocumentAsync(ReloadDocumentRequest request, CallSettings callSettings = null)
Reloads the specified document from its specified source, content_uri or content. The previously loaded content of the document will be deleted. Note: Even when the content of the document has not changed, there still may be side effects because of internal implementation changes.
Note: The projects.agent.knowledgeBases.documents
resource is deprecated;
only use projects.knowledgeBases.documents
.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
request | ReloadDocumentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Document, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
ReloadDocumentRequest request = new ReloadDocumentRequest
{
DocumentName = DocumentName.FromProjectKnowledgeBaseDocument("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]"),
ContentUri = "",
};
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = await documentsClient.ReloadDocumentAsync(request);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceReloadDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
ReloadDocumentAsync(ReloadDocumentRequest, CancellationToken)
public virtual Task<Operation<Document, KnowledgeOperationMetadata>> ReloadDocumentAsync(ReloadDocumentRequest request, CancellationToken cancellationToken)
Reloads the specified document from its specified source, content_uri or content. The previously loaded content of the document will be deleted. Note: Even when the content of the document has not changed, there still may be side effects because of internal implementation changes.
Note: The projects.agent.knowledgeBases.documents
resource is deprecated;
only use projects.knowledgeBases.documents
.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
request | ReloadDocumentRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Document, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
ReloadDocumentRequest request = new ReloadDocumentRequest
{
DocumentName = DocumentName.FromProjectKnowledgeBaseDocument("[PROJECT]", "[KNOWLEDGE_BASE]", "[DOCUMENT]"),
ContentUri = "",
};
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = await documentsClient.ReloadDocumentAsync(request);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceReloadDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
ReloadDocumentAsync(String, String, CallSettings)
public virtual Task<Operation<Document, KnowledgeOperationMetadata>> ReloadDocumentAsync(string name, string contentUri, CallSettings callSettings = null)
Reloads the specified document from its specified source, content_uri or content. The previously loaded content of the document will be deleted. Note: Even when the content of the document has not changed, there still may be side effects because of internal implementation changes.
Note: The projects.agent.knowledgeBases.documents
resource is deprecated;
only use projects.knowledgeBases.documents
.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the document to reload.
Format: |
contentUri | String Optional. The path of gcs source file for reloading document content. For now, only gcs uri is supported. For documents stored in Google Cloud Storage, these URIs must have
the form |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Document, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/knowledgeBases/[KNOWLEDGE_BASE]/documents/[DOCUMENT]";
string contentUri = "";
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = await documentsClient.ReloadDocumentAsync(name, contentUri);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceReloadDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
ReloadDocumentAsync(String, String, CancellationToken)
public virtual Task<Operation<Document, KnowledgeOperationMetadata>> ReloadDocumentAsync(string name, string contentUri, CancellationToken cancellationToken)
Reloads the specified document from its specified source, content_uri or content. The previously loaded content of the document will be deleted. Note: Even when the content of the document has not changed, there still may be side effects because of internal implementation changes.
Note: The projects.agent.knowledgeBases.documents
resource is deprecated;
only use projects.knowledgeBases.documents
.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
name | String Required. The name of the document to reload.
Format: |
contentUri | String Optional. The path of gcs source file for reloading document content. For now, only gcs uri is supported. For documents stored in Google Cloud Storage, these URIs must have
the form |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Document, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/knowledgeBases/[KNOWLEDGE_BASE]/documents/[DOCUMENT]";
string contentUri = "";
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = await documentsClient.ReloadDocumentAsync(name, contentUri);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceReloadDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
ShutdownDefaultChannelsAsync()
public static Task ShutdownDefaultChannelsAsync()
Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.
Returns | |
---|---|
Type | Description |
Task | A task representing the asynchronous shutdown operation. |
After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.
UpdateDocument(Document, FieldMask, CallSettings)
public virtual Operation<Document, KnowledgeOperationMetadata> UpdateDocument(Document document, FieldMask updateMask, CallSettings callSettings = null)
Updates the specified document.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
document | Document Required. The document to update. |
updateMask | FieldMask Optional. Not specified means |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Document, KnowledgeOperationMetadata> | The RPC response. |
// Create client
DocumentsClient documentsClient = DocumentsClient.Create();
// Initialize request argument(s)
Document document = new Document();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = documentsClient.UpdateDocument(document, updateMask);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = documentsClient.PollOnceUpdateDocument(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
UpdateDocument(UpdateDocumentRequest, CallSettings)
public virtual Operation<Document, KnowledgeOperationMetadata> UpdateDocument(UpdateDocumentRequest request, CallSettings callSettings = null)
Updates the specified document.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
request | UpdateDocumentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Operation<Document, KnowledgeOperationMetadata> | The RPC response. |
// Create client
DocumentsClient documentsClient = DocumentsClient.Create();
// Initialize request argument(s)
UpdateDocumentRequest request = new UpdateDocumentRequest
{
Document = new Document(),
UpdateMask = new FieldMask(),
};
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = documentsClient.UpdateDocument(request);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = documentsClient.PollOnceUpdateDocument(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
UpdateDocumentAsync(Document, FieldMask, CallSettings)
public virtual Task<Operation<Document, KnowledgeOperationMetadata>> UpdateDocumentAsync(Document document, FieldMask updateMask, CallSettings callSettings = null)
Updates the specified document.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
document | Document Required. The document to update. |
updateMask | FieldMask Optional. Not specified means |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Document, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
Document document = new Document();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = await documentsClient.UpdateDocumentAsync(document, updateMask);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceUpdateDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
UpdateDocumentAsync(Document, FieldMask, CancellationToken)
public virtual Task<Operation<Document, KnowledgeOperationMetadata>> UpdateDocumentAsync(Document document, FieldMask updateMask, CancellationToken cancellationToken)
Updates the specified document.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
document | Document Required. The document to update. |
updateMask | FieldMask Optional. Not specified means |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Document, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
Document document = new Document();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = await documentsClient.UpdateDocumentAsync(document, updateMask);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceUpdateDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
UpdateDocumentAsync(UpdateDocumentRequest, CallSettings)
public virtual Task<Operation<Document, KnowledgeOperationMetadata>> UpdateDocumentAsync(UpdateDocumentRequest request, CallSettings callSettings = null)
Updates the specified document.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
request | UpdateDocumentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Operation<Document, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
UpdateDocumentRequest request = new UpdateDocumentRequest
{
Document = new Document(),
UpdateMask = new FieldMask(),
};
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = await documentsClient.UpdateDocumentAsync(request);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceUpdateDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}
UpdateDocumentAsync(UpdateDocumentRequest, CancellationToken)
public virtual Task<Operation<Document, KnowledgeOperationMetadata>> UpdateDocumentAsync(UpdateDocumentRequest request, CancellationToken cancellationToken)
Updates the specified document.
Operation <response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]>
Parameters | |
---|---|
Name | Description |
request | UpdateDocumentRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Operation<Document, KnowledgeOperationMetadata>> | A Task containing the RPC response. |
// Create client
DocumentsClient documentsClient = await DocumentsClient.CreateAsync();
// Initialize request argument(s)
UpdateDocumentRequest request = new UpdateDocumentRequest
{
Document = new Document(),
UpdateMask = new FieldMask(),
};
// Make the request
Operation<Document, KnowledgeOperationMetadata> response = await documentsClient.UpdateDocumentAsync(request);
// Poll until the returned long-running operation is complete
Operation<Document, KnowledgeOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Document result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Document, KnowledgeOperationMetadata> retrievedResponse = await documentsClient.PollOnceUpdateDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Document retrievedResult = retrievedResponse.Result;
}