Class DocumentsClient (3.3.0)

public abstract class DocumentsClient

Documents client wrapper, for convenient use.

Inheritance

Object > DocumentsClient

Derived Types

Namespace

Google.Cloud.Dialogflow.V2

Assembly

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
TypeDescription
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
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default Documents scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

DeleteDocumentOperationsClient

public virtual OperationsClient DeleteDocumentOperationsClient { get; }

The long-running operations client for DeleteDocument.

Property Value
TypeDescription
OperationsClient

GrpcClient

public virtual Documents.DocumentsClient GrpcClient { get; }

The underlying gRPC Documents client

Property Value
TypeDescription
Documents.DocumentsClient

ReloadDocumentOperationsClient

public virtual OperationsClient ReloadDocumentOperationsClient { get; }

The long-running operations client for ReloadDocument.

Property Value
TypeDescription
OperationsClient

UpdateDocumentOperationsClient

public virtual OperationsClient UpdateDocumentOperationsClient { get; }

The long-running operations client for UpdateDocument.

Property Value
TypeDescription
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
TypeDescription
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
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
requestCreateDocumentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Document, KnowledgeOperationMetadata>

The RPC response.

Example
// 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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
parentKnowledgeBaseName

Required. The knowledge base to create a document for. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;.

documentDocument

Required. The document to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Document, KnowledgeOperationMetadata>

The RPC response.

Example
// 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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
parentString

Required. The knowledge base to create a document for. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;.

documentDocument

Required. The document to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Document, KnowledgeOperationMetadata>

The RPC response.

Example
// 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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
requestCreateDocumentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Document, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
requestCreateDocumentRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Document, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
parentKnowledgeBaseName

Required. The knowledge base to create a document for. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;.

documentDocument

Required. The document to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Document, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
parentKnowledgeBaseName

Required. The knowledge base to create a document for. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;.

documentDocument

Required. The document to create.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Document, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
parentString

Required. The knowledge base to create a document for. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;.

documentDocument

Required. The document to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Document, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
parentString

Required. The knowledge base to create a document for. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;.

documentDocument

Required. The document to create.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Document, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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 &lt;response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
requestDeleteDocumentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, KnowledgeOperationMetadata>

The RPC response.

Example
// 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 &lt;response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
nameDocumentName

Required. The name of the document to delete. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;/documents/&amp;lt;Document ID&amp;gt;.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, KnowledgeOperationMetadata>

The RPC response.

Example
// 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 &lt;response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
nameString

Required. The name of the document to delete. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;/documents/&amp;lt;Document ID&amp;gt;.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Empty, KnowledgeOperationMetadata>

The RPC response.

Example
// 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 &lt;response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
requestDeleteDocumentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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 &lt;response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
requestDeleteDocumentRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Empty, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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 &lt;response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
nameDocumentName

Required. The name of the document to delete. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;/documents/&amp;lt;Document ID&amp;gt;.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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 &lt;response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
nameDocumentName

Required. The name of the document to delete. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;/documents/&amp;lt;Document ID&amp;gt;.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Empty, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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 &lt;response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
nameString

Required. The name of the document to delete. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;/documents/&amp;lt;Document ID&amp;gt;.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Empty, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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 &lt;response: [google.protobuf.Empty][google.protobuf.Empty], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
nameString

Required. The name of the document to delete. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;/documents/&amp;lt;Document ID&amp;gt;.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Empty, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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
NameDescription
nameDocumentName

Required. The name of the document to retrieve. Format projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;/documents/&amp;lt;Document ID&amp;gt;.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Document

The RPC response.

Example
// 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
NameDescription
requestGetDocumentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Document

The RPC response.

Example
// 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
NameDescription
nameString

Required. The name of the document to retrieve. Format projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;/documents/&amp;lt;Document ID&amp;gt;.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Document

The RPC response.

Example
// 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
NameDescription
nameDocumentName

Required. The name of the document to retrieve. Format projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;/documents/&amp;lt;Document ID&amp;gt;.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Document>

A Task containing the RPC response.

Example
// 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
NameDescription
nameDocumentName

Required. The name of the document to retrieve. Format projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;/documents/&amp;lt;Document ID&amp;gt;.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Document>

A Task containing the RPC response.

Example
// 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
NameDescription
requestGetDocumentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Document>

A Task containing the RPC response.

Example
// 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
NameDescription
requestGetDocumentRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Document>

A Task containing the RPC response.

Example
// 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
NameDescription
nameString

Required. The name of the document to retrieve. Format projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;/documents/&amp;lt;Document ID&amp;gt;.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Document>

A Task containing the RPC response.

Example
// 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
NameDescription
nameString

Required. The name of the document to retrieve. Format projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;/documents/&amp;lt;Document ID&amp;gt;.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Document>

A Task containing the RPC response.

Example
// 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
NameDescription
parentKnowledgeBaseName

Required. The knowledge base to list all documents for. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListDocumentsResponse, Document>

A pageable sequence of Document resources.

Example
// 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
NameDescription
requestListDocumentsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListDocumentsResponse, Document>

A pageable sequence of Document resources.

Example
// 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
NameDescription
parentString

Required. The knowledge base to list all documents for. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedEnumerable<ListDocumentsResponse, Document>

A pageable sequence of Document resources.

Example
// 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
NameDescription
parentKnowledgeBaseName

Required. The knowledge base to list all documents for. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListDocumentsResponse, Document>

A pageable asynchronous sequence of Document resources.

Example
// 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
NameDescription
requestListDocumentsRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListDocumentsResponse, Document>

A pageable asynchronous sequence of Document resources.

Example
// 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
NameDescription
parentString

Required. The knowledge base to list all documents for. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;.

pageTokenString

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSizeNullable<Int32>

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PagedAsyncEnumerable<ListDocumentsResponse, Document>

A pageable asynchronous sequence of Document resources.

Example
// 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
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
operationNameString

The name of a previously invoked operation. Must not be null or empty.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
nameDocumentName

Required. The name of the document to reload. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;/documents/&amp;lt;Document ID&amp;gt;

contentUriString

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 gs://{bucket-name}/{object-name}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Document, KnowledgeOperationMetadata>

The RPC response.

Example
// 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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
requestReloadDocumentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Document, KnowledgeOperationMetadata>

The RPC response.

Example
// 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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
nameString

Required. The name of the document to reload. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;/documents/&amp;lt;Document ID&amp;gt;

contentUriString

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 gs://{bucket-name}/{object-name}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Document, KnowledgeOperationMetadata>

The RPC response.

Example
// 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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
nameDocumentName

Required. The name of the document to reload. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;/documents/&amp;lt;Document ID&amp;gt;

contentUriString

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 gs://{bucket-name}/{object-name}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Document, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
nameDocumentName

Required. The name of the document to reload. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;/documents/&amp;lt;Document ID&amp;gt;

contentUriString

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 gs://{bucket-name}/{object-name}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Document, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
requestReloadDocumentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Document, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
requestReloadDocumentRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Document, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
nameString

Required. The name of the document to reload. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;/documents/&amp;lt;Document ID&amp;gt;

contentUriString

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 gs://{bucket-name}/{object-name}.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Document, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
nameString

Required. The name of the document to reload. Format: projects/{Project ID}/locations/{Location ID&amp;gt;/knowledgeBases/&amp;lt;Knowledge Base ID&amp;gt;/documents/&amp;lt;Document ID&amp;gt;

contentUriString

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 gs://{bucket-name}/{object-name}.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Document, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
documentDocument

Required. The document to update.

updateMaskFieldMask

Optional. Not specified means update all. Currently, only display_name can be updated, an InvalidArgument will be returned for attempting to update other fields.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Document, KnowledgeOperationMetadata>

The RPC response.

Example
// 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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
requestUpdateDocumentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Operation<Document, KnowledgeOperationMetadata>

The RPC response.

Example
// 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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
documentDocument

Required. The document to update.

updateMaskFieldMask

Optional. Not specified means update all. Currently, only display_name can be updated, an InvalidArgument will be returned for attempting to update other fields.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Document, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
documentDocument

Required. The document to update.

updateMaskFieldMask

Optional. Not specified means update all. Currently, only display_name can be updated, an InvalidArgument will be returned for attempting to update other fields.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Document, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
requestUpdateDocumentRequest

The request object containing all of the parameters for the API call.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<Operation<Document, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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 &lt;response: [Document][google.cloud.dialogflow.v2.Document], metadata: [KnowledgeOperationMetadata][google.cloud.dialogflow.v2.KnowledgeOperationMetadata]&gt;

Parameters
NameDescription
requestUpdateDocumentRequest

The request object containing all of the parameters for the API call.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<Operation<Document, KnowledgeOperationMetadata>>

A Task containing the RPC response.

Example
// 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;
}