public abstract class CompanionAgentsClientReference documentation and code samples for the Google Cloud Dialogflow v2 API class CompanionAgentsClient.
CompanionAgents client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Dialogflow.V2Assembly
Google.Cloud.Dialogflow.V2.dll
Remarks
Service for managing companion agents.
Properties
DefaultEndpoint
public static string DefaultEndpoint { get; }The default endpoint for the CompanionAgents 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 CompanionAgents scopes.
| Property Value | |
|---|---|
| Type | Description |
IReadOnlyListstring |
|
The default CompanionAgents scopes are:
GrpcClient
public virtual CompanionAgents.CompanionAgentsClient GrpcClient { get; }The underlying gRPC CompanionAgents client
| Property Value | |
|---|---|
| Type | Description |
CompanionAgentsCompanionAgentsClient |
|
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 CompanionAgentsClient Create()Synchronously creates a CompanionAgentsClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CompanionAgentsClientBuilder.
| Returns | |
|---|---|
| Type | Description |
CompanionAgentsClient |
The created CompanionAgentsClient. |
CreateAsync(CancellationToken)
public static Task<CompanionAgentsClient> CreateAsync(CancellationToken cancellationToken = default)Asynchronously creates a CompanionAgentsClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use CompanionAgentsClientBuilder.
| Parameter | |
|---|---|
| Name | Description |
cancellationToken |
CancellationTokenThe CancellationToken to use while creating the client. |
| Returns | |
|---|---|
| Type | Description |
TaskCompanionAgentsClient |
The task representing the created CompanionAgentsClient. |
CreateCompanionAgent(LocationName, CompanionAgent, string, CallSettings)
public virtual CompanionAgent CreateCompanionAgent(LocationName parent, CompanionAgent companionAgent, string companionAgentId, CallSettings callSettings = null)Creates a companion agent.
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. Resource identifier of the project creating the companion agent.
Format: |
companionAgent |
CompanionAgentRequired. The companion agent to create. |
companionAgentId |
stringOptional. The resource ID of the companion agent to create. If not provided, the server will auto-generate a resource ID. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CompanionAgent |
The RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = CompanionAgentsClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
CompanionAgent companionAgent = new CompanionAgent();
string companionAgentId = "";
// Make the request
CompanionAgent response = companionAgentsClient.CreateCompanionAgent(parent, companionAgent, companionAgentId);
CreateCompanionAgent(CreateCompanionAgentRequest, CallSettings)
public virtual CompanionAgent CreateCompanionAgent(CreateCompanionAgentRequest request, CallSettings callSettings = null)Creates a companion agent.
| Parameters | |
|---|---|
| Name | Description |
request |
CreateCompanionAgentRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CompanionAgent |
The RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = CompanionAgentsClient.Create();
// Initialize request argument(s)
CreateCompanionAgentRequest request = new CreateCompanionAgentRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
CompanionAgent = new CompanionAgent(),
CompanionAgentId = "",
};
// Make the request
CompanionAgent response = companionAgentsClient.CreateCompanionAgent(request);
CreateCompanionAgent(string, CompanionAgent, string, CallSettings)
public virtual CompanionAgent CreateCompanionAgent(string parent, CompanionAgent companionAgent, string companionAgentId, CallSettings callSettings = null)Creates a companion agent.
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. Resource identifier of the project creating the companion agent.
Format: |
companionAgent |
CompanionAgentRequired. The companion agent to create. |
companionAgentId |
stringOptional. The resource ID of the companion agent to create. If not provided, the server will auto-generate a resource ID. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CompanionAgent |
The RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = CompanionAgentsClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
CompanionAgent companionAgent = new CompanionAgent();
string companionAgentId = "";
// Make the request
CompanionAgent response = companionAgentsClient.CreateCompanionAgent(parent, companionAgent, companionAgentId);
CreateCompanionAgentAsync(LocationName, CompanionAgent, string, CallSettings)
public virtual Task<CompanionAgent> CreateCompanionAgentAsync(LocationName parent, CompanionAgent companionAgent, string companionAgentId, CallSettings callSettings = null)Creates a companion agent.
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. Resource identifier of the project creating the companion agent.
Format: |
companionAgent |
CompanionAgentRequired. The companion agent to create. |
companionAgentId |
stringOptional. The resource ID of the companion agent to create. If not provided, the server will auto-generate a resource ID. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCompanionAgent |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
CompanionAgent companionAgent = new CompanionAgent();
string companionAgentId = "";
// Make the request
CompanionAgent response = await companionAgentsClient.CreateCompanionAgentAsync(parent, companionAgent, companionAgentId);
CreateCompanionAgentAsync(LocationName, CompanionAgent, string, CancellationToken)
public virtual Task<CompanionAgent> CreateCompanionAgentAsync(LocationName parent, CompanionAgent companionAgent, string companionAgentId, CancellationToken cancellationToken)Creates a companion agent.
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. Resource identifier of the project creating the companion agent.
Format: |
companionAgent |
CompanionAgentRequired. The companion agent to create. |
companionAgentId |
stringOptional. The resource ID of the companion agent to create. If not provided, the server will auto-generate a resource ID. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCompanionAgent |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
CompanionAgent companionAgent = new CompanionAgent();
string companionAgentId = "";
// Make the request
CompanionAgent response = await companionAgentsClient.CreateCompanionAgentAsync(parent, companionAgent, companionAgentId);
CreateCompanionAgentAsync(CreateCompanionAgentRequest, CallSettings)
public virtual Task<CompanionAgent> CreateCompanionAgentAsync(CreateCompanionAgentRequest request, CallSettings callSettings = null)Creates a companion agent.
| Parameters | |
|---|---|
| Name | Description |
request |
CreateCompanionAgentRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCompanionAgent |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
CreateCompanionAgentRequest request = new CreateCompanionAgentRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
CompanionAgent = new CompanionAgent(),
CompanionAgentId = "",
};
// Make the request
CompanionAgent response = await companionAgentsClient.CreateCompanionAgentAsync(request);
CreateCompanionAgentAsync(CreateCompanionAgentRequest, CancellationToken)
public virtual Task<CompanionAgent> CreateCompanionAgentAsync(CreateCompanionAgentRequest request, CancellationToken cancellationToken)Creates a companion agent.
| Parameters | |
|---|---|
| Name | Description |
request |
CreateCompanionAgentRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCompanionAgent |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
CreateCompanionAgentRequest request = new CreateCompanionAgentRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
CompanionAgent = new CompanionAgent(),
CompanionAgentId = "",
};
// Make the request
CompanionAgent response = await companionAgentsClient.CreateCompanionAgentAsync(request);
CreateCompanionAgentAsync(string, CompanionAgent, string, CallSettings)
public virtual Task<CompanionAgent> CreateCompanionAgentAsync(string parent, CompanionAgent companionAgent, string companionAgentId, CallSettings callSettings = null)Creates a companion agent.
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. Resource identifier of the project creating the companion agent.
Format: |
companionAgent |
CompanionAgentRequired. The companion agent to create. |
companionAgentId |
stringOptional. The resource ID of the companion agent to create. If not provided, the server will auto-generate a resource ID. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCompanionAgent |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
CompanionAgent companionAgent = new CompanionAgent();
string companionAgentId = "";
// Make the request
CompanionAgent response = await companionAgentsClient.CreateCompanionAgentAsync(parent, companionAgent, companionAgentId);
CreateCompanionAgentAsync(string, CompanionAgent, string, CancellationToken)
public virtual Task<CompanionAgent> CreateCompanionAgentAsync(string parent, CompanionAgent companionAgent, string companionAgentId, CancellationToken cancellationToken)Creates a companion agent.
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. Resource identifier of the project creating the companion agent.
Format: |
companionAgent |
CompanionAgentRequired. The companion agent to create. |
companionAgentId |
stringOptional. The resource ID of the companion agent to create. If not provided, the server will auto-generate a resource ID. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCompanionAgent |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
CompanionAgent companionAgent = new CompanionAgent();
string companionAgentId = "";
// Make the request
CompanionAgent response = await companionAgentsClient.CreateCompanionAgentAsync(parent, companionAgent, companionAgentId);
DeleteCompanionAgent(CompanionAgentName, CallSettings)
public virtual void DeleteCompanionAgent(CompanionAgentName name, CallSettings callSettings = null)Deletes a companion agent.
| Parameters | |
|---|---|
| Name | Description |
name |
CompanionAgentNameRequired. The unique resource identifier of the CompanionAgent to delete.
Format:
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
// Create client
CompanionAgentsClient companionAgentsClient = CompanionAgentsClient.Create();
// Initialize request argument(s)
CompanionAgentName name = CompanionAgentName.FromProjectLocationCompanionAgent("[PROJECT]", "[LOCATION]", "[COMPANION_AGENT]");
// Make the request
companionAgentsClient.DeleteCompanionAgent(name);
DeleteCompanionAgent(DeleteCompanionAgentRequest, CallSettings)
public virtual void DeleteCompanionAgent(DeleteCompanionAgentRequest request, CallSettings callSettings = null)Deletes a companion agent.
| Parameters | |
|---|---|
| Name | Description |
request |
DeleteCompanionAgentRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
// Create client
CompanionAgentsClient companionAgentsClient = CompanionAgentsClient.Create();
// Initialize request argument(s)
DeleteCompanionAgentRequest request = new DeleteCompanionAgentRequest
{
CompanionAgentName = CompanionAgentName.FromProjectLocationCompanionAgent("[PROJECT]", "[LOCATION]", "[COMPANION_AGENT]"),
};
// Make the request
companionAgentsClient.DeleteCompanionAgent(request);
DeleteCompanionAgent(string, CallSettings)
public virtual void DeleteCompanionAgent(string name, CallSettings callSettings = null)Deletes a companion agent.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The unique resource identifier of the CompanionAgent to delete.
Format:
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
// Create client
CompanionAgentsClient companionAgentsClient = CompanionAgentsClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/companionAgents/[COMPANION_AGENT]";
// Make the request
companionAgentsClient.DeleteCompanionAgent(name);
DeleteCompanionAgentAsync(CompanionAgentName, CallSettings)
public virtual Task DeleteCompanionAgentAsync(CompanionAgentName name, CallSettings callSettings = null)Deletes a companion agent.
| Parameters | |
|---|---|
| Name | Description |
name |
CompanionAgentNameRequired. The unique resource identifier of the CompanionAgent to delete.
Format:
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
Task |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
CompanionAgentName name = CompanionAgentName.FromProjectLocationCompanionAgent("[PROJECT]", "[LOCATION]", "[COMPANION_AGENT]");
// Make the request
await companionAgentsClient.DeleteCompanionAgentAsync(name);
DeleteCompanionAgentAsync(CompanionAgentName, CancellationToken)
public virtual Task DeleteCompanionAgentAsync(CompanionAgentName name, CancellationToken cancellationToken)Deletes a companion agent.
| Parameters | |
|---|---|
| Name | Description |
name |
CompanionAgentNameRequired. The unique resource identifier of the CompanionAgent to delete.
Format:
|
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
Task |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
CompanionAgentName name = CompanionAgentName.FromProjectLocationCompanionAgent("[PROJECT]", "[LOCATION]", "[COMPANION_AGENT]");
// Make the request
await companionAgentsClient.DeleteCompanionAgentAsync(name);
DeleteCompanionAgentAsync(DeleteCompanionAgentRequest, CallSettings)
public virtual Task DeleteCompanionAgentAsync(DeleteCompanionAgentRequest request, CallSettings callSettings = null)Deletes a companion agent.
| Parameters | |
|---|---|
| Name | Description |
request |
DeleteCompanionAgentRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
Task |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
DeleteCompanionAgentRequest request = new DeleteCompanionAgentRequest
{
CompanionAgentName = CompanionAgentName.FromProjectLocationCompanionAgent("[PROJECT]", "[LOCATION]", "[COMPANION_AGENT]"),
};
// Make the request
await companionAgentsClient.DeleteCompanionAgentAsync(request);
DeleteCompanionAgentAsync(DeleteCompanionAgentRequest, CancellationToken)
public virtual Task DeleteCompanionAgentAsync(DeleteCompanionAgentRequest request, CancellationToken cancellationToken)Deletes a companion agent.
| Parameters | |
|---|---|
| Name | Description |
request |
DeleteCompanionAgentRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
Task |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
DeleteCompanionAgentRequest request = new DeleteCompanionAgentRequest
{
CompanionAgentName = CompanionAgentName.FromProjectLocationCompanionAgent("[PROJECT]", "[LOCATION]", "[COMPANION_AGENT]"),
};
// Make the request
await companionAgentsClient.DeleteCompanionAgentAsync(request);
DeleteCompanionAgentAsync(string, CallSettings)
public virtual Task DeleteCompanionAgentAsync(string name, CallSettings callSettings = null)Deletes a companion agent.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The unique resource identifier of the CompanionAgent to delete.
Format:
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
Task |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/companionAgents/[COMPANION_AGENT]";
// Make the request
await companionAgentsClient.DeleteCompanionAgentAsync(name);
DeleteCompanionAgentAsync(string, CancellationToken)
public virtual Task DeleteCompanionAgentAsync(string name, CancellationToken cancellationToken)Deletes a companion agent.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The unique resource identifier of the CompanionAgent to delete.
Format:
|
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
Task |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/companionAgents/[COMPANION_AGENT]";
// Make the request
await companionAgentsClient.DeleteCompanionAgentAsync(name);
GetCompanionAgent(CompanionAgentName, CallSettings)
public virtual CompanionAgent GetCompanionAgent(CompanionAgentName name, CallSettings callSettings = null)Gets a companion agent.
| Parameters | |
|---|---|
| Name | Description |
name |
CompanionAgentNameRequired. The unique resource identifier of the CompanionAgent to get all
information for. Format:
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CompanionAgent |
The RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = CompanionAgentsClient.Create();
// Initialize request argument(s)
CompanionAgentName name = CompanionAgentName.FromProjectLocationCompanionAgent("[PROJECT]", "[LOCATION]", "[COMPANION_AGENT]");
// Make the request
CompanionAgent response = companionAgentsClient.GetCompanionAgent(name);
GetCompanionAgent(GetCompanionAgentRequest, CallSettings)
public virtual CompanionAgent GetCompanionAgent(GetCompanionAgentRequest request, CallSettings callSettings = null)Gets a companion agent.
| Parameters | |
|---|---|
| Name | Description |
request |
GetCompanionAgentRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CompanionAgent |
The RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = CompanionAgentsClient.Create();
// Initialize request argument(s)
GetCompanionAgentRequest request = new GetCompanionAgentRequest
{
CompanionAgentName = CompanionAgentName.FromProjectLocationCompanionAgent("[PROJECT]", "[LOCATION]", "[COMPANION_AGENT]"),
};
// Make the request
CompanionAgent response = companionAgentsClient.GetCompanionAgent(request);
GetCompanionAgent(string, CallSettings)
public virtual CompanionAgent GetCompanionAgent(string name, CallSettings callSettings = null)Gets a companion agent.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The unique resource identifier of the CompanionAgent to get all
information for. Format:
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CompanionAgent |
The RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = CompanionAgentsClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/companionAgents/[COMPANION_AGENT]";
// Make the request
CompanionAgent response = companionAgentsClient.GetCompanionAgent(name);
GetCompanionAgentAsync(CompanionAgentName, CallSettings)
public virtual Task<CompanionAgent> GetCompanionAgentAsync(CompanionAgentName name, CallSettings callSettings = null)Gets a companion agent.
| Parameters | |
|---|---|
| Name | Description |
name |
CompanionAgentNameRequired. The unique resource identifier of the CompanionAgent to get all
information for. Format:
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCompanionAgent |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
CompanionAgentName name = CompanionAgentName.FromProjectLocationCompanionAgent("[PROJECT]", "[LOCATION]", "[COMPANION_AGENT]");
// Make the request
CompanionAgent response = await companionAgentsClient.GetCompanionAgentAsync(name);
GetCompanionAgentAsync(CompanionAgentName, CancellationToken)
public virtual Task<CompanionAgent> GetCompanionAgentAsync(CompanionAgentName name, CancellationToken cancellationToken)Gets a companion agent.
| Parameters | |
|---|---|
| Name | Description |
name |
CompanionAgentNameRequired. The unique resource identifier of the CompanionAgent to get all
information for. Format:
|
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCompanionAgent |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
CompanionAgentName name = CompanionAgentName.FromProjectLocationCompanionAgent("[PROJECT]", "[LOCATION]", "[COMPANION_AGENT]");
// Make the request
CompanionAgent response = await companionAgentsClient.GetCompanionAgentAsync(name);
GetCompanionAgentAsync(GetCompanionAgentRequest, CallSettings)
public virtual Task<CompanionAgent> GetCompanionAgentAsync(GetCompanionAgentRequest request, CallSettings callSettings = null)Gets a companion agent.
| Parameters | |
|---|---|
| Name | Description |
request |
GetCompanionAgentRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCompanionAgent |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
GetCompanionAgentRequest request = new GetCompanionAgentRequest
{
CompanionAgentName = CompanionAgentName.FromProjectLocationCompanionAgent("[PROJECT]", "[LOCATION]", "[COMPANION_AGENT]"),
};
// Make the request
CompanionAgent response = await companionAgentsClient.GetCompanionAgentAsync(request);
GetCompanionAgentAsync(GetCompanionAgentRequest, CancellationToken)
public virtual Task<CompanionAgent> GetCompanionAgentAsync(GetCompanionAgentRequest request, CancellationToken cancellationToken)Gets a companion agent.
| Parameters | |
|---|---|
| Name | Description |
request |
GetCompanionAgentRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCompanionAgent |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
GetCompanionAgentRequest request = new GetCompanionAgentRequest
{
CompanionAgentName = CompanionAgentName.FromProjectLocationCompanionAgent("[PROJECT]", "[LOCATION]", "[COMPANION_AGENT]"),
};
// Make the request
CompanionAgent response = await companionAgentsClient.GetCompanionAgentAsync(request);
GetCompanionAgentAsync(string, CallSettings)
public virtual Task<CompanionAgent> GetCompanionAgentAsync(string name, CallSettings callSettings = null)Gets a companion agent.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The unique resource identifier of the CompanionAgent to get all
information for. Format:
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCompanionAgent |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/companionAgents/[COMPANION_AGENT]";
// Make the request
CompanionAgent response = await companionAgentsClient.GetCompanionAgentAsync(name);
GetCompanionAgentAsync(string, CancellationToken)
public virtual Task<CompanionAgent> GetCompanionAgentAsync(string name, CancellationToken cancellationToken)Gets a companion agent.
| Parameters | |
|---|---|
| Name | Description |
name |
stringRequired. The unique resource identifier of the CompanionAgent to get all
information for. Format:
|
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCompanionAgent |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/companionAgents/[COMPANION_AGENT]";
// Make the request
CompanionAgent response = await companionAgentsClient.GetCompanionAgentAsync(name);
ListCompanionAgents(LocationName, string, int?, CallSettings)
public virtual PagedEnumerable<ListCompanionAgentsResponse, CompanionAgent> ListCompanionAgents(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)Lists companion agents.
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. The parent resource name to list the companion agents for.
Format: |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListCompanionAgentsResponseCompanionAgent |
A pageable sequence of CompanionAgent resources. |
// Create client
CompanionAgentsClient companionAgentsClient = CompanionAgentsClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListCompanionAgentsResponse, CompanionAgent> response = companionAgentsClient.ListCompanionAgents(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (CompanionAgent 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 (ListCompanionAgentsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (CompanionAgent 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<CompanionAgent> 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 (CompanionAgent 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;
ListCompanionAgents(ListCompanionAgentsRequest, CallSettings)
public virtual PagedEnumerable<ListCompanionAgentsResponse, CompanionAgent> ListCompanionAgents(ListCompanionAgentsRequest request, CallSettings callSettings = null)Lists companion agents.
| Parameters | |
|---|---|
| Name | Description |
request |
ListCompanionAgentsRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListCompanionAgentsResponseCompanionAgent |
A pageable sequence of CompanionAgent resources. |
// Create client
CompanionAgentsClient companionAgentsClient = CompanionAgentsClient.Create();
// Initialize request argument(s)
ListCompanionAgentsRequest request = new ListCompanionAgentsRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedEnumerable<ListCompanionAgentsResponse, CompanionAgent> response = companionAgentsClient.ListCompanionAgents(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (CompanionAgent 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 (ListCompanionAgentsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (CompanionAgent 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<CompanionAgent> 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 (CompanionAgent 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;
ListCompanionAgents(string, string, int?, CallSettings)
public virtual PagedEnumerable<ListCompanionAgentsResponse, CompanionAgent> ListCompanionAgents(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)Lists companion agents.
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The parent resource name to list the companion agents for.
Format: |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedEnumerableListCompanionAgentsResponseCompanionAgent |
A pageable sequence of CompanionAgent resources. |
// Create client
CompanionAgentsClient companionAgentsClient = CompanionAgentsClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListCompanionAgentsResponse, CompanionAgent> response = companionAgentsClient.ListCompanionAgents(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (CompanionAgent 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 (ListCompanionAgentsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (CompanionAgent 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<CompanionAgent> 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 (CompanionAgent 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;
ListCompanionAgentsAsync(LocationName, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListCompanionAgentsResponse, CompanionAgent> ListCompanionAgentsAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)Lists companion agents.
| Parameters | |
|---|---|
| Name | Description |
parent |
LocationNameRequired. The parent resource name to list the companion agents for.
Format: |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListCompanionAgentsResponseCompanionAgent |
A pageable asynchronous sequence of CompanionAgent resources. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListCompanionAgentsResponse, CompanionAgent> response = companionAgentsClient.ListCompanionAgentsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (CompanionAgent 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 (ListCompanionAgentsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (CompanionAgent 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<CompanionAgent> 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 (CompanionAgent 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;
ListCompanionAgentsAsync(ListCompanionAgentsRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListCompanionAgentsResponse, CompanionAgent> ListCompanionAgentsAsync(ListCompanionAgentsRequest request, CallSettings callSettings = null)Lists companion agents.
| Parameters | |
|---|---|
| Name | Description |
request |
ListCompanionAgentsRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListCompanionAgentsResponseCompanionAgent |
A pageable asynchronous sequence of CompanionAgent resources. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
ListCompanionAgentsRequest request = new ListCompanionAgentsRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedAsyncEnumerable<ListCompanionAgentsResponse, CompanionAgent> response = companionAgentsClient.ListCompanionAgentsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await foreach (CompanionAgent 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 (ListCompanionAgentsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (CompanionAgent 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<CompanionAgent> 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 (CompanionAgent 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;
ListCompanionAgentsAsync(string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListCompanionAgentsResponse, CompanionAgent> ListCompanionAgentsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)Lists companion agents.
| Parameters | |
|---|---|
| Name | Description |
parent |
stringRequired. The parent resource name to list the companion agents for.
Format: |
pageToken |
stringThe token returned from the previous request. A value of |
pageSize |
intThe size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
PagedAsyncEnumerableListCompanionAgentsResponseCompanionAgent |
A pageable asynchronous sequence of CompanionAgent resources. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListCompanionAgentsResponse, CompanionAgent> response = companionAgentsClient.ListCompanionAgentsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await foreach (CompanionAgent 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 (ListCompanionAgentsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (CompanionAgent 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<CompanionAgent> 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 (CompanionAgent 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. |
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.
UpdateCompanionAgent(CompanionAgent, FieldMask, CallSettings)
public virtual CompanionAgent UpdateCompanionAgent(CompanionAgent companionAgent, FieldMask updateMask, CallSettings callSettings = null)Updates a companion agent.
| Parameters | |
|---|---|
| Name | Description |
companionAgent |
CompanionAgentRequired. The Companion Agent to update. |
updateMask |
FieldMaskOptional. Update mask for Companion Agent. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CompanionAgent |
The RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = CompanionAgentsClient.Create();
// Initialize request argument(s)
CompanionAgent companionAgent = new CompanionAgent();
FieldMask updateMask = new FieldMask();
// Make the request
CompanionAgent response = companionAgentsClient.UpdateCompanionAgent(companionAgent, updateMask);
UpdateCompanionAgent(UpdateCompanionAgentRequest, CallSettings)
public virtual CompanionAgent UpdateCompanionAgent(UpdateCompanionAgentRequest request, CallSettings callSettings = null)Updates a companion agent.
| Parameters | |
|---|---|
| Name | Description |
request |
UpdateCompanionAgentRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
CompanionAgent |
The RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = CompanionAgentsClient.Create();
// Initialize request argument(s)
UpdateCompanionAgentRequest request = new UpdateCompanionAgentRequest
{
CompanionAgent = new CompanionAgent(),
UpdateMask = new FieldMask(),
};
// Make the request
CompanionAgent response = companionAgentsClient.UpdateCompanionAgent(request);
UpdateCompanionAgentAsync(CompanionAgent, FieldMask, CallSettings)
public virtual Task<CompanionAgent> UpdateCompanionAgentAsync(CompanionAgent companionAgent, FieldMask updateMask, CallSettings callSettings = null)Updates a companion agent.
| Parameters | |
|---|---|
| Name | Description |
companionAgent |
CompanionAgentRequired. The Companion Agent to update. |
updateMask |
FieldMaskOptional. Update mask for Companion Agent. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCompanionAgent |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
CompanionAgent companionAgent = new CompanionAgent();
FieldMask updateMask = new FieldMask();
// Make the request
CompanionAgent response = await companionAgentsClient.UpdateCompanionAgentAsync(companionAgent, updateMask);
UpdateCompanionAgentAsync(CompanionAgent, FieldMask, CancellationToken)
public virtual Task<CompanionAgent> UpdateCompanionAgentAsync(CompanionAgent companionAgent, FieldMask updateMask, CancellationToken cancellationToken)Updates a companion agent.
| Parameters | |
|---|---|
| Name | Description |
companionAgent |
CompanionAgentRequired. The Companion Agent to update. |
updateMask |
FieldMaskOptional. Update mask for Companion Agent. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCompanionAgent |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
CompanionAgent companionAgent = new CompanionAgent();
FieldMask updateMask = new FieldMask();
// Make the request
CompanionAgent response = await companionAgentsClient.UpdateCompanionAgentAsync(companionAgent, updateMask);
UpdateCompanionAgentAsync(UpdateCompanionAgentRequest, CallSettings)
public virtual Task<CompanionAgent> UpdateCompanionAgentAsync(UpdateCompanionAgentRequest request, CallSettings callSettings = null)Updates a companion agent.
| Parameters | |
|---|---|
| Name | Description |
request |
UpdateCompanionAgentRequestThe request object containing all of the parameters for the API call. |
callSettings |
CallSettingsIf not null, applies overrides to this RPC call. |
| Returns | |
|---|---|
| Type | Description |
TaskCompanionAgent |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
UpdateCompanionAgentRequest request = new UpdateCompanionAgentRequest
{
CompanionAgent = new CompanionAgent(),
UpdateMask = new FieldMask(),
};
// Make the request
CompanionAgent response = await companionAgentsClient.UpdateCompanionAgentAsync(request);
UpdateCompanionAgentAsync(UpdateCompanionAgentRequest, CancellationToken)
public virtual Task<CompanionAgent> UpdateCompanionAgentAsync(UpdateCompanionAgentRequest request, CancellationToken cancellationToken)Updates a companion agent.
| Parameters | |
|---|---|
| Name | Description |
request |
UpdateCompanionAgentRequestThe request object containing all of the parameters for the API call. |
cancellationToken |
CancellationTokenA CancellationToken to use for this RPC. |
| Returns | |
|---|---|
| Type | Description |
TaskCompanionAgent |
A Task containing the RPC response. |
// Create client
CompanionAgentsClient companionAgentsClient = await CompanionAgentsClient.CreateAsync();
// Initialize request argument(s)
UpdateCompanionAgentRequest request = new UpdateCompanionAgentRequest
{
CompanionAgent = new CompanionAgent(),
UpdateMask = new FieldMask(),
};
// Make the request
CompanionAgent response = await companionAgentsClient.UpdateCompanionAgentAsync(request);