Google Cloud Dialogflow v2beta1 API - Class ToolsClient (1.0.0-beta24)

public abstract class ToolsClient

Reference documentation and code samples for the Google Cloud Dialogflow v2beta1 API class ToolsClient.

Tools client wrapper, for convenient use.

Inheritance

object > ToolsClient

Derived Types

Namespace

Google.Cloud.Dialogflow.V2Beta1

Assembly

Google.Cloud.Dialogflow.V2Beta1.dll

Remarks

Tool Service for LLM powered Agent Assist. Tools can be used to interact with remote APIs (e.g. fetching orders) to retrieve additional information as input to LLM.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the Tools 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 Tools scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

GrpcClient

public virtual Tools.ToolsClient GrpcClient { get; }

The underlying gRPC Tools client

Property Value
Type Description
ToolsToolsClient

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

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

Returns
Type Description
ToolsClient

The created ToolsClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskToolsClient

The task representing the created ToolsClient.

CreateTool(LocationName, Tool, string, CallSettings)

public virtual Tool CreateTool(LocationName parent, Tool tool, string toolId, CallSettings callSettings = null)

Creates a tool.

Parameters
Name Description
parent LocationName

Required. The project/location to create tool for. Format: projects/<Project ID>/locations/<Location ID>

tool Tool

Required. The tool to create.

toolId string

Optional. The ID to use for the tool, which will become the final component of the tool's resource name.

The tool ID must be compliant with the regression formula [a-zA-Z][a-zA-Z0-9_-]* with the characters length in range of [3,64]. If the field is not provide, an Id will be auto-generated. If the field is provided, the caller is responsible for

  1. the uniqueness of the ID, otherwise the request will be rejected.
  2. the consistency for whether to use custom ID or not under a project to better ensure uniqueness.
callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Tool

The RPC response.

Example
// Create client
ToolsClient toolsClient = ToolsClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Tool tool = new Tool();
string toolId = "";
// Make the request
Tool response = toolsClient.CreateTool(parent, tool, toolId);

CreateTool(CreateToolRequest, CallSettings)

public virtual Tool CreateTool(CreateToolRequest request, CallSettings callSettings = null)

Creates a tool.

Parameters
Name Description
request CreateToolRequest

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
Tool

The RPC response.

Example
// Create client
ToolsClient toolsClient = ToolsClient.Create();
// Initialize request argument(s)
CreateToolRequest request = new CreateToolRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Tool = new Tool(),
    ToolId = "",
};
// Make the request
Tool response = toolsClient.CreateTool(request);

CreateTool(string, Tool, string, CallSettings)

public virtual Tool CreateTool(string parent, Tool tool, string toolId, CallSettings callSettings = null)

Creates a tool.

Parameters
Name Description
parent string

Required. The project/location to create tool for. Format: projects/<Project ID>/locations/<Location ID>

tool Tool

Required. The tool to create.

toolId string

Optional. The ID to use for the tool, which will become the final component of the tool's resource name.

The tool ID must be compliant with the regression formula [a-zA-Z][a-zA-Z0-9_-]* with the characters length in range of [3,64]. If the field is not provide, an Id will be auto-generated. If the field is provided, the caller is responsible for

  1. the uniqueness of the ID, otherwise the request will be rejected.
  2. the consistency for whether to use custom ID or not under a project to better ensure uniqueness.
callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Tool

The RPC response.

Example
// Create client
ToolsClient toolsClient = ToolsClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Tool tool = new Tool();
string toolId = "";
// Make the request
Tool response = toolsClient.CreateTool(parent, tool, toolId);

CreateToolAsync(LocationName, Tool, string, CallSettings)

public virtual Task<Tool> CreateToolAsync(LocationName parent, Tool tool, string toolId, CallSettings callSettings = null)

Creates a tool.

Parameters
Name Description
parent LocationName

Required. The project/location to create tool for. Format: projects/<Project ID>/locations/<Location ID>

tool Tool

Required. The tool to create.

toolId string

Optional. The ID to use for the tool, which will become the final component of the tool's resource name.

The tool ID must be compliant with the regression formula [a-zA-Z][a-zA-Z0-9_-]* with the characters length in range of [3,64]. If the field is not provide, an Id will be auto-generated. If the field is provided, the caller is responsible for

  1. the uniqueness of the ID, otherwise the request will be rejected.
  2. the consistency for whether to use custom ID or not under a project to better ensure uniqueness.
callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskTool

A Task containing the RPC response.

Example
// Create client
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Tool tool = new Tool();
string toolId = "";
// Make the request
Tool response = await toolsClient.CreateToolAsync(parent, tool, toolId);

CreateToolAsync(LocationName, Tool, string, CancellationToken)

public virtual Task<Tool> CreateToolAsync(LocationName parent, Tool tool, string toolId, CancellationToken cancellationToken)

Creates a tool.

Parameters
Name Description
parent LocationName

Required. The project/location to create tool for. Format: projects/<Project ID>/locations/<Location ID>

tool Tool

Required. The tool to create.

toolId string

Optional. The ID to use for the tool, which will become the final component of the tool's resource name.

The tool ID must be compliant with the regression formula [a-zA-Z][a-zA-Z0-9_-]* with the characters length in range of [3,64]. If the field is not provide, an Id will be auto-generated. If the field is provided, the caller is responsible for

  1. the uniqueness of the ID, otherwise the request will be rejected.
  2. the consistency for whether to use custom ID or not under a project to better ensure uniqueness.
cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTool

A Task containing the RPC response.

Example
// Create client
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Tool tool = new Tool();
string toolId = "";
// Make the request
Tool response = await toolsClient.CreateToolAsync(parent, tool, toolId);

CreateToolAsync(CreateToolRequest, CallSettings)

public virtual Task<Tool> CreateToolAsync(CreateToolRequest request, CallSettings callSettings = null)

Creates a tool.

Parameters
Name Description
request CreateToolRequest

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
TaskTool

A Task containing the RPC response.

Example
// Create client
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
CreateToolRequest request = new CreateToolRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Tool = new Tool(),
    ToolId = "",
};
// Make the request
Tool response = await toolsClient.CreateToolAsync(request);

CreateToolAsync(CreateToolRequest, CancellationToken)

public virtual Task<Tool> CreateToolAsync(CreateToolRequest request, CancellationToken cancellationToken)

Creates a tool.

Parameters
Name Description
request CreateToolRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTool

A Task containing the RPC response.

Example
// Create client
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
CreateToolRequest request = new CreateToolRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Tool = new Tool(),
    ToolId = "",
};
// Make the request
Tool response = await toolsClient.CreateToolAsync(request);

CreateToolAsync(string, Tool, string, CallSettings)

public virtual Task<Tool> CreateToolAsync(string parent, Tool tool, string toolId, CallSettings callSettings = null)

Creates a tool.

Parameters
Name Description
parent string

Required. The project/location to create tool for. Format: projects/<Project ID>/locations/<Location ID>

tool Tool

Required. The tool to create.

toolId string

Optional. The ID to use for the tool, which will become the final component of the tool's resource name.

The tool ID must be compliant with the regression formula [a-zA-Z][a-zA-Z0-9_-]* with the characters length in range of [3,64]. If the field is not provide, an Id will be auto-generated. If the field is provided, the caller is responsible for

  1. the uniqueness of the ID, otherwise the request will be rejected.
  2. the consistency for whether to use custom ID or not under a project to better ensure uniqueness.
callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskTool

A Task containing the RPC response.

Example
// Create client
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Tool tool = new Tool();
string toolId = "";
// Make the request
Tool response = await toolsClient.CreateToolAsync(parent, tool, toolId);

CreateToolAsync(string, Tool, string, CancellationToken)

public virtual Task<Tool> CreateToolAsync(string parent, Tool tool, string toolId, CancellationToken cancellationToken)

Creates a tool.

Parameters
Name Description
parent string

Required. The project/location to create tool for. Format: projects/<Project ID>/locations/<Location ID>

tool Tool

Required. The tool to create.

toolId string

Optional. The ID to use for the tool, which will become the final component of the tool's resource name.

The tool ID must be compliant with the regression formula [a-zA-Z][a-zA-Z0-9_-]* with the characters length in range of [3,64]. If the field is not provide, an Id will be auto-generated. If the field is provided, the caller is responsible for

  1. the uniqueness of the ID, otherwise the request will be rejected.
  2. the consistency for whether to use custom ID or not under a project to better ensure uniqueness.
cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTool

A Task containing the RPC response.

Example
// Create client
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Tool tool = new Tool();
string toolId = "";
// Make the request
Tool response = await toolsClient.CreateToolAsync(parent, tool, toolId);

DeleteTool(DeleteToolRequest, CallSettings)

public virtual void DeleteTool(DeleteToolRequest request, CallSettings callSettings = null)

Deletes a tool.

Parameters
Name Description
request DeleteToolRequest

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
ToolsClient toolsClient = ToolsClient.Create();
// Initialize request argument(s)
DeleteToolRequest request = new DeleteToolRequest
{
    ToolName = ToolName.FromProjectLocationTool("[PROJECT]", "[LOCATION]", "[TOOL]"),
};
// Make the request
toolsClient.DeleteTool(request);

DeleteTool(ToolName, CallSettings)

public virtual void DeleteTool(ToolName name, CallSettings callSettings = null)

Deletes a tool.

Parameters
Name Description
name ToolName

Required. The tool resource name to delete. Format: projects/<Project ID>/locations/<Location ID>/tools/<Tool ID>

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ToolsClient toolsClient = ToolsClient.Create();
// Initialize request argument(s)
ToolName name = ToolName.FromProjectLocationTool("[PROJECT]", "[LOCATION]", "[TOOL]");
// Make the request
toolsClient.DeleteTool(name);

DeleteTool(string, CallSettings)

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

Deletes a tool.

Parameters
Name Description
name string

Required. The tool resource name to delete. Format: projects/<Project ID>/locations/<Location ID>/tools/<Tool ID>

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
ToolsClient toolsClient = ToolsClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/tools/[TOOL]";
// Make the request
toolsClient.DeleteTool(name);

DeleteToolAsync(DeleteToolRequest, CallSettings)

public virtual Task DeleteToolAsync(DeleteToolRequest request, CallSettings callSettings = null)

Deletes a tool.

Parameters
Name Description
request DeleteToolRequest

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
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
DeleteToolRequest request = new DeleteToolRequest
{
    ToolName = ToolName.FromProjectLocationTool("[PROJECT]", "[LOCATION]", "[TOOL]"),
};
// Make the request
await toolsClient.DeleteToolAsync(request);

DeleteToolAsync(DeleteToolRequest, CancellationToken)

public virtual Task DeleteToolAsync(DeleteToolRequest request, CancellationToken cancellationToken)

Deletes a tool.

Parameters
Name Description
request DeleteToolRequest

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
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
DeleteToolRequest request = new DeleteToolRequest
{
    ToolName = ToolName.FromProjectLocationTool("[PROJECT]", "[LOCATION]", "[TOOL]"),
};
// Make the request
await toolsClient.DeleteToolAsync(request);

DeleteToolAsync(ToolName, CallSettings)

public virtual Task DeleteToolAsync(ToolName name, CallSettings callSettings = null)

Deletes a tool.

Parameters
Name Description
name ToolName

Required. The tool resource name to delete. Format: projects/<Project ID>/locations/<Location ID>/tools/<Tool 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
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
ToolName name = ToolName.FromProjectLocationTool("[PROJECT]", "[LOCATION]", "[TOOL]");
// Make the request
await toolsClient.DeleteToolAsync(name);

DeleteToolAsync(ToolName, CancellationToken)

public virtual Task DeleteToolAsync(ToolName name, CancellationToken cancellationToken)

Deletes a tool.

Parameters
Name Description
name ToolName

Required. The tool resource name to delete. Format: projects/<Project ID>/locations/<Location ID>/tools/<Tool ID>

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
ToolName name = ToolName.FromProjectLocationTool("[PROJECT]", "[LOCATION]", "[TOOL]");
// Make the request
await toolsClient.DeleteToolAsync(name);

DeleteToolAsync(string, CallSettings)

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

Deletes a tool.

Parameters
Name Description
name string

Required. The tool resource name to delete. Format: projects/<Project ID>/locations/<Location ID>/tools/<Tool 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
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/tools/[TOOL]";
// Make the request
await toolsClient.DeleteToolAsync(name);

DeleteToolAsync(string, CancellationToken)

public virtual Task DeleteToolAsync(string name, CancellationToken cancellationToken)

Deletes a tool.

Parameters
Name Description
name string

Required. The tool resource name to delete. Format: projects/<Project ID>/locations/<Location ID>/tools/<Tool ID>

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/tools/[TOOL]";
// Make the request
await toolsClient.DeleteToolAsync(name);

GetTool(GetToolRequest, CallSettings)

public virtual Tool GetTool(GetToolRequest request, CallSettings callSettings = null)

Retrieves a tool.

Parameters
Name Description
request GetToolRequest

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
Tool

The RPC response.

Example
// Create client
ToolsClient toolsClient = ToolsClient.Create();
// Initialize request argument(s)
GetToolRequest request = new GetToolRequest
{
    ToolName = ToolName.FromProjectLocationTool("[PROJECT]", "[LOCATION]", "[TOOL]"),
};
// Make the request
Tool response = toolsClient.GetTool(request);

GetTool(ToolName, CallSettings)

public virtual Tool GetTool(ToolName name, CallSettings callSettings = null)

Retrieves a tool.

Parameters
Name Description
name ToolName

Required. The tool resource name to retrieve. Format: projects/<Project ID>/locations/<Location ID>/tools/<Tool ID>

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Tool

The RPC response.

Example
// Create client
ToolsClient toolsClient = ToolsClient.Create();
// Initialize request argument(s)
ToolName name = ToolName.FromProjectLocationTool("[PROJECT]", "[LOCATION]", "[TOOL]");
// Make the request
Tool response = toolsClient.GetTool(name);

GetTool(string, CallSettings)

public virtual Tool GetTool(string name, CallSettings callSettings = null)

Retrieves a tool.

Parameters
Name Description
name string

Required. The tool resource name to retrieve. Format: projects/<Project ID>/locations/<Location ID>/tools/<Tool ID>

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Tool

The RPC response.

Example
// Create client
ToolsClient toolsClient = ToolsClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/tools/[TOOL]";
// Make the request
Tool response = toolsClient.GetTool(name);

GetToolAsync(GetToolRequest, CallSettings)

public virtual Task<Tool> GetToolAsync(GetToolRequest request, CallSettings callSettings = null)

Retrieves a tool.

Parameters
Name Description
request GetToolRequest

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
TaskTool

A Task containing the RPC response.

Example
// Create client
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
GetToolRequest request = new GetToolRequest
{
    ToolName = ToolName.FromProjectLocationTool("[PROJECT]", "[LOCATION]", "[TOOL]"),
};
// Make the request
Tool response = await toolsClient.GetToolAsync(request);

GetToolAsync(GetToolRequest, CancellationToken)

public virtual Task<Tool> GetToolAsync(GetToolRequest request, CancellationToken cancellationToken)

Retrieves a tool.

Parameters
Name Description
request GetToolRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTool

A Task containing the RPC response.

Example
// Create client
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
GetToolRequest request = new GetToolRequest
{
    ToolName = ToolName.FromProjectLocationTool("[PROJECT]", "[LOCATION]", "[TOOL]"),
};
// Make the request
Tool response = await toolsClient.GetToolAsync(request);

GetToolAsync(ToolName, CallSettings)

public virtual Task<Tool> GetToolAsync(ToolName name, CallSettings callSettings = null)

Retrieves a tool.

Parameters
Name Description
name ToolName

Required. The tool resource name to retrieve. Format: projects/<Project ID>/locations/<Location ID>/tools/<Tool ID>

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskTool

A Task containing the RPC response.

Example
// Create client
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
ToolName name = ToolName.FromProjectLocationTool("[PROJECT]", "[LOCATION]", "[TOOL]");
// Make the request
Tool response = await toolsClient.GetToolAsync(name);

GetToolAsync(ToolName, CancellationToken)

public virtual Task<Tool> GetToolAsync(ToolName name, CancellationToken cancellationToken)

Retrieves a tool.

Parameters
Name Description
name ToolName

Required. The tool resource name to retrieve. Format: projects/<Project ID>/locations/<Location ID>/tools/<Tool ID>

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTool

A Task containing the RPC response.

Example
// Create client
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
ToolName name = ToolName.FromProjectLocationTool("[PROJECT]", "[LOCATION]", "[TOOL]");
// Make the request
Tool response = await toolsClient.GetToolAsync(name);

GetToolAsync(string, CallSettings)

public virtual Task<Tool> GetToolAsync(string name, CallSettings callSettings = null)

Retrieves a tool.

Parameters
Name Description
name string

Required. The tool resource name to retrieve. Format: projects/<Project ID>/locations/<Location ID>/tools/<Tool ID>

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskTool

A Task containing the RPC response.

Example
// Create client
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/tools/[TOOL]";
// Make the request
Tool response = await toolsClient.GetToolAsync(name);

GetToolAsync(string, CancellationToken)

public virtual Task<Tool> GetToolAsync(string name, CancellationToken cancellationToken)

Retrieves a tool.

Parameters
Name Description
name string

Required. The tool resource name to retrieve. Format: projects/<Project ID>/locations/<Location ID>/tools/<Tool ID>

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTool

A Task containing the RPC response.

Example
// Create client
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/tools/[TOOL]";
// Make the request
Tool response = await toolsClient.GetToolAsync(name);

ListTools(LocationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListToolsResponse, Tool> ListTools(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists tools.

Parameters
Name Description
parent LocationName

Required. The project/location to list tools 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
PagedEnumerableListToolsResponseTool

A pageable sequence of Tool resources.

Example
// Create client
ToolsClient toolsClient = ToolsClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListToolsResponse, Tool> response = toolsClient.ListTools(parent);

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

ListTools(ListToolsRequest, CallSettings)

public virtual PagedEnumerable<ListToolsResponse, Tool> ListTools(ListToolsRequest request, CallSettings callSettings = null)

Lists tools.

Parameters
Name Description
request ListToolsRequest

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
PagedEnumerableListToolsResponseTool

A pageable sequence of Tool resources.

Example
// Create client
ToolsClient toolsClient = ToolsClient.Create();
// Initialize request argument(s)
ListToolsRequest request = new ListToolsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedEnumerable<ListToolsResponse, Tool> response = toolsClient.ListTools(request);

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

ListTools(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListToolsResponse, Tool> ListTools(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists tools.

Parameters
Name Description
parent string

Required. The project/location to list tools 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
PagedEnumerableListToolsResponseTool

A pageable sequence of Tool resources.

Example
// Create client
ToolsClient toolsClient = ToolsClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListToolsResponse, Tool> response = toolsClient.ListTools(parent);

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

ListToolsAsync(LocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListToolsResponse, Tool> ListToolsAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists tools.

Parameters
Name Description
parent LocationName

Required. The project/location to list tools 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
PagedAsyncEnumerableListToolsResponseTool

A pageable asynchronous sequence of Tool resources.

Example
// Create client
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListToolsResponse, Tool> response = toolsClient.ListToolsAsync(parent);

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

ListToolsAsync(ListToolsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListToolsResponse, Tool> ListToolsAsync(ListToolsRequest request, CallSettings callSettings = null)

Lists tools.

Parameters
Name Description
request ListToolsRequest

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
PagedAsyncEnumerableListToolsResponseTool

A pageable asynchronous sequence of Tool resources.

Example
// Create client
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
ListToolsRequest request = new ListToolsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedAsyncEnumerable<ListToolsResponse, Tool> response = toolsClient.ListToolsAsync(request);

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

ListToolsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListToolsResponse, Tool> ListToolsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists tools.

Parameters
Name Description
parent string

Required. The project/location to list tools 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
PagedAsyncEnumerableListToolsResponseTool

A pageable asynchronous sequence of Tool resources.

Example
// Create client
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListToolsResponse, Tool> response = toolsClient.ListToolsAsync(parent);

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

UpdateTool(Tool, FieldMask, CallSettings)

public virtual Tool UpdateTool(Tool tool, FieldMask updateMask, CallSettings callSettings = null)

Updates a tool.

Parameters
Name Description
tool Tool

Required. The tool to update. The name field of tool is to identify the tool to update.

updateMask FieldMask

Optional. The list of fields to update.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Tool

The RPC response.

Example
// Create client
ToolsClient toolsClient = ToolsClient.Create();
// Initialize request argument(s)
Tool tool = new Tool();
FieldMask updateMask = new FieldMask();
// Make the request
Tool response = toolsClient.UpdateTool(tool, updateMask);

UpdateTool(UpdateToolRequest, CallSettings)

public virtual Tool UpdateTool(UpdateToolRequest request, CallSettings callSettings = null)

Updates a tool.

Parameters
Name Description
request UpdateToolRequest

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
Tool

The RPC response.

Example
// Create client
ToolsClient toolsClient = ToolsClient.Create();
// Initialize request argument(s)
UpdateToolRequest request = new UpdateToolRequest
{
    Tool = new Tool(),
    UpdateMask = new FieldMask(),
};
// Make the request
Tool response = toolsClient.UpdateTool(request);

UpdateToolAsync(Tool, FieldMask, CallSettings)

public virtual Task<Tool> UpdateToolAsync(Tool tool, FieldMask updateMask, CallSettings callSettings = null)

Updates a tool.

Parameters
Name Description
tool Tool

Required. The tool to update. The name field of tool is to identify the tool to update.

updateMask FieldMask

Optional. The list of fields to update.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskTool

A Task containing the RPC response.

Example
// Create client
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
Tool tool = new Tool();
FieldMask updateMask = new FieldMask();
// Make the request
Tool response = await toolsClient.UpdateToolAsync(tool, updateMask);

UpdateToolAsync(Tool, FieldMask, CancellationToken)

public virtual Task<Tool> UpdateToolAsync(Tool tool, FieldMask updateMask, CancellationToken cancellationToken)

Updates a tool.

Parameters
Name Description
tool Tool

Required. The tool to update. The name field of tool is to identify the tool to update.

updateMask FieldMask

Optional. The list of fields to update.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTool

A Task containing the RPC response.

Example
// Create client
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
Tool tool = new Tool();
FieldMask updateMask = new FieldMask();
// Make the request
Tool response = await toolsClient.UpdateToolAsync(tool, updateMask);

UpdateToolAsync(UpdateToolRequest, CallSettings)

public virtual Task<Tool> UpdateToolAsync(UpdateToolRequest request, CallSettings callSettings = null)

Updates a tool.

Parameters
Name Description
request UpdateToolRequest

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
TaskTool

A Task containing the RPC response.

Example
// Create client
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
UpdateToolRequest request = new UpdateToolRequest
{
    Tool = new Tool(),
    UpdateMask = new FieldMask(),
};
// Make the request
Tool response = await toolsClient.UpdateToolAsync(request);

UpdateToolAsync(UpdateToolRequest, CancellationToken)

public virtual Task<Tool> UpdateToolAsync(UpdateToolRequest request, CancellationToken cancellationToken)

Updates a tool.

Parameters
Name Description
request UpdateToolRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTool

A Task containing the RPC response.

Example
// Create client
ToolsClient toolsClient = await ToolsClient.CreateAsync();
// Initialize request argument(s)
UpdateToolRequest request = new UpdateToolRequest
{
    Tool = new Tool(),
    UpdateMask = new FieldMask(),
};
// Make the request
Tool response = await toolsClient.UpdateToolAsync(request);