Discovery Engine v1beta API - Class AssistantServiceClient (1.0.0-beta24)

public abstract class AssistantServiceClient

Reference documentation and code samples for the Discovery Engine v1beta API class AssistantServiceClient.

AssistantService client wrapper, for convenient use.

Inheritance

object > AssistantServiceClient

Namespace

Google.Cloud.DiscoveryEngine.V1Beta

Assembly

Google.Cloud.DiscoveryEngine.V1Beta.dll

Remarks

Service for managing Assistant configuration and assisting users.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default AssistantService scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

GrpcClient

public virtual AssistantService.AssistantServiceClient GrpcClient { get; }

The underlying gRPC AssistantService client

Property Value
Type Description
AssistantServiceAssistantServiceClient

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 AssistantServiceClient Create()

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

Returns
Type Description
AssistantServiceClient

The created AssistantServiceClient.

CreateAssistant(CreateAssistantRequest, CallSettings)

public virtual Assistant CreateAssistant(CreateAssistantRequest request, CallSettings callSettings = null)

Creates an [Assistant][google.cloud.discoveryengine.v1beta.Assistant].

Parameters
Name Description
request CreateAssistantRequest

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
Assistant

The RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
CreateAssistantRequest request = new CreateAssistantRequest
{
    ParentAsEngineName = EngineName.FromProjectLocationCollectionEngine("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]"),
    Assistant = new Assistant(),
    AssistantId = "",
};
// Make the request
Assistant response = assistantServiceClient.CreateAssistant(request);

CreateAssistantAsync(CreateAssistantRequest, CallSettings)

public virtual Task<Assistant> CreateAssistantAsync(CreateAssistantRequest request, CallSettings callSettings = null)

Creates an [Assistant][google.cloud.discoveryengine.v1beta.Assistant].

Parameters
Name Description
request CreateAssistantRequest

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
TaskAssistant

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAssistantRequest request = new CreateAssistantRequest
{
    ParentAsEngineName = EngineName.FromProjectLocationCollectionEngine("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]"),
    Assistant = new Assistant(),
    AssistantId = "",
};
// Make the request
Assistant response = await assistantServiceClient.CreateAssistantAsync(request);

CreateAssistantAsync(CreateAssistantRequest, CancellationToken)

public virtual Task<Assistant> CreateAssistantAsync(CreateAssistantRequest request, CancellationToken cancellationToken)

Creates an [Assistant][google.cloud.discoveryengine.v1beta.Assistant].

Parameters
Name Description
request CreateAssistantRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAssistant

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAssistantRequest request = new CreateAssistantRequest
{
    ParentAsEngineName = EngineName.FromProjectLocationCollectionEngine("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]"),
    Assistant = new Assistant(),
    AssistantId = "",
};
// Make the request
Assistant response = await assistantServiceClient.CreateAssistantAsync(request);

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskAssistantServiceClient

The task representing the created AssistantServiceClient.

DeleteAssistant(AssistantName, CallSettings)

public virtual void DeleteAssistant(AssistantName name, CallSettings callSettings = null)

Deletes an [Assistant][google.cloud.discoveryengine.v1beta.Assistant].

Parameters
Name Description
name AssistantName

Required. Resource name of [Assistant][google.cloud.discoveryengine.v1beta.Assistant]. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}

If the caller does not have permission to delete the [Assistant][google.cloud.discoveryengine.v1beta.Assistant], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [Assistant][google.cloud.discoveryengine.v1beta.Assistant] to delete does not exist, a NOT_FOUND error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
AssistantName name = AssistantName.FromProjectLocationCollectionEngineAssistant("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]", "[ASSISTANT]");
// Make the request
assistantServiceClient.DeleteAssistant(name);

DeleteAssistant(DeleteAssistantRequest, CallSettings)

public virtual void DeleteAssistant(DeleteAssistantRequest request, CallSettings callSettings = null)

Deletes an [Assistant][google.cloud.discoveryengine.v1beta.Assistant].

Parameters
Name Description
request DeleteAssistantRequest

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
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
DeleteAssistantRequest request = new DeleteAssistantRequest
{
    AssistantName = AssistantName.FromProjectLocationCollectionEngineAssistant("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]", "[ASSISTANT]"),
};
// Make the request
assistantServiceClient.DeleteAssistant(request);

DeleteAssistant(string, CallSettings)

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

Deletes an [Assistant][google.cloud.discoveryengine.v1beta.Assistant].

Parameters
Name Description
name string

Required. Resource name of [Assistant][google.cloud.discoveryengine.v1beta.Assistant]. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}

If the caller does not have permission to delete the [Assistant][google.cloud.discoveryengine.v1beta.Assistant], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [Assistant][google.cloud.discoveryengine.v1beta.Assistant] to delete does not exist, a NOT_FOUND error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]/engines/[ENGINE]/assistants/[ASSISTANT]";
// Make the request
assistantServiceClient.DeleteAssistant(name);

DeleteAssistantAsync(AssistantName, CallSettings)

public virtual Task DeleteAssistantAsync(AssistantName name, CallSettings callSettings = null)

Deletes an [Assistant][google.cloud.discoveryengine.v1beta.Assistant].

Parameters
Name Description
name AssistantName

Required. Resource name of [Assistant][google.cloud.discoveryengine.v1beta.Assistant]. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}

If the caller does not have permission to delete the [Assistant][google.cloud.discoveryengine.v1beta.Assistant], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [Assistant][google.cloud.discoveryengine.v1beta.Assistant] to delete does not exist, a NOT_FOUND error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
AssistantName name = AssistantName.FromProjectLocationCollectionEngineAssistant("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]", "[ASSISTANT]");
// Make the request
await assistantServiceClient.DeleteAssistantAsync(name);

DeleteAssistantAsync(AssistantName, CancellationToken)

public virtual Task DeleteAssistantAsync(AssistantName name, CancellationToken cancellationToken)

Deletes an [Assistant][google.cloud.discoveryengine.v1beta.Assistant].

Parameters
Name Description
name AssistantName

Required. Resource name of [Assistant][google.cloud.discoveryengine.v1beta.Assistant]. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}

If the caller does not have permission to delete the [Assistant][google.cloud.discoveryengine.v1beta.Assistant], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [Assistant][google.cloud.discoveryengine.v1beta.Assistant] to delete does not exist, a NOT_FOUND error is returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
AssistantName name = AssistantName.FromProjectLocationCollectionEngineAssistant("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]", "[ASSISTANT]");
// Make the request
await assistantServiceClient.DeleteAssistantAsync(name);

DeleteAssistantAsync(DeleteAssistantRequest, CallSettings)

public virtual Task DeleteAssistantAsync(DeleteAssistantRequest request, CallSettings callSettings = null)

Deletes an [Assistant][google.cloud.discoveryengine.v1beta.Assistant].

Parameters
Name Description
request DeleteAssistantRequest

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
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAssistantRequest request = new DeleteAssistantRequest
{
    AssistantName = AssistantName.FromProjectLocationCollectionEngineAssistant("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]", "[ASSISTANT]"),
};
// Make the request
await assistantServiceClient.DeleteAssistantAsync(request);

DeleteAssistantAsync(DeleteAssistantRequest, CancellationToken)

public virtual Task DeleteAssistantAsync(DeleteAssistantRequest request, CancellationToken cancellationToken)

Deletes an [Assistant][google.cloud.discoveryengine.v1beta.Assistant].

Parameters
Name Description
request DeleteAssistantRequest

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
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAssistantRequest request = new DeleteAssistantRequest
{
    AssistantName = AssistantName.FromProjectLocationCollectionEngineAssistant("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]", "[ASSISTANT]"),
};
// Make the request
await assistantServiceClient.DeleteAssistantAsync(request);

DeleteAssistantAsync(string, CallSettings)

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

Deletes an [Assistant][google.cloud.discoveryengine.v1beta.Assistant].

Parameters
Name Description
name string

Required. Resource name of [Assistant][google.cloud.discoveryengine.v1beta.Assistant]. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}

If the caller does not have permission to delete the [Assistant][google.cloud.discoveryengine.v1beta.Assistant], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [Assistant][google.cloud.discoveryengine.v1beta.Assistant] to delete does not exist, a NOT_FOUND error is returned.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]/engines/[ENGINE]/assistants/[ASSISTANT]";
// Make the request
await assistantServiceClient.DeleteAssistantAsync(name);

DeleteAssistantAsync(string, CancellationToken)

public virtual Task DeleteAssistantAsync(string name, CancellationToken cancellationToken)

Deletes an [Assistant][google.cloud.discoveryengine.v1beta.Assistant].

Parameters
Name Description
name string

Required. Resource name of [Assistant][google.cloud.discoveryengine.v1beta.Assistant]. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}

If the caller does not have permission to delete the [Assistant][google.cloud.discoveryengine.v1beta.Assistant], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [Assistant][google.cloud.discoveryengine.v1beta.Assistant] to delete does not exist, a NOT_FOUND error is returned.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]/engines/[ENGINE]/assistants/[ASSISTANT]";
// Make the request
await assistantServiceClient.DeleteAssistantAsync(name);

GetAssistant(AssistantName, CallSettings)

public virtual Assistant GetAssistant(AssistantName name, CallSettings callSettings = null)

Gets an [Assistant][google.cloud.discoveryengine.v1beta.Assistant].

Parameters
Name Description
name AssistantName

Required. Resource name of [Assistant][google.cloud.discoveryengine.v1beta.Assistant]. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Assistant

The RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
AssistantName name = AssistantName.FromProjectLocationCollectionEngineAssistant("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]", "[ASSISTANT]");
// Make the request
Assistant response = assistantServiceClient.GetAssistant(name);

GetAssistant(GetAssistantRequest, CallSettings)

public virtual Assistant GetAssistant(GetAssistantRequest request, CallSettings callSettings = null)

Gets an [Assistant][google.cloud.discoveryengine.v1beta.Assistant].

Parameters
Name Description
request GetAssistantRequest

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
Assistant

The RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
GetAssistantRequest request = new GetAssistantRequest
{
    AssistantName = AssistantName.FromProjectLocationCollectionEngineAssistant("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]", "[ASSISTANT]"),
};
// Make the request
Assistant response = assistantServiceClient.GetAssistant(request);

GetAssistant(string, CallSettings)

public virtual Assistant GetAssistant(string name, CallSettings callSettings = null)

Gets an [Assistant][google.cloud.discoveryengine.v1beta.Assistant].

Parameters
Name Description
name string

Required. Resource name of [Assistant][google.cloud.discoveryengine.v1beta.Assistant]. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Assistant

The RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]/engines/[ENGINE]/assistants/[ASSISTANT]";
// Make the request
Assistant response = assistantServiceClient.GetAssistant(name);

GetAssistantAsync(AssistantName, CallSettings)

public virtual Task<Assistant> GetAssistantAsync(AssistantName name, CallSettings callSettings = null)

Gets an [Assistant][google.cloud.discoveryengine.v1beta.Assistant].

Parameters
Name Description
name AssistantName

Required. Resource name of [Assistant][google.cloud.discoveryengine.v1beta.Assistant]. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAssistant

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
AssistantName name = AssistantName.FromProjectLocationCollectionEngineAssistant("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]", "[ASSISTANT]");
// Make the request
Assistant response = await assistantServiceClient.GetAssistantAsync(name);

GetAssistantAsync(AssistantName, CancellationToken)

public virtual Task<Assistant> GetAssistantAsync(AssistantName name, CancellationToken cancellationToken)

Gets an [Assistant][google.cloud.discoveryengine.v1beta.Assistant].

Parameters
Name Description
name AssistantName

Required. Resource name of [Assistant][google.cloud.discoveryengine.v1beta.Assistant]. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAssistant

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
AssistantName name = AssistantName.FromProjectLocationCollectionEngineAssistant("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]", "[ASSISTANT]");
// Make the request
Assistant response = await assistantServiceClient.GetAssistantAsync(name);

GetAssistantAsync(GetAssistantRequest, CallSettings)

public virtual Task<Assistant> GetAssistantAsync(GetAssistantRequest request, CallSettings callSettings = null)

Gets an [Assistant][google.cloud.discoveryengine.v1beta.Assistant].

Parameters
Name Description
request GetAssistantRequest

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
TaskAssistant

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
GetAssistantRequest request = new GetAssistantRequest
{
    AssistantName = AssistantName.FromProjectLocationCollectionEngineAssistant("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]", "[ASSISTANT]"),
};
// Make the request
Assistant response = await assistantServiceClient.GetAssistantAsync(request);

GetAssistantAsync(GetAssistantRequest, CancellationToken)

public virtual Task<Assistant> GetAssistantAsync(GetAssistantRequest request, CancellationToken cancellationToken)

Gets an [Assistant][google.cloud.discoveryengine.v1beta.Assistant].

Parameters
Name Description
request GetAssistantRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAssistant

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
GetAssistantRequest request = new GetAssistantRequest
{
    AssistantName = AssistantName.FromProjectLocationCollectionEngineAssistant("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]", "[ASSISTANT]"),
};
// Make the request
Assistant response = await assistantServiceClient.GetAssistantAsync(request);

GetAssistantAsync(string, CallSettings)

public virtual Task<Assistant> GetAssistantAsync(string name, CallSettings callSettings = null)

Gets an [Assistant][google.cloud.discoveryengine.v1beta.Assistant].

Parameters
Name Description
name string

Required. Resource name of [Assistant][google.cloud.discoveryengine.v1beta.Assistant]. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAssistant

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]/engines/[ENGINE]/assistants/[ASSISTANT]";
// Make the request
Assistant response = await assistantServiceClient.GetAssistantAsync(name);

GetAssistantAsync(string, CancellationToken)

public virtual Task<Assistant> GetAssistantAsync(string name, CancellationToken cancellationToken)

Gets an [Assistant][google.cloud.discoveryengine.v1beta.Assistant].

Parameters
Name Description
name string

Required. Resource name of [Assistant][google.cloud.discoveryengine.v1beta.Assistant]. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAssistant

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]/engines/[ENGINE]/assistants/[ASSISTANT]";
// Make the request
Assistant response = await assistantServiceClient.GetAssistantAsync(name);

ListAssistants(EngineName, string, int?, CallSettings)

public virtual PagedEnumerable<ListAssistantsResponse, Assistant> ListAssistants(EngineName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all [Assistant][google.cloud.discoveryengine.v1beta.Assistant]s under an [Engine][google.cloud.discoveryengine.v1beta.Engine].

Parameters
Name Description
parent EngineName

Required. The parent resource name. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}

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
PagedEnumerableListAssistantsResponseAssistant

A pageable sequence of Assistant resources.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
EngineName parent = EngineName.FromProjectLocationCollectionEngine("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]");
// Make the request
PagedEnumerable<ListAssistantsResponse, Assistant> response = assistantServiceClient.ListAssistants(parent);

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

ListAssistants(ListAssistantsRequest, CallSettings)

public virtual PagedEnumerable<ListAssistantsResponse, Assistant> ListAssistants(ListAssistantsRequest request, CallSettings callSettings = null)

Lists all [Assistant][google.cloud.discoveryengine.v1beta.Assistant]s under an [Engine][google.cloud.discoveryengine.v1beta.Engine].

Parameters
Name Description
request ListAssistantsRequest

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
PagedEnumerableListAssistantsResponseAssistant

A pageable sequence of Assistant resources.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
ListAssistantsRequest request = new ListAssistantsRequest
{
    ParentAsEngineName = EngineName.FromProjectLocationCollectionEngine("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]"),
};
// Make the request
PagedEnumerable<ListAssistantsResponse, Assistant> response = assistantServiceClient.ListAssistants(request);

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

ListAssistants(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListAssistantsResponse, Assistant> ListAssistants(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all [Assistant][google.cloud.discoveryengine.v1beta.Assistant]s under an [Engine][google.cloud.discoveryengine.v1beta.Engine].

Parameters
Name Description
parent string

Required. The parent resource name. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}

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
PagedEnumerableListAssistantsResponseAssistant

A pageable sequence of Assistant resources.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]/engines/[ENGINE]";
// Make the request
PagedEnumerable<ListAssistantsResponse, Assistant> response = assistantServiceClient.ListAssistants(parent);

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

ListAssistantsAsync(EngineName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListAssistantsResponse, Assistant> ListAssistantsAsync(EngineName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all [Assistant][google.cloud.discoveryengine.v1beta.Assistant]s under an [Engine][google.cloud.discoveryengine.v1beta.Engine].

Parameters
Name Description
parent EngineName

Required. The parent resource name. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}

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
PagedAsyncEnumerableListAssistantsResponseAssistant

A pageable asynchronous sequence of Assistant resources.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
EngineName parent = EngineName.FromProjectLocationCollectionEngine("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]");
// Make the request
PagedAsyncEnumerable<ListAssistantsResponse, Assistant> response = assistantServiceClient.ListAssistantsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await foreach (Assistant item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListAssistantsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Assistant 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<Assistant> 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 (Assistant 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;

ListAssistantsAsync(ListAssistantsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListAssistantsResponse, Assistant> ListAssistantsAsync(ListAssistantsRequest request, CallSettings callSettings = null)

Lists all [Assistant][google.cloud.discoveryengine.v1beta.Assistant]s under an [Engine][google.cloud.discoveryengine.v1beta.Engine].

Parameters
Name Description
request ListAssistantsRequest

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
PagedAsyncEnumerableListAssistantsResponseAssistant

A pageable asynchronous sequence of Assistant resources.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
ListAssistantsRequest request = new ListAssistantsRequest
{
    ParentAsEngineName = EngineName.FromProjectLocationCollectionEngine("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]"),
};
// Make the request
PagedAsyncEnumerable<ListAssistantsResponse, Assistant> response = assistantServiceClient.ListAssistantsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await foreach (Assistant item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListAssistantsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Assistant 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<Assistant> 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 (Assistant 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;

ListAssistantsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListAssistantsResponse, Assistant> ListAssistantsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all [Assistant][google.cloud.discoveryengine.v1beta.Assistant]s under an [Engine][google.cloud.discoveryengine.v1beta.Engine].

Parameters
Name Description
parent string

Required. The parent resource name. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}

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
PagedAsyncEnumerableListAssistantsResponseAssistant

A pageable asynchronous sequence of Assistant resources.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/collections/[COLLECTION]/engines/[ENGINE]";
// Make the request
PagedAsyncEnumerable<ListAssistantsResponse, Assistant> response = assistantServiceClient.ListAssistantsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await foreach (Assistant item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
await foreach (ListAssistantsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Assistant 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<Assistant> 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 (Assistant 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.

StreamAssist(StreamAssistRequest, CallSettings)

public virtual AssistantServiceClient.StreamAssistStream StreamAssist(StreamAssistRequest request, CallSettings callSettings = null)

Assists the user with a query in a streaming fashion.

Parameters
Name Description
request StreamAssistRequest

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
AssistantServiceClientStreamAssistStream

The server stream.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
StreamAssistRequest request = new StreamAssistRequest
{
    AssistantName = AssistantName.FromProjectLocationCollectionEngineAssistant("[PROJECT]", "[LOCATION]", "[COLLECTION]", "[ENGINE]", "[ASSISTANT]"),
    Query = new Query(),
    SessionAsSessionName = SessionName.FromProjectLocationDataStoreSession("[PROJECT]", "[LOCATION]", "[DATA_STORE]", "[SESSION]"),
    UserMetadata = new AssistUserMetadata(),
    ToolsSpec = new StreamAssistRequest.Types.ToolsSpec(),
    GenerationSpec = new StreamAssistRequest.Types.GenerationSpec(),
};
// Make the request, returning a streaming response
using AssistantServiceClient.StreamAssistStream response = assistantServiceClient.StreamAssist(request);

// Read streaming responses from server until complete
// Note that C# 8 code can use await foreach
AsyncResponseStream<StreamAssistResponse> responseStream = response.GetResponseStream();
while (await responseStream.MoveNextAsync())
{
    StreamAssistResponse responseItem = responseStream.Current;
    // Do something with streamed response
}
// The response stream has completed

UpdateAssistant(Assistant, FieldMask, CallSettings)

public virtual Assistant UpdateAssistant(Assistant assistant, FieldMask updateMask, CallSettings callSettings = null)

Updates an [Assistant][google.cloud.discoveryengine.v1beta.Assistant]

Parameters
Name Description
assistant Assistant

Required. The [Assistant][google.cloud.discoveryengine.v1beta.Assistant] to update.

The [Assistant][google.cloud.discoveryengine.v1beta.Assistant]'s name field is used to identify the [Assistant][google.cloud.discoveryengine.v1beta.Assistant] to update. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}

If the caller does not have permission to update the [Assistant][google.cloud.discoveryengine.v1beta.Assistant], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [Assistant][google.cloud.discoveryengine.v1beta.Assistant] to update does not exist, a NOT_FOUND error is returned.

updateMask FieldMask

The list of fields to update.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Assistant

The RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
Assistant assistant = new Assistant();
FieldMask updateMask = new FieldMask();
// Make the request
Assistant response = assistantServiceClient.UpdateAssistant(assistant, updateMask);

UpdateAssistant(UpdateAssistantRequest, CallSettings)

public virtual Assistant UpdateAssistant(UpdateAssistantRequest request, CallSettings callSettings = null)

Updates an [Assistant][google.cloud.discoveryengine.v1beta.Assistant]

Parameters
Name Description
request UpdateAssistantRequest

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
Assistant

The RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = AssistantServiceClient.Create();
// Initialize request argument(s)
UpdateAssistantRequest request = new UpdateAssistantRequest
{
    Assistant = new Assistant(),
    UpdateMask = new FieldMask(),
};
// Make the request
Assistant response = assistantServiceClient.UpdateAssistant(request);

UpdateAssistantAsync(Assistant, FieldMask, CallSettings)

public virtual Task<Assistant> UpdateAssistantAsync(Assistant assistant, FieldMask updateMask, CallSettings callSettings = null)

Updates an [Assistant][google.cloud.discoveryengine.v1beta.Assistant]

Parameters
Name Description
assistant Assistant

Required. The [Assistant][google.cloud.discoveryengine.v1beta.Assistant] to update.

The [Assistant][google.cloud.discoveryengine.v1beta.Assistant]'s name field is used to identify the [Assistant][google.cloud.discoveryengine.v1beta.Assistant] to update. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}

If the caller does not have permission to update the [Assistant][google.cloud.discoveryengine.v1beta.Assistant], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [Assistant][google.cloud.discoveryengine.v1beta.Assistant] to update does not exist, a NOT_FOUND error is returned.

updateMask FieldMask

The list of fields to update.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAssistant

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
Assistant assistant = new Assistant();
FieldMask updateMask = new FieldMask();
// Make the request
Assistant response = await assistantServiceClient.UpdateAssistantAsync(assistant, updateMask);

UpdateAssistantAsync(Assistant, FieldMask, CancellationToken)

public virtual Task<Assistant> UpdateAssistantAsync(Assistant assistant, FieldMask updateMask, CancellationToken cancellationToken)

Updates an [Assistant][google.cloud.discoveryengine.v1beta.Assistant]

Parameters
Name Description
assistant Assistant

Required. The [Assistant][google.cloud.discoveryengine.v1beta.Assistant] to update.

The [Assistant][google.cloud.discoveryengine.v1beta.Assistant]'s name field is used to identify the [Assistant][google.cloud.discoveryengine.v1beta.Assistant] to update. Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/assistants/{assistant}

If the caller does not have permission to update the [Assistant][google.cloud.discoveryengine.v1beta.Assistant], regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

If the [Assistant][google.cloud.discoveryengine.v1beta.Assistant] to update does not exist, a NOT_FOUND error is returned.

updateMask FieldMask

The list of fields to update.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAssistant

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
Assistant assistant = new Assistant();
FieldMask updateMask = new FieldMask();
// Make the request
Assistant response = await assistantServiceClient.UpdateAssistantAsync(assistant, updateMask);

UpdateAssistantAsync(UpdateAssistantRequest, CallSettings)

public virtual Task<Assistant> UpdateAssistantAsync(UpdateAssistantRequest request, CallSettings callSettings = null)

Updates an [Assistant][google.cloud.discoveryengine.v1beta.Assistant]

Parameters
Name Description
request UpdateAssistantRequest

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
TaskAssistant

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateAssistantRequest request = new UpdateAssistantRequest
{
    Assistant = new Assistant(),
    UpdateMask = new FieldMask(),
};
// Make the request
Assistant response = await assistantServiceClient.UpdateAssistantAsync(request);

UpdateAssistantAsync(UpdateAssistantRequest, CancellationToken)

public virtual Task<Assistant> UpdateAssistantAsync(UpdateAssistantRequest request, CancellationToken cancellationToken)

Updates an [Assistant][google.cloud.discoveryengine.v1beta.Assistant]

Parameters
Name Description
request UpdateAssistantRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAssistant

A Task containing the RPC response.

Example
// Create client
AssistantServiceClient assistantServiceClient = await AssistantServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateAssistantRequest request = new UpdateAssistantRequest
{
    Assistant = new Assistant(),
    UpdateMask = new FieldMask(),
};
// Make the request
Assistant response = await assistantServiceClient.UpdateAssistantAsync(request);