Google Cloud Dialogflow v2 API - Class KnowledgeBasesClient (4.21.0)

public abstract class KnowledgeBasesClient

Reference documentation and code samples for the Google Cloud Dialogflow v2 API class KnowledgeBasesClient.

KnowledgeBases client wrapper, for convenient use.

Inheritance

object > KnowledgeBasesClient

Derived Types

Namespace

Google.Cloud.Dialogflow.V2

Assembly

Google.Cloud.Dialogflow.V2.dll

Remarks

Service for managing [KnowledgeBases][google.cloud.dialogflow.v2.KnowledgeBase].

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the KnowledgeBases service, which is a host of "dialogflow.googleapis.com" and a port of 443.

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default KnowledgeBases scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

GrpcClient

public virtual KnowledgeBases.KnowledgeBasesClient GrpcClient { get; }

The underlying gRPC KnowledgeBases client

Property Value
Type Description
KnowledgeBasesKnowledgeBasesClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
Type Description
LocationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

Methods

Create()

public static KnowledgeBasesClient Create()

Synchronously creates a KnowledgeBasesClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use KnowledgeBasesClientBuilder.

Returns
Type Description
KnowledgeBasesClient

The created KnowledgeBasesClient.

CreateAsync(CancellationToken)

public static Task<KnowledgeBasesClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a KnowledgeBasesClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use KnowledgeBasesClientBuilder.

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskKnowledgeBasesClient

The task representing the created KnowledgeBasesClient.

CreateKnowledgeBase(LocationName, KnowledgeBase, CallSettings)

public virtual KnowledgeBase CreateKnowledgeBase(LocationName parent, KnowledgeBase knowledgeBase, CallSettings callSettings = null)

Creates a knowledge base.

Parameters
Name Description
parent LocationName

Required. The project to create a knowledge base for. Format: projects/<Project ID>/locations/<Location ID>.

knowledgeBase KnowledgeBase

Required. The knowledge base to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
KnowledgeBase

The RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = KnowledgeBasesClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
KnowledgeBase knowledgeBase = new KnowledgeBase();
// Make the request
KnowledgeBase response = knowledgeBasesClient.CreateKnowledgeBase(parent, knowledgeBase);

CreateKnowledgeBase(ProjectName, KnowledgeBase, CallSettings)

public virtual KnowledgeBase CreateKnowledgeBase(ProjectName parent, KnowledgeBase knowledgeBase, CallSettings callSettings = null)

Creates a knowledge base.

Parameters
Name Description
parent ProjectName

Required. The project to create a knowledge base for. Format: projects/<Project ID>/locations/<Location ID>.

knowledgeBase KnowledgeBase

Required. The knowledge base to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
KnowledgeBase

The RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = KnowledgeBasesClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
KnowledgeBase knowledgeBase = new KnowledgeBase();
// Make the request
KnowledgeBase response = knowledgeBasesClient.CreateKnowledgeBase(parent, knowledgeBase);

CreateKnowledgeBase(CreateKnowledgeBaseRequest, CallSettings)

public virtual KnowledgeBase CreateKnowledgeBase(CreateKnowledgeBaseRequest request, CallSettings callSettings = null)

Creates a knowledge base.

Parameters
Name Description
request CreateKnowledgeBaseRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
KnowledgeBase

The RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = KnowledgeBasesClient.Create();
// Initialize request argument(s)
CreateKnowledgeBaseRequest request = new CreateKnowledgeBaseRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    KnowledgeBase = new KnowledgeBase(),
};
// Make the request
KnowledgeBase response = knowledgeBasesClient.CreateKnowledgeBase(request);

CreateKnowledgeBase(string, KnowledgeBase, CallSettings)

public virtual KnowledgeBase CreateKnowledgeBase(string parent, KnowledgeBase knowledgeBase, CallSettings callSettings = null)

Creates a knowledge base.

Parameters
Name Description
parent string

Required. The project to create a knowledge base for. Format: projects/<Project ID>/locations/<Location ID>.

knowledgeBase KnowledgeBase

Required. The knowledge base to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
KnowledgeBase

The RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = KnowledgeBasesClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
KnowledgeBase knowledgeBase = new KnowledgeBase();
// Make the request
KnowledgeBase response = knowledgeBasesClient.CreateKnowledgeBase(parent, knowledgeBase);

CreateKnowledgeBaseAsync(LocationName, KnowledgeBase, CallSettings)

public virtual Task<KnowledgeBase> CreateKnowledgeBaseAsync(LocationName parent, KnowledgeBase knowledgeBase, CallSettings callSettings = null)

Creates a knowledge base.

Parameters
Name Description
parent LocationName

Required. The project to create a knowledge base for. Format: projects/<Project ID>/locations/<Location ID>.

knowledgeBase KnowledgeBase

Required. The knowledge base to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskKnowledgeBase

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
KnowledgeBase knowledgeBase = new KnowledgeBase();
// Make the request
KnowledgeBase response = await knowledgeBasesClient.CreateKnowledgeBaseAsync(parent, knowledgeBase);

CreateKnowledgeBaseAsync(LocationName, KnowledgeBase, CancellationToken)

public virtual Task<KnowledgeBase> CreateKnowledgeBaseAsync(LocationName parent, KnowledgeBase knowledgeBase, CancellationToken cancellationToken)

Creates a knowledge base.

Parameters
Name Description
parent LocationName

Required. The project to create a knowledge base for. Format: projects/<Project ID>/locations/<Location ID>.

knowledgeBase KnowledgeBase

Required. The knowledge base to create.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskKnowledgeBase

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
KnowledgeBase knowledgeBase = new KnowledgeBase();
// Make the request
KnowledgeBase response = await knowledgeBasesClient.CreateKnowledgeBaseAsync(parent, knowledgeBase);

CreateKnowledgeBaseAsync(ProjectName, KnowledgeBase, CallSettings)

public virtual Task<KnowledgeBase> CreateKnowledgeBaseAsync(ProjectName parent, KnowledgeBase knowledgeBase, CallSettings callSettings = null)

Creates a knowledge base.

Parameters
Name Description
parent ProjectName

Required. The project to create a knowledge base for. Format: projects/<Project ID>/locations/<Location ID>.

knowledgeBase KnowledgeBase

Required. The knowledge base to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskKnowledgeBase

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
KnowledgeBase knowledgeBase = new KnowledgeBase();
// Make the request
KnowledgeBase response = await knowledgeBasesClient.CreateKnowledgeBaseAsync(parent, knowledgeBase);

CreateKnowledgeBaseAsync(ProjectName, KnowledgeBase, CancellationToken)

public virtual Task<KnowledgeBase> CreateKnowledgeBaseAsync(ProjectName parent, KnowledgeBase knowledgeBase, CancellationToken cancellationToken)

Creates a knowledge base.

Parameters
Name Description
parent ProjectName

Required. The project to create a knowledge base for. Format: projects/<Project ID>/locations/<Location ID>.

knowledgeBase KnowledgeBase

Required. The knowledge base to create.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskKnowledgeBase

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
KnowledgeBase knowledgeBase = new KnowledgeBase();
// Make the request
KnowledgeBase response = await knowledgeBasesClient.CreateKnowledgeBaseAsync(parent, knowledgeBase);

CreateKnowledgeBaseAsync(CreateKnowledgeBaseRequest, CallSettings)

public virtual Task<KnowledgeBase> CreateKnowledgeBaseAsync(CreateKnowledgeBaseRequest request, CallSettings callSettings = null)

Creates a knowledge base.

Parameters
Name Description
request CreateKnowledgeBaseRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskKnowledgeBase

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
CreateKnowledgeBaseRequest request = new CreateKnowledgeBaseRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    KnowledgeBase = new KnowledgeBase(),
};
// Make the request
KnowledgeBase response = await knowledgeBasesClient.CreateKnowledgeBaseAsync(request);

CreateKnowledgeBaseAsync(CreateKnowledgeBaseRequest, CancellationToken)

public virtual Task<KnowledgeBase> CreateKnowledgeBaseAsync(CreateKnowledgeBaseRequest request, CancellationToken cancellationToken)

Creates a knowledge base.

Parameters
Name Description
request CreateKnowledgeBaseRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskKnowledgeBase

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
CreateKnowledgeBaseRequest request = new CreateKnowledgeBaseRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    KnowledgeBase = new KnowledgeBase(),
};
// Make the request
KnowledgeBase response = await knowledgeBasesClient.CreateKnowledgeBaseAsync(request);

CreateKnowledgeBaseAsync(string, KnowledgeBase, CallSettings)

public virtual Task<KnowledgeBase> CreateKnowledgeBaseAsync(string parent, KnowledgeBase knowledgeBase, CallSettings callSettings = null)

Creates a knowledge base.

Parameters
Name Description
parent string

Required. The project to create a knowledge base for. Format: projects/<Project ID>/locations/<Location ID>.

knowledgeBase KnowledgeBase

Required. The knowledge base to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskKnowledgeBase

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
KnowledgeBase knowledgeBase = new KnowledgeBase();
// Make the request
KnowledgeBase response = await knowledgeBasesClient.CreateKnowledgeBaseAsync(parent, knowledgeBase);

CreateKnowledgeBaseAsync(string, KnowledgeBase, CancellationToken)

public virtual Task<KnowledgeBase> CreateKnowledgeBaseAsync(string parent, KnowledgeBase knowledgeBase, CancellationToken cancellationToken)

Creates a knowledge base.

Parameters
Name Description
parent string

Required. The project to create a knowledge base for. Format: projects/<Project ID>/locations/<Location ID>.

knowledgeBase KnowledgeBase

Required. The knowledge base to create.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskKnowledgeBase

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
KnowledgeBase knowledgeBase = new KnowledgeBase();
// Make the request
KnowledgeBase response = await knowledgeBasesClient.CreateKnowledgeBaseAsync(parent, knowledgeBase);

DeleteKnowledgeBase(DeleteKnowledgeBaseRequest, CallSettings)

public virtual void DeleteKnowledgeBase(DeleteKnowledgeBaseRequest request, CallSettings callSettings = null)

Deletes the specified knowledge base.

Parameters
Name Description
request DeleteKnowledgeBaseRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = KnowledgeBasesClient.Create();
// Initialize request argument(s)
DeleteKnowledgeBaseRequest request = new DeleteKnowledgeBaseRequest
{
    KnowledgeBaseName = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]"),
    Force = false,
};
// Make the request
knowledgeBasesClient.DeleteKnowledgeBase(request);

DeleteKnowledgeBase(KnowledgeBaseName, CallSettings)

public virtual void DeleteKnowledgeBase(KnowledgeBaseName name, CallSettings callSettings = null)

Deletes the specified knowledge base.

Parameters
Name Description
name KnowledgeBaseName

Required. The name of the knowledge base to delete. Format: projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = KnowledgeBasesClient.Create();
// Initialize request argument(s)
KnowledgeBaseName name = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]");
// Make the request
knowledgeBasesClient.DeleteKnowledgeBase(name);

DeleteKnowledgeBase(string, CallSettings)

public virtual void DeleteKnowledgeBase(string name, CallSettings callSettings = null)

Deletes the specified knowledge base.

Parameters
Name Description
name string

Required. The name of the knowledge base to delete. Format: projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = KnowledgeBasesClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/knowledgeBases/[KNOWLEDGE_BASE]";
// Make the request
knowledgeBasesClient.DeleteKnowledgeBase(name);

DeleteKnowledgeBaseAsync(DeleteKnowledgeBaseRequest, CallSettings)

public virtual Task DeleteKnowledgeBaseAsync(DeleteKnowledgeBaseRequest request, CallSettings callSettings = null)

Deletes the specified knowledge base.

Parameters
Name Description
request DeleteKnowledgeBaseRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
DeleteKnowledgeBaseRequest request = new DeleteKnowledgeBaseRequest
{
    KnowledgeBaseName = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]"),
    Force = false,
};
// Make the request
await knowledgeBasesClient.DeleteKnowledgeBaseAsync(request);

DeleteKnowledgeBaseAsync(DeleteKnowledgeBaseRequest, CancellationToken)

public virtual Task DeleteKnowledgeBaseAsync(DeleteKnowledgeBaseRequest request, CancellationToken cancellationToken)

Deletes the specified knowledge base.

Parameters
Name Description
request DeleteKnowledgeBaseRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
DeleteKnowledgeBaseRequest request = new DeleteKnowledgeBaseRequest
{
    KnowledgeBaseName = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]"),
    Force = false,
};
// Make the request
await knowledgeBasesClient.DeleteKnowledgeBaseAsync(request);

DeleteKnowledgeBaseAsync(KnowledgeBaseName, CallSettings)

public virtual Task DeleteKnowledgeBaseAsync(KnowledgeBaseName name, CallSettings callSettings = null)

Deletes the specified knowledge base.

Parameters
Name Description
name KnowledgeBaseName

Required. The name of the knowledge base to delete. Format: projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
KnowledgeBaseName name = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]");
// Make the request
await knowledgeBasesClient.DeleteKnowledgeBaseAsync(name);

DeleteKnowledgeBaseAsync(KnowledgeBaseName, CancellationToken)

public virtual Task DeleteKnowledgeBaseAsync(KnowledgeBaseName name, CancellationToken cancellationToken)

Deletes the specified knowledge base.

Parameters
Name Description
name KnowledgeBaseName

Required. The name of the knowledge base to delete. Format: projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
KnowledgeBaseName name = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]");
// Make the request
await knowledgeBasesClient.DeleteKnowledgeBaseAsync(name);

DeleteKnowledgeBaseAsync(string, CallSettings)

public virtual Task DeleteKnowledgeBaseAsync(string name, CallSettings callSettings = null)

Deletes the specified knowledge base.

Parameters
Name Description
name string

Required. The name of the knowledge base to delete. Format: projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/knowledgeBases/[KNOWLEDGE_BASE]";
// Make the request
await knowledgeBasesClient.DeleteKnowledgeBaseAsync(name);

DeleteKnowledgeBaseAsync(string, CancellationToken)

public virtual Task DeleteKnowledgeBaseAsync(string name, CancellationToken cancellationToken)

Deletes the specified knowledge base.

Parameters
Name Description
name string

Required. The name of the knowledge base to delete. Format: projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/knowledgeBases/[KNOWLEDGE_BASE]";
// Make the request
await knowledgeBasesClient.DeleteKnowledgeBaseAsync(name);

GetKnowledgeBase(GetKnowledgeBaseRequest, CallSettings)

public virtual KnowledgeBase GetKnowledgeBase(GetKnowledgeBaseRequest request, CallSettings callSettings = null)

Retrieves the specified knowledge base.

Parameters
Name Description
request GetKnowledgeBaseRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
KnowledgeBase

The RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = KnowledgeBasesClient.Create();
// Initialize request argument(s)
GetKnowledgeBaseRequest request = new GetKnowledgeBaseRequest
{
    KnowledgeBaseName = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]"),
};
// Make the request
KnowledgeBase response = knowledgeBasesClient.GetKnowledgeBase(request);

GetKnowledgeBase(KnowledgeBaseName, CallSettings)

public virtual KnowledgeBase GetKnowledgeBase(KnowledgeBaseName name, CallSettings callSettings = null)

Retrieves the specified knowledge base.

Parameters
Name Description
name KnowledgeBaseName

Required. The name of the knowledge base to retrieve. Format projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
KnowledgeBase

The RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = KnowledgeBasesClient.Create();
// Initialize request argument(s)
KnowledgeBaseName name = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]");
// Make the request
KnowledgeBase response = knowledgeBasesClient.GetKnowledgeBase(name);

GetKnowledgeBase(string, CallSettings)

public virtual KnowledgeBase GetKnowledgeBase(string name, CallSettings callSettings = null)

Retrieves the specified knowledge base.

Parameters
Name Description
name string

Required. The name of the knowledge base to retrieve. Format projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
KnowledgeBase

The RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = KnowledgeBasesClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/knowledgeBases/[KNOWLEDGE_BASE]";
// Make the request
KnowledgeBase response = knowledgeBasesClient.GetKnowledgeBase(name);

GetKnowledgeBaseAsync(GetKnowledgeBaseRequest, CallSettings)

public virtual Task<KnowledgeBase> GetKnowledgeBaseAsync(GetKnowledgeBaseRequest request, CallSettings callSettings = null)

Retrieves the specified knowledge base.

Parameters
Name Description
request GetKnowledgeBaseRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskKnowledgeBase

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
GetKnowledgeBaseRequest request = new GetKnowledgeBaseRequest
{
    KnowledgeBaseName = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]"),
};
// Make the request
KnowledgeBase response = await knowledgeBasesClient.GetKnowledgeBaseAsync(request);

GetKnowledgeBaseAsync(GetKnowledgeBaseRequest, CancellationToken)

public virtual Task<KnowledgeBase> GetKnowledgeBaseAsync(GetKnowledgeBaseRequest request, CancellationToken cancellationToken)

Retrieves the specified knowledge base.

Parameters
Name Description
request GetKnowledgeBaseRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskKnowledgeBase

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
GetKnowledgeBaseRequest request = new GetKnowledgeBaseRequest
{
    KnowledgeBaseName = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]"),
};
// Make the request
KnowledgeBase response = await knowledgeBasesClient.GetKnowledgeBaseAsync(request);

GetKnowledgeBaseAsync(KnowledgeBaseName, CallSettings)

public virtual Task<KnowledgeBase> GetKnowledgeBaseAsync(KnowledgeBaseName name, CallSettings callSettings = null)

Retrieves the specified knowledge base.

Parameters
Name Description
name KnowledgeBaseName

Required. The name of the knowledge base to retrieve. Format projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskKnowledgeBase

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
KnowledgeBaseName name = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]");
// Make the request
KnowledgeBase response = await knowledgeBasesClient.GetKnowledgeBaseAsync(name);

GetKnowledgeBaseAsync(KnowledgeBaseName, CancellationToken)

public virtual Task<KnowledgeBase> GetKnowledgeBaseAsync(KnowledgeBaseName name, CancellationToken cancellationToken)

Retrieves the specified knowledge base.

Parameters
Name Description
name KnowledgeBaseName

Required. The name of the knowledge base to retrieve. Format projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskKnowledgeBase

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
KnowledgeBaseName name = KnowledgeBaseName.FromProjectKnowledgeBase("[PROJECT]", "[KNOWLEDGE_BASE]");
// Make the request
KnowledgeBase response = await knowledgeBasesClient.GetKnowledgeBaseAsync(name);

GetKnowledgeBaseAsync(string, CallSettings)

public virtual Task<KnowledgeBase> GetKnowledgeBaseAsync(string name, CallSettings callSettings = null)

Retrieves the specified knowledge base.

Parameters
Name Description
name string

Required. The name of the knowledge base to retrieve. Format projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskKnowledgeBase

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/knowledgeBases/[KNOWLEDGE_BASE]";
// Make the request
KnowledgeBase response = await knowledgeBasesClient.GetKnowledgeBaseAsync(name);

GetKnowledgeBaseAsync(string, CancellationToken)

public virtual Task<KnowledgeBase> GetKnowledgeBaseAsync(string name, CancellationToken cancellationToken)

Retrieves the specified knowledge base.

Parameters
Name Description
name string

Required. The name of the knowledge base to retrieve. Format projects/<Project ID>/locations/<Location ID>/knowledgeBases/<Knowledge Base ID>.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskKnowledgeBase

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/knowledgeBases/[KNOWLEDGE_BASE]";
// Make the request
KnowledgeBase response = await knowledgeBasesClient.GetKnowledgeBaseAsync(name);

ListKnowledgeBases(LocationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListKnowledgeBasesResponse, KnowledgeBase> ListKnowledgeBases(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns the list of all knowledge bases of the specified agent.

Parameters
Name Description
parent LocationName

Required. The project to list of knowledge bases for. Format: projects/<Project ID>/locations/<Location ID>.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListKnowledgeBasesResponseKnowledgeBase

A pageable sequence of KnowledgeBase resources.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = KnowledgeBasesClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListKnowledgeBasesResponse, KnowledgeBase> response = knowledgeBasesClient.ListKnowledgeBases(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (KnowledgeBase 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 (ListKnowledgeBasesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (KnowledgeBase 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<KnowledgeBase> 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 (KnowledgeBase 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;

ListKnowledgeBases(ProjectName, string, int?, CallSettings)

public virtual PagedEnumerable<ListKnowledgeBasesResponse, KnowledgeBase> ListKnowledgeBases(ProjectName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns the list of all knowledge bases of the specified agent.

Parameters
Name Description
parent ProjectName

Required. The project to list of knowledge bases for. Format: projects/<Project ID>/locations/<Location ID>.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListKnowledgeBasesResponseKnowledgeBase

A pageable sequence of KnowledgeBase resources.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = KnowledgeBasesClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
// Make the request
PagedEnumerable<ListKnowledgeBasesResponse, KnowledgeBase> response = knowledgeBasesClient.ListKnowledgeBases(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (KnowledgeBase 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 (ListKnowledgeBasesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (KnowledgeBase 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<KnowledgeBase> 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 (KnowledgeBase 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;

ListKnowledgeBases(ListKnowledgeBasesRequest, CallSettings)

public virtual PagedEnumerable<ListKnowledgeBasesResponse, KnowledgeBase> ListKnowledgeBases(ListKnowledgeBasesRequest request, CallSettings callSettings = null)

Returns the list of all knowledge bases of the specified agent.

Parameters
Name Description
request ListKnowledgeBasesRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListKnowledgeBasesResponseKnowledgeBase

A pageable sequence of KnowledgeBase resources.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = KnowledgeBasesClient.Create();
// Initialize request argument(s)
ListKnowledgeBasesRequest request = new ListKnowledgeBasesRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Filter = "",
};
// Make the request
PagedEnumerable<ListKnowledgeBasesResponse, KnowledgeBase> response = knowledgeBasesClient.ListKnowledgeBases(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (KnowledgeBase 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 (ListKnowledgeBasesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (KnowledgeBase 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<KnowledgeBase> 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 (KnowledgeBase 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;

ListKnowledgeBases(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListKnowledgeBasesResponse, KnowledgeBase> ListKnowledgeBases(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns the list of all knowledge bases of the specified agent.

Parameters
Name Description
parent string

Required. The project to list of knowledge bases for. Format: projects/<Project ID>/locations/<Location ID>.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListKnowledgeBasesResponseKnowledgeBase

A pageable sequence of KnowledgeBase resources.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = KnowledgeBasesClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
// Make the request
PagedEnumerable<ListKnowledgeBasesResponse, KnowledgeBase> response = knowledgeBasesClient.ListKnowledgeBases(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (KnowledgeBase 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 (ListKnowledgeBasesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (KnowledgeBase 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<KnowledgeBase> 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 (KnowledgeBase 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;

ListKnowledgeBasesAsync(LocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListKnowledgeBasesResponse, KnowledgeBase> ListKnowledgeBasesAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns the list of all knowledge bases of the specified agent.

Parameters
Name Description
parent LocationName

Required. The project to list of knowledge bases for. Format: projects/<Project ID>/locations/<Location ID>.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListKnowledgeBasesResponseKnowledgeBase

A pageable asynchronous sequence of KnowledgeBase resources.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListKnowledgeBasesResponse, KnowledgeBase> response = knowledgeBasesClient.ListKnowledgeBasesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((KnowledgeBase 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((ListKnowledgeBasesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (KnowledgeBase 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<KnowledgeBase> 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 (KnowledgeBase 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;

ListKnowledgeBasesAsync(ProjectName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListKnowledgeBasesResponse, KnowledgeBase> ListKnowledgeBasesAsync(ProjectName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns the list of all knowledge bases of the specified agent.

Parameters
Name Description
parent ProjectName

Required. The project to list of knowledge bases for. Format: projects/<Project ID>/locations/<Location ID>.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListKnowledgeBasesResponseKnowledgeBase

A pageable asynchronous sequence of KnowledgeBase resources.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
// Make the request
PagedAsyncEnumerable<ListKnowledgeBasesResponse, KnowledgeBase> response = knowledgeBasesClient.ListKnowledgeBasesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((KnowledgeBase 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((ListKnowledgeBasesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (KnowledgeBase 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<KnowledgeBase> 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 (KnowledgeBase 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;

ListKnowledgeBasesAsync(ListKnowledgeBasesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListKnowledgeBasesResponse, KnowledgeBase> ListKnowledgeBasesAsync(ListKnowledgeBasesRequest request, CallSettings callSettings = null)

Returns the list of all knowledge bases of the specified agent.

Parameters
Name Description
request ListKnowledgeBasesRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListKnowledgeBasesResponseKnowledgeBase

A pageable asynchronous sequence of KnowledgeBase resources.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
ListKnowledgeBasesRequest request = new ListKnowledgeBasesRequest
{
    ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListKnowledgeBasesResponse, KnowledgeBase> response = knowledgeBasesClient.ListKnowledgeBasesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((KnowledgeBase 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((ListKnowledgeBasesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (KnowledgeBase 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<KnowledgeBase> 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 (KnowledgeBase 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;

ListKnowledgeBasesAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListKnowledgeBasesResponse, KnowledgeBase> ListKnowledgeBasesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Returns the list of all knowledge bases of the specified agent.

Parameters
Name Description
parent string

Required. The project to list of knowledge bases for. Format: projects/<Project ID>/locations/<Location ID>.

pageToken string

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

pageSize int

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.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListKnowledgeBasesResponseKnowledgeBase

A pageable asynchronous sequence of KnowledgeBase resources.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
// Make the request
PagedAsyncEnumerable<ListKnowledgeBasesResponse, KnowledgeBase> response = knowledgeBasesClient.ListKnowledgeBasesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((KnowledgeBase 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((ListKnowledgeBasesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (KnowledgeBase 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<KnowledgeBase> 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 (KnowledgeBase 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;

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
Type Description
Task

A task representing the asynchronous shutdown operation.

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.

UpdateKnowledgeBase(KnowledgeBase, FieldMask, CallSettings)

public virtual KnowledgeBase UpdateKnowledgeBase(KnowledgeBase knowledgeBase, FieldMask updateMask, CallSettings callSettings = null)

Updates the specified knowledge base.

Parameters
Name Description
knowledgeBase KnowledgeBase

Required. The knowledge base to update.

updateMask FieldMask

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
KnowledgeBase

The RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = KnowledgeBasesClient.Create();
// Initialize request argument(s)
KnowledgeBase knowledgeBase = new KnowledgeBase();
FieldMask updateMask = new FieldMask();
// Make the request
KnowledgeBase response = knowledgeBasesClient.UpdateKnowledgeBase(knowledgeBase, updateMask);

UpdateKnowledgeBase(UpdateKnowledgeBaseRequest, CallSettings)

public virtual KnowledgeBase UpdateKnowledgeBase(UpdateKnowledgeBaseRequest request, CallSettings callSettings = null)

Updates the specified knowledge base.

Parameters
Name Description
request UpdateKnowledgeBaseRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
KnowledgeBase

The RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = KnowledgeBasesClient.Create();
// Initialize request argument(s)
UpdateKnowledgeBaseRequest request = new UpdateKnowledgeBaseRequest
{
    KnowledgeBase = new KnowledgeBase(),
    UpdateMask = new FieldMask(),
};
// Make the request
KnowledgeBase response = knowledgeBasesClient.UpdateKnowledgeBase(request);

UpdateKnowledgeBaseAsync(KnowledgeBase, FieldMask, CallSettings)

public virtual Task<KnowledgeBase> UpdateKnowledgeBaseAsync(KnowledgeBase knowledgeBase, FieldMask updateMask, CallSettings callSettings = null)

Updates the specified knowledge base.

Parameters
Name Description
knowledgeBase KnowledgeBase

Required. The knowledge base to update.

updateMask FieldMask

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskKnowledgeBase

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
KnowledgeBase knowledgeBase = new KnowledgeBase();
FieldMask updateMask = new FieldMask();
// Make the request
KnowledgeBase response = await knowledgeBasesClient.UpdateKnowledgeBaseAsync(knowledgeBase, updateMask);

UpdateKnowledgeBaseAsync(KnowledgeBase, FieldMask, CancellationToken)

public virtual Task<KnowledgeBase> UpdateKnowledgeBaseAsync(KnowledgeBase knowledgeBase, FieldMask updateMask, CancellationToken cancellationToken)

Updates the specified knowledge base.

Parameters
Name Description
knowledgeBase KnowledgeBase

Required. The knowledge base to update.

updateMask FieldMask

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskKnowledgeBase

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
KnowledgeBase knowledgeBase = new KnowledgeBase();
FieldMask updateMask = new FieldMask();
// Make the request
KnowledgeBase response = await knowledgeBasesClient.UpdateKnowledgeBaseAsync(knowledgeBase, updateMask);

UpdateKnowledgeBaseAsync(UpdateKnowledgeBaseRequest, CallSettings)

public virtual Task<KnowledgeBase> UpdateKnowledgeBaseAsync(UpdateKnowledgeBaseRequest request, CallSettings callSettings = null)

Updates the specified knowledge base.

Parameters
Name Description
request UpdateKnowledgeBaseRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskKnowledgeBase

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
UpdateKnowledgeBaseRequest request = new UpdateKnowledgeBaseRequest
{
    KnowledgeBase = new KnowledgeBase(),
    UpdateMask = new FieldMask(),
};
// Make the request
KnowledgeBase response = await knowledgeBasesClient.UpdateKnowledgeBaseAsync(request);

UpdateKnowledgeBaseAsync(UpdateKnowledgeBaseRequest, CancellationToken)

public virtual Task<KnowledgeBase> UpdateKnowledgeBaseAsync(UpdateKnowledgeBaseRequest request, CancellationToken cancellationToken)

Updates the specified knowledge base.

Parameters
Name Description
request UpdateKnowledgeBaseRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskKnowledgeBase

A Task containing the RPC response.

Example
// Create client
KnowledgeBasesClient knowledgeBasesClient = await KnowledgeBasesClient.CreateAsync();
// Initialize request argument(s)
UpdateKnowledgeBaseRequest request = new UpdateKnowledgeBaseRequest
{
    KnowledgeBase = new KnowledgeBase(),
    UpdateMask = new FieldMask(),
};
// Make the request
KnowledgeBase response = await knowledgeBasesClient.UpdateKnowledgeBaseAsync(request);