Data Analytics API with Gemini v1beta API - Class DataA2AServiceClient (1.0.0-beta12)

public abstract class DataA2AServiceClient

Reference documentation and code samples for the Data Analytics API with Gemini v1beta API class DataA2AServiceClient.

DataA2AService client wrapper, for convenient use.

Inheritance

object > DataA2AServiceClient

Derived Types

Namespace

Google.Cloud.GeminiDataAnalytics.V1Beta

Assembly

Google.Cloud.GeminiDataAnalytics.V1Beta.dll

Remarks

DataA2AService defines the Agent-to-Agent (A2A) protocol service for Gemini Data Analytics.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default DataA2AService scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default DataA2AService scopes are:

GrpcClient

public virtual DataA2AService.DataA2AServiceClient GrpcClient { get; }

The underlying gRPC DataA2AService client

Property Value
Type Description
DataA2AServiceDataA2AServiceClient

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

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

Returns
Type Description
DataA2AServiceClient

The created DataA2AServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskDataA2AServiceClient

The task representing the created DataA2AServiceClient.

GetAgentCard(GetAgentCardRequest, CallSettings)

public virtual AgentCard GetAgentCard(GetAgentCardRequest request, CallSettings callSettings = null)

GetAgentCard returns the agent card for the agent.

Parameters
Name Description
request GetAgentCardRequest

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
AgentCard

The RPC response.

Example
// Create client
DataA2AServiceClient dataA2AServiceClient = DataA2AServiceClient.Create();
// Initialize request argument(s)
GetAgentCardRequest request = new GetAgentCardRequest { Tenant = "", };
// Make the request
AgentCard response = dataA2AServiceClient.GetAgentCard(request);

GetAgentCard(string, CallSettings)

public virtual AgentCard GetAgentCard(string tenant, CallSettings callSettings = null)

GetAgentCard returns the agent card for the agent.

Parameters
Name Description
tenant string

Optional. Optional tenant, provided as a path parameter.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AgentCard

The RPC response.

Example
// Create client
DataA2AServiceClient dataA2AServiceClient = DataA2AServiceClient.Create();
// Initialize request argument(s)
string tenant = "";
// Make the request
AgentCard response = dataA2AServiceClient.GetAgentCard(tenant);

GetAgentCardAsync(GetAgentCardRequest, CallSettings)

public virtual Task<AgentCard> GetAgentCardAsync(GetAgentCardRequest request, CallSettings callSettings = null)

GetAgentCard returns the agent card for the agent.

Parameters
Name Description
request GetAgentCardRequest

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
TaskAgentCard

A Task containing the RPC response.

Example
// Create client
DataA2AServiceClient dataA2AServiceClient = await DataA2AServiceClient.CreateAsync();
// Initialize request argument(s)
GetAgentCardRequest request = new GetAgentCardRequest { Tenant = "", };
// Make the request
AgentCard response = await dataA2AServiceClient.GetAgentCardAsync(request);

GetAgentCardAsync(GetAgentCardRequest, CancellationToken)

public virtual Task<AgentCard> GetAgentCardAsync(GetAgentCardRequest request, CancellationToken cancellationToken)

GetAgentCard returns the agent card for the agent.

Parameters
Name Description
request GetAgentCardRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAgentCard

A Task containing the RPC response.

Example
// Create client
DataA2AServiceClient dataA2AServiceClient = await DataA2AServiceClient.CreateAsync();
// Initialize request argument(s)
GetAgentCardRequest request = new GetAgentCardRequest { Tenant = "", };
// Make the request
AgentCard response = await dataA2AServiceClient.GetAgentCardAsync(request);

GetAgentCardAsync(string, CallSettings)

public virtual Task<AgentCard> GetAgentCardAsync(string tenant, CallSettings callSettings = null)

GetAgentCard returns the agent card for the agent.

Parameters
Name Description
tenant string

Optional. Optional tenant, provided as a path parameter.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAgentCard

A Task containing the RPC response.

Example
// Create client
DataA2AServiceClient dataA2AServiceClient = await DataA2AServiceClient.CreateAsync();
// Initialize request argument(s)
string tenant = "";
// Make the request
AgentCard response = await dataA2AServiceClient.GetAgentCardAsync(tenant);

GetAgentCardAsync(string, CancellationToken)

public virtual Task<AgentCard> GetAgentCardAsync(string tenant, CancellationToken cancellationToken)

GetAgentCard returns the agent card for the agent.

Parameters
Name Description
tenant string

Optional. Optional tenant, provided as a path parameter.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAgentCard

A Task containing the RPC response.

Example
// Create client
DataA2AServiceClient dataA2AServiceClient = await DataA2AServiceClient.CreateAsync();
// Initialize request argument(s)
string tenant = "";
// Make the request
AgentCard response = await dataA2AServiceClient.GetAgentCardAsync(tenant);

SendMessage(SendMessageRequest, CallSettings)

public virtual SendMessageResponse SendMessage(SendMessageRequest request, CallSettings callSettings = null)

Send a message to the agent. This is a blocking call that will return the task once it is completed.

Parameters
Name Description
request SendMessageRequest

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
SendMessageResponse

The RPC response.

Example
// Create client
DataA2AServiceClient dataA2AServiceClient = DataA2AServiceClient.Create();
// Initialize request argument(s)
SendMessageRequest request = new SendMessageRequest
{
    Message = new A2AMessage(),
    Configuration = new SendMessageConfiguration(),
    Metadata = new Struct(),
    Tenant = "",
};
// Make the request
SendMessageResponse response = dataA2AServiceClient.SendMessage(request);

SendMessage(string, A2AMessage, CallSettings)

public virtual SendMessageResponse SendMessage(string tenant, A2AMessage message, CallSettings callSettings = null)

Send a message to the agent. This is a blocking call that will return the task once it is completed.

Parameters
Name Description
tenant string

Optional. Optional tenant, provided as a path parameter.

message A2AMessage

Required. The message to send to the agent.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SendMessageResponse

The RPC response.

Example
// Create client
DataA2AServiceClient dataA2AServiceClient = DataA2AServiceClient.Create();
// Initialize request argument(s)
string tenant = "";
A2AMessage message = new A2AMessage();
// Make the request
SendMessageResponse response = dataA2AServiceClient.SendMessage(tenant, message);

SendMessageAsync(SendMessageRequest, CallSettings)

public virtual Task<SendMessageResponse> SendMessageAsync(SendMessageRequest request, CallSettings callSettings = null)

Send a message to the agent. This is a blocking call that will return the task once it is completed.

Parameters
Name Description
request SendMessageRequest

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
TaskSendMessageResponse

A Task containing the RPC response.

Example
// Create client
DataA2AServiceClient dataA2AServiceClient = await DataA2AServiceClient.CreateAsync();
// Initialize request argument(s)
SendMessageRequest request = new SendMessageRequest
{
    Message = new A2AMessage(),
    Configuration = new SendMessageConfiguration(),
    Metadata = new Struct(),
    Tenant = "",
};
// Make the request
SendMessageResponse response = await dataA2AServiceClient.SendMessageAsync(request);

SendMessageAsync(SendMessageRequest, CancellationToken)

public virtual Task<SendMessageResponse> SendMessageAsync(SendMessageRequest request, CancellationToken cancellationToken)

Send a message to the agent. This is a blocking call that will return the task once it is completed.

Parameters
Name Description
request SendMessageRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSendMessageResponse

A Task containing the RPC response.

Example
// Create client
DataA2AServiceClient dataA2AServiceClient = await DataA2AServiceClient.CreateAsync();
// Initialize request argument(s)
SendMessageRequest request = new SendMessageRequest
{
    Message = new A2AMessage(),
    Configuration = new SendMessageConfiguration(),
    Metadata = new Struct(),
    Tenant = "",
};
// Make the request
SendMessageResponse response = await dataA2AServiceClient.SendMessageAsync(request);

SendMessageAsync(string, A2AMessage, CallSettings)

public virtual Task<SendMessageResponse> SendMessageAsync(string tenant, A2AMessage message, CallSettings callSettings = null)

Send a message to the agent. This is a blocking call that will return the task once it is completed.

Parameters
Name Description
tenant string

Optional. Optional tenant, provided as a path parameter.

message A2AMessage

Required. The message to send to the agent.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSendMessageResponse

A Task containing the RPC response.

Example
// Create client
DataA2AServiceClient dataA2AServiceClient = await DataA2AServiceClient.CreateAsync();
// Initialize request argument(s)
string tenant = "";
A2AMessage message = new A2AMessage();
// Make the request
SendMessageResponse response = await dataA2AServiceClient.SendMessageAsync(tenant, message);

SendMessageAsync(string, A2AMessage, CancellationToken)

public virtual Task<SendMessageResponse> SendMessageAsync(string tenant, A2AMessage message, CancellationToken cancellationToken)

Send a message to the agent. This is a blocking call that will return the task once it is completed.

Parameters
Name Description
tenant string

Optional. Optional tenant, provided as a path parameter.

message A2AMessage

Required. The message to send to the agent.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSendMessageResponse

A Task containing the RPC response.

Example
// Create client
DataA2AServiceClient dataA2AServiceClient = await DataA2AServiceClient.CreateAsync();
// Initialize request argument(s)
string tenant = "";
A2AMessage message = new A2AMessage();
// Make the request
SendMessageResponse response = await dataA2AServiceClient.SendMessageAsync(tenant, message);

SendStreamingMessage(SendMessageRequest, CallSettings)

public virtual DataA2AServiceClient.SendStreamingMessageStream SendStreamingMessage(SendMessageRequest request, CallSettings callSettings = null)

SendStreamingMessage is a streaming call that will return a stream of task update events until the Task is in an interrupted or terminal state.

Parameters
Name Description
request SendMessageRequest

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
DataA2AServiceClientSendStreamingMessageStream

The server stream.

Example
// Create client
DataA2AServiceClient dataA2AServiceClient = DataA2AServiceClient.Create();
// Initialize request argument(s)
SendMessageRequest request = new SendMessageRequest
{
    Message = new A2AMessage(),
    Configuration = new SendMessageConfiguration(),
    Metadata = new Struct(),
    Tenant = "",
};
// Make the request, returning a streaming response
using DataA2AServiceClient.SendStreamingMessageStream response = dataA2AServiceClient.SendStreamingMessage(request);

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

SendStreamingMessage(string, A2AMessage, CallSettings)

public virtual DataA2AServiceClient.SendStreamingMessageStream SendStreamingMessage(string tenant, A2AMessage message, CallSettings callSettings = null)

SendStreamingMessage is a streaming call that will return a stream of task update events until the Task is in an interrupted or terminal state.

Parameters
Name Description
tenant string

Optional. Optional tenant, provided as a path parameter.

message A2AMessage

Required. The message to send to the agent.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
DataA2AServiceClientSendStreamingMessageStream

The server stream.

Example
// Create client
DataA2AServiceClient dataA2AServiceClient = DataA2AServiceClient.Create();
// Initialize request argument(s)
string tenant = "";
A2AMessage message = new A2AMessage();
// Make the request, returning a streaming response
using DataA2AServiceClient.SendStreamingMessageStream response = dataA2AServiceClient.SendStreamingMessage(tenant, message);

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

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.