Vertex AI v1beta1 API - Class SessionServiceClient (1.0.0-beta24)

public abstract class SessionServiceClient

Reference documentation and code samples for the Vertex AI v1beta1 API class SessionServiceClient.

SessionService client wrapper, for convenient use.

Inheritance

object > SessionServiceClient

Derived Types

Namespace

Google.Cloud.AIPlatform.V1Beta1

Assembly

Google.Cloud.AIPlatform.V1Beta1.dll

Remarks

The service that manages Vertex Session related resources.

Properties

CreateSessionOperationsClient

public virtual OperationsClient CreateSessionOperationsClient { get; }

The long-running operations client for CreateSession.

Property Value
Type Description
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default SessionService scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default SessionService scopes are:

DeleteSessionOperationsClient

public virtual OperationsClient DeleteSessionOperationsClient { get; }

The long-running operations client for DeleteSession.

Property Value
Type Description
OperationsClient

GrpcClient

public virtual SessionService.SessionServiceClient GrpcClient { get; }

The underlying gRPC SessionService client

Property Value
Type Description
SessionServiceSessionServiceClient

IAMPolicyClient

public virtual IAMPolicyClient IAMPolicyClient { get; }

The IAMPolicyClient associated with this client.

Property Value
Type Description
IAMPolicyClient

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

AppendEvent(AppendEventRequest, CallSettings)

public virtual AppendEventResponse AppendEvent(AppendEventRequest request, CallSettings callSettings = null)

Appends an event to a given session.

Parameters
Name Description
request AppendEventRequest

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
AppendEventResponse

The RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
AppendEventRequest request = new AppendEventRequest
{
    SessionName = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]"),
    Event = new SessionEvent(),
};
// Make the request
AppendEventResponse response = sessionServiceClient.AppendEvent(request);

AppendEvent(SessionName, SessionEvent, CallSettings)

public virtual AppendEventResponse AppendEvent(SessionName name, SessionEvent @event, CallSettings callSettings = null)

Appends an event to a given session.

Parameters
Name Description
name SessionName

Required. The resource name of the session to append event to. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

event SessionEvent

Required. The event to append to the session.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AppendEventResponse

The RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]");
SessionEvent @event = new SessionEvent();
// Make the request
AppendEventResponse response = sessionServiceClient.AppendEvent(name, @event);

AppendEvent(string, SessionEvent, CallSettings)

public virtual AppendEventResponse AppendEvent(string name, SessionEvent @event, CallSettings callSettings = null)

Appends an event to a given session.

Parameters
Name Description
name string

Required. The resource name of the session to append event to. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

event SessionEvent

Required. The event to append to the session.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AppendEventResponse

The RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sessions/[SESSION]";
SessionEvent @event = new SessionEvent();
// Make the request
AppendEventResponse response = sessionServiceClient.AppendEvent(name, @event);

AppendEventAsync(AppendEventRequest, CallSettings)

public virtual Task<AppendEventResponse> AppendEventAsync(AppendEventRequest request, CallSettings callSettings = null)

Appends an event to a given session.

Parameters
Name Description
request AppendEventRequest

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
TaskAppendEventResponse

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
AppendEventRequest request = new AppendEventRequest
{
    SessionName = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]"),
    Event = new SessionEvent(),
};
// Make the request
AppendEventResponse response = await sessionServiceClient.AppendEventAsync(request);

AppendEventAsync(AppendEventRequest, CancellationToken)

public virtual Task<AppendEventResponse> AppendEventAsync(AppendEventRequest request, CancellationToken cancellationToken)

Appends an event to a given session.

Parameters
Name Description
request AppendEventRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAppendEventResponse

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
AppendEventRequest request = new AppendEventRequest
{
    SessionName = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]"),
    Event = new SessionEvent(),
};
// Make the request
AppendEventResponse response = await sessionServiceClient.AppendEventAsync(request);

AppendEventAsync(SessionName, SessionEvent, CallSettings)

public virtual Task<AppendEventResponse> AppendEventAsync(SessionName name, SessionEvent @event, CallSettings callSettings = null)

Appends an event to a given session.

Parameters
Name Description
name SessionName

Required. The resource name of the session to append event to. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

event SessionEvent

Required. The event to append to the session.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAppendEventResponse

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]");
SessionEvent @event = new SessionEvent();
// Make the request
AppendEventResponse response = await sessionServiceClient.AppendEventAsync(name, @event);

AppendEventAsync(SessionName, SessionEvent, CancellationToken)

public virtual Task<AppendEventResponse> AppendEventAsync(SessionName name, SessionEvent @event, CancellationToken cancellationToken)

Appends an event to a given session.

Parameters
Name Description
name SessionName

Required. The resource name of the session to append event to. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

event SessionEvent

Required. The event to append to the session.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAppendEventResponse

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]");
SessionEvent @event = new SessionEvent();
// Make the request
AppendEventResponse response = await sessionServiceClient.AppendEventAsync(name, @event);

AppendEventAsync(string, SessionEvent, CallSettings)

public virtual Task<AppendEventResponse> AppendEventAsync(string name, SessionEvent @event, CallSettings callSettings = null)

Appends an event to a given session.

Parameters
Name Description
name string

Required. The resource name of the session to append event to. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

event SessionEvent

Required. The event to append to the session.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAppendEventResponse

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sessions/[SESSION]";
SessionEvent @event = new SessionEvent();
// Make the request
AppendEventResponse response = await sessionServiceClient.AppendEventAsync(name, @event);

AppendEventAsync(string, SessionEvent, CancellationToken)

public virtual Task<AppendEventResponse> AppendEventAsync(string name, SessionEvent @event, CancellationToken cancellationToken)

Appends an event to a given session.

Parameters
Name Description
name string

Required. The resource name of the session to append event to. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

event SessionEvent

Required. The event to append to the session.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAppendEventResponse

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sessions/[SESSION]";
SessionEvent @event = new SessionEvent();
// Make the request
AppendEventResponse response = await sessionServiceClient.AppendEventAsync(name, @event);

Create()

public static SessionServiceClient Create()

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

Returns
Type Description
SessionServiceClient

The created SessionServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskSessionServiceClient

The task representing the created SessionServiceClient.

CreateSession(LocationName, Session, CallSettings)

public virtual Operation<Session, CreateSessionOperationMetadata> CreateSession(LocationName parent, Session session, CallSettings callSettings = null)

Creates a new [Session][google.cloud.aiplatform.v1beta1.Session] in a given project and location.

Parameters
Name Description
parent LocationName

Required. The resource name of the location to create the session in. Format: projects/{project}/locations/{location} or projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}

session Session

Required. The session to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationSessionCreateSessionOperationMetadata

The RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Session session = new Session();
// Make the request
Operation<Session, CreateSessionOperationMetadata> response = sessionServiceClient.CreateSession(parent, session);

// Poll until the returned long-running operation is complete
Operation<Session, CreateSessionOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Session result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Session, CreateSessionOperationMetadata> retrievedResponse = sessionServiceClient.PollOnceCreateSession(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Session retrievedResult = retrievedResponse.Result;
}

CreateSession(CreateSessionRequest, CallSettings)

public virtual Operation<Session, CreateSessionOperationMetadata> CreateSession(CreateSessionRequest request, CallSettings callSettings = null)

Creates a new [Session][google.cloud.aiplatform.v1beta1.Session] in a given project and location.

Parameters
Name Description
request CreateSessionRequest

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
OperationSessionCreateSessionOperationMetadata

The RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
CreateSessionRequest request = new CreateSessionRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Session = new Session(),
};
// Make the request
Operation<Session, CreateSessionOperationMetadata> response = sessionServiceClient.CreateSession(request);

// Poll until the returned long-running operation is complete
Operation<Session, CreateSessionOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Session result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Session, CreateSessionOperationMetadata> retrievedResponse = sessionServiceClient.PollOnceCreateSession(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Session retrievedResult = retrievedResponse.Result;
}

CreateSession(ReasoningEngineName, Session, CallSettings)

public virtual Operation<Session, CreateSessionOperationMetadata> CreateSession(ReasoningEngineName parent, Session session, CallSettings callSettings = null)

Creates a new [Session][google.cloud.aiplatform.v1beta1.Session] in a given project and location.

Parameters
Name Description
parent ReasoningEngineName

Required. The resource name of the location to create the session in. Format: projects/{project}/locations/{location} or projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}

session Session

Required. The session to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationSessionCreateSessionOperationMetadata

The RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
ReasoningEngineName parent = ReasoningEngineName.FromProjectLocationReasoningEngine("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]");
Session session = new Session();
// Make the request
Operation<Session, CreateSessionOperationMetadata> response = sessionServiceClient.CreateSession(parent, session);

// Poll until the returned long-running operation is complete
Operation<Session, CreateSessionOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Session result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Session, CreateSessionOperationMetadata> retrievedResponse = sessionServiceClient.PollOnceCreateSession(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Session retrievedResult = retrievedResponse.Result;
}

CreateSession(string, Session, CallSettings)

public virtual Operation<Session, CreateSessionOperationMetadata> CreateSession(string parent, Session session, CallSettings callSettings = null)

Creates a new [Session][google.cloud.aiplatform.v1beta1.Session] in a given project and location.

Parameters
Name Description
parent string

Required. The resource name of the location to create the session in. Format: projects/{project}/locations/{location} or projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}

session Session

Required. The session to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationSessionCreateSessionOperationMetadata

The RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Session session = new Session();
// Make the request
Operation<Session, CreateSessionOperationMetadata> response = sessionServiceClient.CreateSession(parent, session);

// Poll until the returned long-running operation is complete
Operation<Session, CreateSessionOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Session result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Session, CreateSessionOperationMetadata> retrievedResponse = sessionServiceClient.PollOnceCreateSession(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Session retrievedResult = retrievedResponse.Result;
}

CreateSessionAsync(LocationName, Session, CallSettings)

public virtual Task<Operation<Session, CreateSessionOperationMetadata>> CreateSessionAsync(LocationName parent, Session session, CallSettings callSettings = null)

Creates a new [Session][google.cloud.aiplatform.v1beta1.Session] in a given project and location.

Parameters
Name Description
parent LocationName

Required. The resource name of the location to create the session in. Format: projects/{project}/locations/{location} or projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}

session Session

Required. The session to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationSessionCreateSessionOperationMetadata

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Session session = new Session();
// Make the request
Operation<Session, CreateSessionOperationMetadata> response = await sessionServiceClient.CreateSessionAsync(parent, session);

// Poll until the returned long-running operation is complete
Operation<Session, CreateSessionOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Session result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Session, CreateSessionOperationMetadata> retrievedResponse = await sessionServiceClient.PollOnceCreateSessionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Session retrievedResult = retrievedResponse.Result;
}

CreateSessionAsync(LocationName, Session, CancellationToken)

public virtual Task<Operation<Session, CreateSessionOperationMetadata>> CreateSessionAsync(LocationName parent, Session session, CancellationToken cancellationToken)

Creates a new [Session][google.cloud.aiplatform.v1beta1.Session] in a given project and location.

Parameters
Name Description
parent LocationName

Required. The resource name of the location to create the session in. Format: projects/{project}/locations/{location} or projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}

session Session

Required. The session to create.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationSessionCreateSessionOperationMetadata

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Session session = new Session();
// Make the request
Operation<Session, CreateSessionOperationMetadata> response = await sessionServiceClient.CreateSessionAsync(parent, session);

// Poll until the returned long-running operation is complete
Operation<Session, CreateSessionOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Session result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Session, CreateSessionOperationMetadata> retrievedResponse = await sessionServiceClient.PollOnceCreateSessionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Session retrievedResult = retrievedResponse.Result;
}

CreateSessionAsync(CreateSessionRequest, CallSettings)

public virtual Task<Operation<Session, CreateSessionOperationMetadata>> CreateSessionAsync(CreateSessionRequest request, CallSettings callSettings = null)

Creates a new [Session][google.cloud.aiplatform.v1beta1.Session] in a given project and location.

Parameters
Name Description
request CreateSessionRequest

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
TaskOperationSessionCreateSessionOperationMetadata

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSessionRequest request = new CreateSessionRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Session = new Session(),
};
// Make the request
Operation<Session, CreateSessionOperationMetadata> response = await sessionServiceClient.CreateSessionAsync(request);

// Poll until the returned long-running operation is complete
Operation<Session, CreateSessionOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Session result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Session, CreateSessionOperationMetadata> retrievedResponse = await sessionServiceClient.PollOnceCreateSessionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Session retrievedResult = retrievedResponse.Result;
}

CreateSessionAsync(CreateSessionRequest, CancellationToken)

public virtual Task<Operation<Session, CreateSessionOperationMetadata>> CreateSessionAsync(CreateSessionRequest request, CancellationToken cancellationToken)

Creates a new [Session][google.cloud.aiplatform.v1beta1.Session] in a given project and location.

Parameters
Name Description
request CreateSessionRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationSessionCreateSessionOperationMetadata

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSessionRequest request = new CreateSessionRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Session = new Session(),
};
// Make the request
Operation<Session, CreateSessionOperationMetadata> response = await sessionServiceClient.CreateSessionAsync(request);

// Poll until the returned long-running operation is complete
Operation<Session, CreateSessionOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Session result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Session, CreateSessionOperationMetadata> retrievedResponse = await sessionServiceClient.PollOnceCreateSessionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Session retrievedResult = retrievedResponse.Result;
}

CreateSessionAsync(ReasoningEngineName, Session, CallSettings)

public virtual Task<Operation<Session, CreateSessionOperationMetadata>> CreateSessionAsync(ReasoningEngineName parent, Session session, CallSettings callSettings = null)

Creates a new [Session][google.cloud.aiplatform.v1beta1.Session] in a given project and location.

Parameters
Name Description
parent ReasoningEngineName

Required. The resource name of the location to create the session in. Format: projects/{project}/locations/{location} or projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}

session Session

Required. The session to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationSessionCreateSessionOperationMetadata

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
ReasoningEngineName parent = ReasoningEngineName.FromProjectLocationReasoningEngine("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]");
Session session = new Session();
// Make the request
Operation<Session, CreateSessionOperationMetadata> response = await sessionServiceClient.CreateSessionAsync(parent, session);

// Poll until the returned long-running operation is complete
Operation<Session, CreateSessionOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Session result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Session, CreateSessionOperationMetadata> retrievedResponse = await sessionServiceClient.PollOnceCreateSessionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Session retrievedResult = retrievedResponse.Result;
}

CreateSessionAsync(ReasoningEngineName, Session, CancellationToken)

public virtual Task<Operation<Session, CreateSessionOperationMetadata>> CreateSessionAsync(ReasoningEngineName parent, Session session, CancellationToken cancellationToken)

Creates a new [Session][google.cloud.aiplatform.v1beta1.Session] in a given project and location.

Parameters
Name Description
parent ReasoningEngineName

Required. The resource name of the location to create the session in. Format: projects/{project}/locations/{location} or projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}

session Session

Required. The session to create.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationSessionCreateSessionOperationMetadata

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
ReasoningEngineName parent = ReasoningEngineName.FromProjectLocationReasoningEngine("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]");
Session session = new Session();
// Make the request
Operation<Session, CreateSessionOperationMetadata> response = await sessionServiceClient.CreateSessionAsync(parent, session);

// Poll until the returned long-running operation is complete
Operation<Session, CreateSessionOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Session result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Session, CreateSessionOperationMetadata> retrievedResponse = await sessionServiceClient.PollOnceCreateSessionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Session retrievedResult = retrievedResponse.Result;
}

CreateSessionAsync(string, Session, CallSettings)

public virtual Task<Operation<Session, CreateSessionOperationMetadata>> CreateSessionAsync(string parent, Session session, CallSettings callSettings = null)

Creates a new [Session][google.cloud.aiplatform.v1beta1.Session] in a given project and location.

Parameters
Name Description
parent string

Required. The resource name of the location to create the session in. Format: projects/{project}/locations/{location} or projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}

session Session

Required. The session to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationSessionCreateSessionOperationMetadata

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Session session = new Session();
// Make the request
Operation<Session, CreateSessionOperationMetadata> response = await sessionServiceClient.CreateSessionAsync(parent, session);

// Poll until the returned long-running operation is complete
Operation<Session, CreateSessionOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Session result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Session, CreateSessionOperationMetadata> retrievedResponse = await sessionServiceClient.PollOnceCreateSessionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Session retrievedResult = retrievedResponse.Result;
}

CreateSessionAsync(string, Session, CancellationToken)

public virtual Task<Operation<Session, CreateSessionOperationMetadata>> CreateSessionAsync(string parent, Session session, CancellationToken cancellationToken)

Creates a new [Session][google.cloud.aiplatform.v1beta1.Session] in a given project and location.

Parameters
Name Description
parent string

Required. The resource name of the location to create the session in. Format: projects/{project}/locations/{location} or projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}

session Session

Required. The session to create.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationSessionCreateSessionOperationMetadata

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Session session = new Session();
// Make the request
Operation<Session, CreateSessionOperationMetadata> response = await sessionServiceClient.CreateSessionAsync(parent, session);

// Poll until the returned long-running operation is complete
Operation<Session, CreateSessionOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Session result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Session, CreateSessionOperationMetadata> retrievedResponse = await sessionServiceClient.PollOnceCreateSessionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Session retrievedResult = retrievedResponse.Result;
}

DeleteSession(DeleteSessionRequest, CallSettings)

public virtual Operation<Empty, DeleteOperationMetadata> DeleteSession(DeleteSessionRequest request, CallSettings callSettings = null)

Deletes details of the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
request DeleteSessionRequest

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
OperationEmptyDeleteOperationMetadata

The RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
DeleteSessionRequest request = new DeleteSessionRequest
{
    SessionName = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]"),
};
// Make the request
Operation<Empty, DeleteOperationMetadata> response = sessionServiceClient.DeleteSession(request);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, DeleteOperationMetadata> retrievedResponse = sessionServiceClient.PollOnceDeleteSession(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteSession(SessionName, CallSettings)

public virtual Operation<Empty, DeleteOperationMetadata> DeleteSession(SessionName name, CallSettings callSettings = null)

Deletes details of the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
name SessionName

Required. The resource name of the session. Format: projects/{project}/locations/{location}/sessions/{session} or projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyDeleteOperationMetadata

The RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]");
// Make the request
Operation<Empty, DeleteOperationMetadata> response = sessionServiceClient.DeleteSession(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, DeleteOperationMetadata> retrievedResponse = sessionServiceClient.PollOnceDeleteSession(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteSession(string, CallSettings)

public virtual Operation<Empty, DeleteOperationMetadata> DeleteSession(string name, CallSettings callSettings = null)

Deletes details of the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
name string

Required. The resource name of the session. Format: projects/{project}/locations/{location}/sessions/{session} or projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyDeleteOperationMetadata

The RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sessions/[SESSION]";
// Make the request
Operation<Empty, DeleteOperationMetadata> response = sessionServiceClient.DeleteSession(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteOperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, DeleteOperationMetadata> retrievedResponse = sessionServiceClient.PollOnceDeleteSession(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteSessionAsync(DeleteSessionRequest, CallSettings)

public virtual Task<Operation<Empty, DeleteOperationMetadata>> DeleteSessionAsync(DeleteSessionRequest request, CallSettings callSettings = null)

Deletes details of the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
request DeleteSessionRequest

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
TaskOperationEmptyDeleteOperationMetadata

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteSessionRequest request = new DeleteSessionRequest
{
    SessionName = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]"),
};
// Make the request
Operation<Empty, DeleteOperationMetadata> response = await sessionServiceClient.DeleteSessionAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, DeleteOperationMetadata> retrievedResponse = await sessionServiceClient.PollOnceDeleteSessionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteSessionAsync(DeleteSessionRequest, CancellationToken)

public virtual Task<Operation<Empty, DeleteOperationMetadata>> DeleteSessionAsync(DeleteSessionRequest request, CancellationToken cancellationToken)

Deletes details of the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
request DeleteSessionRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyDeleteOperationMetadata

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteSessionRequest request = new DeleteSessionRequest
{
    SessionName = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]"),
};
// Make the request
Operation<Empty, DeleteOperationMetadata> response = await sessionServiceClient.DeleteSessionAsync(request);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, DeleteOperationMetadata> retrievedResponse = await sessionServiceClient.PollOnceDeleteSessionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteSessionAsync(SessionName, CallSettings)

public virtual Task<Operation<Empty, DeleteOperationMetadata>> DeleteSessionAsync(SessionName name, CallSettings callSettings = null)

Deletes details of the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
name SessionName

Required. The resource name of the session. Format: projects/{project}/locations/{location}/sessions/{session} or projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyDeleteOperationMetadata

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]");
// Make the request
Operation<Empty, DeleteOperationMetadata> response = await sessionServiceClient.DeleteSessionAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, DeleteOperationMetadata> retrievedResponse = await sessionServiceClient.PollOnceDeleteSessionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteSessionAsync(SessionName, CancellationToken)

public virtual Task<Operation<Empty, DeleteOperationMetadata>> DeleteSessionAsync(SessionName name, CancellationToken cancellationToken)

Deletes details of the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
name SessionName

Required. The resource name of the session. Format: projects/{project}/locations/{location}/sessions/{session} or projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyDeleteOperationMetadata

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]");
// Make the request
Operation<Empty, DeleteOperationMetadata> response = await sessionServiceClient.DeleteSessionAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, DeleteOperationMetadata> retrievedResponse = await sessionServiceClient.PollOnceDeleteSessionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteSessionAsync(string, CallSettings)

public virtual Task<Operation<Empty, DeleteOperationMetadata>> DeleteSessionAsync(string name, CallSettings callSettings = null)

Deletes details of the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
name string

Required. The resource name of the session. Format: projects/{project}/locations/{location}/sessions/{session} or projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyDeleteOperationMetadata

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sessions/[SESSION]";
// Make the request
Operation<Empty, DeleteOperationMetadata> response = await sessionServiceClient.DeleteSessionAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, DeleteOperationMetadata> retrievedResponse = await sessionServiceClient.PollOnceDeleteSessionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

DeleteSessionAsync(string, CancellationToken)

public virtual Task<Operation<Empty, DeleteOperationMetadata>> DeleteSessionAsync(string name, CancellationToken cancellationToken)

Deletes details of the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
name string

Required. The resource name of the session. Format: projects/{project}/locations/{location}/sessions/{session} or projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyDeleteOperationMetadata

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sessions/[SESSION]";
// Make the request
Operation<Empty, DeleteOperationMetadata> response = await sessionServiceClient.DeleteSessionAsync(name);

// Poll until the returned long-running operation is complete
Operation<Empty, DeleteOperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Empty result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Empty, DeleteOperationMetadata> retrievedResponse = await sessionServiceClient.PollOnceDeleteSessionAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
    // If it has completed, then access the result
    Empty retrievedResult = retrievedResponse.Result;
}

GetSession(GetSessionRequest, CallSettings)

public virtual Session GetSession(GetSessionRequest request, CallSettings callSettings = null)

Gets details of the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
request GetSessionRequest

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
Session

The RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
GetSessionRequest request = new GetSessionRequest
{
    SessionName = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]"),
};
// Make the request
Session response = sessionServiceClient.GetSession(request);

GetSession(SessionName, CallSettings)

public virtual Session GetSession(SessionName name, CallSettings callSettings = null)

Gets details of the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
name SessionName

Required. The resource name of the session. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Session

The RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]");
// Make the request
Session response = sessionServiceClient.GetSession(name);

GetSession(string, CallSettings)

public virtual Session GetSession(string name, CallSettings callSettings = null)

Gets details of the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
name string

Required. The resource name of the session. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Session

The RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sessions/[SESSION]";
// Make the request
Session response = sessionServiceClient.GetSession(name);

GetSessionAsync(GetSessionRequest, CallSettings)

public virtual Task<Session> GetSessionAsync(GetSessionRequest request, CallSettings callSettings = null)

Gets details of the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
request GetSessionRequest

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
TaskSession

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
GetSessionRequest request = new GetSessionRequest
{
    SessionName = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]"),
};
// Make the request
Session response = await sessionServiceClient.GetSessionAsync(request);

GetSessionAsync(GetSessionRequest, CancellationToken)

public virtual Task<Session> GetSessionAsync(GetSessionRequest request, CancellationToken cancellationToken)

Gets details of the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
request GetSessionRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSession

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
GetSessionRequest request = new GetSessionRequest
{
    SessionName = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]"),
};
// Make the request
Session response = await sessionServiceClient.GetSessionAsync(request);

GetSessionAsync(SessionName, CallSettings)

public virtual Task<Session> GetSessionAsync(SessionName name, CallSettings callSettings = null)

Gets details of the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
name SessionName

Required. The resource name of the session. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSession

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]");
// Make the request
Session response = await sessionServiceClient.GetSessionAsync(name);

GetSessionAsync(SessionName, CancellationToken)

public virtual Task<Session> GetSessionAsync(SessionName name, CancellationToken cancellationToken)

Gets details of the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
name SessionName

Required. The resource name of the session. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSession

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]");
// Make the request
Session response = await sessionServiceClient.GetSessionAsync(name);

GetSessionAsync(string, CallSettings)

public virtual Task<Session> GetSessionAsync(string name, CallSettings callSettings = null)

Gets details of the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
name string

Required. The resource name of the session. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSession

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sessions/[SESSION]";
// Make the request
Session response = await sessionServiceClient.GetSessionAsync(name);

GetSessionAsync(string, CancellationToken)

public virtual Task<Session> GetSessionAsync(string name, CancellationToken cancellationToken)

Gets details of the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
name string

Required. The resource name of the session. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSession

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sessions/[SESSION]";
// Make the request
Session response = await sessionServiceClient.GetSessionAsync(name);

ListEvents(ListEventsRequest, CallSettings)

public virtual PagedEnumerable<ListEventsResponse, SessionEvent> ListEvents(ListEventsRequest request, CallSettings callSettings = null)

Lists [Events][google.cloud.aiplatform.v1beta1.Event] in a given session.

Parameters
Name Description
request ListEventsRequest

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
PagedEnumerableListEventsResponseSessionEvent

A pageable sequence of SessionEvent resources.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
ListEventsRequest request = new ListEventsRequest
{
    ParentAsSessionName = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]"),
};
// Make the request
PagedEnumerable<ListEventsResponse, SessionEvent> response = sessionServiceClient.ListEvents(request);

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

ListEvents(SessionName, string, int?, CallSettings)

public virtual PagedEnumerable<ListEventsResponse, SessionEvent> ListEvents(SessionName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists [Events][google.cloud.aiplatform.v1beta1.Event] in a given session.

Parameters
Name Description
parent SessionName

Required. The resource name of the session to list events from. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

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
PagedEnumerableListEventsResponseSessionEvent

A pageable sequence of SessionEvent resources.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
SessionName parent = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]");
// Make the request
PagedEnumerable<ListEventsResponse, SessionEvent> response = sessionServiceClient.ListEvents(parent);

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

ListEvents(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListEventsResponse, SessionEvent> ListEvents(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists [Events][google.cloud.aiplatform.v1beta1.Event] in a given session.

Parameters
Name Description
parent string

Required. The resource name of the session to list events from. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

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
PagedEnumerableListEventsResponseSessionEvent

A pageable sequence of SessionEvent resources.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/sessions/[SESSION]";
// Make the request
PagedEnumerable<ListEventsResponse, SessionEvent> response = sessionServiceClient.ListEvents(parent);

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

ListEventsAsync(ListEventsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListEventsResponse, SessionEvent> ListEventsAsync(ListEventsRequest request, CallSettings callSettings = null)

Lists [Events][google.cloud.aiplatform.v1beta1.Event] in a given session.

Parameters
Name Description
request ListEventsRequest

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
PagedAsyncEnumerableListEventsResponseSessionEvent

A pageable asynchronous sequence of SessionEvent resources.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
ListEventsRequest request = new ListEventsRequest
{
    ParentAsSessionName = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]"),
};
// Make the request
PagedAsyncEnumerable<ListEventsResponse, SessionEvent> response = sessionServiceClient.ListEventsAsync(request);

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

ListEventsAsync(SessionName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListEventsResponse, SessionEvent> ListEventsAsync(SessionName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists [Events][google.cloud.aiplatform.v1beta1.Event] in a given session.

Parameters
Name Description
parent SessionName

Required. The resource name of the session to list events from. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

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
PagedAsyncEnumerableListEventsResponseSessionEvent

A pageable asynchronous sequence of SessionEvent resources.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
SessionName parent = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]");
// Make the request
PagedAsyncEnumerable<ListEventsResponse, SessionEvent> response = sessionServiceClient.ListEventsAsync(parent);

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

ListEventsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListEventsResponse, SessionEvent> ListEventsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists [Events][google.cloud.aiplatform.v1beta1.Event] in a given session.

Parameters
Name Description
parent string

Required. The resource name of the session to list events from. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

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
PagedAsyncEnumerableListEventsResponseSessionEvent

A pageable asynchronous sequence of SessionEvent resources.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/sessions/[SESSION]";
// Make the request
PagedAsyncEnumerable<ListEventsResponse, SessionEvent> response = sessionServiceClient.ListEventsAsync(parent);

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

ListSessions(LocationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListSessionsResponse, Session> ListSessions(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists [Sessions][google.cloud.aiplatform.v1beta1.Session] in a given project and location.

Parameters
Name Description
parent LocationName

Required. The resource name of the location to list sessions from. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}

pageToken string

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

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListSessionsResponseSession

A pageable sequence of Session resources.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListSessionsResponse, Session> response = sessionServiceClient.ListSessions(parent);

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

ListSessions(ListSessionsRequest, CallSettings)

public virtual PagedEnumerable<ListSessionsResponse, Session> ListSessions(ListSessionsRequest request, CallSettings callSettings = null)

Lists [Sessions][google.cloud.aiplatform.v1beta1.Session] in a given project and location.

Parameters
Name Description
request ListSessionsRequest

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
PagedEnumerableListSessionsResponseSession

A pageable sequence of Session resources.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
ListSessionsRequest request = new ListSessionsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    OrderBy = "",
};
// Make the request
PagedEnumerable<ListSessionsResponse, Session> response = sessionServiceClient.ListSessions(request);

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

ListSessions(ReasoningEngineName, string, int?, CallSettings)

public virtual PagedEnumerable<ListSessionsResponse, Session> ListSessions(ReasoningEngineName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists [Sessions][google.cloud.aiplatform.v1beta1.Session] in a given project and location.

Parameters
Name Description
parent ReasoningEngineName

Required. The resource name of the location to list sessions from. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}

pageToken string

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

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListSessionsResponseSession

A pageable sequence of Session resources.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
ReasoningEngineName parent = ReasoningEngineName.FromProjectLocationReasoningEngine("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]");
// Make the request
PagedEnumerable<ListSessionsResponse, Session> response = sessionServiceClient.ListSessions(parent);

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

ListSessions(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListSessionsResponse, Session> ListSessions(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists [Sessions][google.cloud.aiplatform.v1beta1.Session] in a given project and location.

Parameters
Name Description
parent string

Required. The resource name of the location to list sessions from. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}

pageToken string

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

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListSessionsResponseSession

A pageable sequence of Session resources.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListSessionsResponse, Session> response = sessionServiceClient.ListSessions(parent);

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

ListSessionsAsync(LocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListSessionsResponse, Session> ListSessionsAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists [Sessions][google.cloud.aiplatform.v1beta1.Session] in a given project and location.

Parameters
Name Description
parent LocationName

Required. The resource name of the location to list sessions from. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}

pageToken string

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

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListSessionsResponseSession

A pageable asynchronous sequence of Session resources.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListSessionsResponse, Session> response = sessionServiceClient.ListSessionsAsync(parent);

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

ListSessionsAsync(ListSessionsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListSessionsResponse, Session> ListSessionsAsync(ListSessionsRequest request, CallSettings callSettings = null)

Lists [Sessions][google.cloud.aiplatform.v1beta1.Session] in a given project and location.

Parameters
Name Description
request ListSessionsRequest

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
PagedAsyncEnumerableListSessionsResponseSession

A pageable asynchronous sequence of Session resources.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
ListSessionsRequest request = new ListSessionsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    OrderBy = "",
};
// Make the request
PagedAsyncEnumerable<ListSessionsResponse, Session> response = sessionServiceClient.ListSessionsAsync(request);

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

ListSessionsAsync(ReasoningEngineName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListSessionsResponse, Session> ListSessionsAsync(ReasoningEngineName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists [Sessions][google.cloud.aiplatform.v1beta1.Session] in a given project and location.

Parameters
Name Description
parent ReasoningEngineName

Required. The resource name of the location to list sessions from. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}

pageToken string

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

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListSessionsResponseSession

A pageable asynchronous sequence of Session resources.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
ReasoningEngineName parent = ReasoningEngineName.FromProjectLocationReasoningEngine("[PROJECT]", "[LOCATION]", "[REASONING_ENGINE]");
// Make the request
PagedAsyncEnumerable<ListSessionsResponse, Session> response = sessionServiceClient.ListSessionsAsync(parent);

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

ListSessionsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListSessionsResponse, Session> ListSessionsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists [Sessions][google.cloud.aiplatform.v1beta1.Session] in a given project and location.

Parameters
Name Description
parent string

Required. The resource name of the location to list sessions from. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}

pageToken string

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

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListSessionsResponseSession

A pageable asynchronous sequence of Session resources.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListSessionsResponse, Session> response = sessionServiceClient.ListSessionsAsync(parent);

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

PollOnceCreateSession(string, CallSettings)

public virtual Operation<Session, CreateSessionOperationMetadata> PollOnceCreateSession(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of CreateSession.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationSessionCreateSessionOperationMetadata

The result of polling the operation.

PollOnceCreateSessionAsync(string, CallSettings)

public virtual Task<Operation<Session, CreateSessionOperationMetadata>> PollOnceCreateSessionAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of CreateSession.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationSessionCreateSessionOperationMetadata

A task representing the result of polling the operation.

PollOnceDeleteSession(string, CallSettings)

public virtual Operation<Empty, DeleteOperationMetadata> PollOnceDeleteSession(string operationName, CallSettings callSettings = null)

Poll an operation once, using an operationName from a previous invocation of DeleteSession.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyDeleteOperationMetadata

The result of polling the operation.

PollOnceDeleteSessionAsync(string, CallSettings)

public virtual Task<Operation<Empty, DeleteOperationMetadata>> PollOnceDeleteSessionAsync(string operationName, CallSettings callSettings = null)

Asynchronously poll an operation once, using an operationName from a previous invocation of DeleteSession.

Parameters
Name Description
operationName string

The name of a previously invoked operation. Must not be null or empty.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyDeleteOperationMetadata

A task representing the result of polling the operation.

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.

UpdateSession(Session, FieldMask, CallSettings)

public virtual Session UpdateSession(Session session, FieldMask updateMask, CallSettings callSettings = null)

Updates the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
session Session

Required. The session to update. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

updateMask FieldMask

Optional. Field mask is used to control which fields get updated. If the mask is not present, all fields will be updated.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Session

The RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
Session session = new Session();
FieldMask updateMask = new FieldMask();
// Make the request
Session response = sessionServiceClient.UpdateSession(session, updateMask);

UpdateSession(UpdateSessionRequest, CallSettings)

public virtual Session UpdateSession(UpdateSessionRequest request, CallSettings callSettings = null)

Updates the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
request UpdateSessionRequest

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
Session

The RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = SessionServiceClient.Create();
// Initialize request argument(s)
UpdateSessionRequest request = new UpdateSessionRequest
{
    Session = new Session(),
    UpdateMask = new FieldMask(),
};
// Make the request
Session response = sessionServiceClient.UpdateSession(request);

UpdateSessionAsync(Session, FieldMask, CallSettings)

public virtual Task<Session> UpdateSessionAsync(Session session, FieldMask updateMask, CallSettings callSettings = null)

Updates the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
session Session

Required. The session to update. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

updateMask FieldMask

Optional. Field mask is used to control which fields get updated. If the mask is not present, all fields will be updated.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSession

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
Session session = new Session();
FieldMask updateMask = new FieldMask();
// Make the request
Session response = await sessionServiceClient.UpdateSessionAsync(session, updateMask);

UpdateSessionAsync(Session, FieldMask, CancellationToken)

public virtual Task<Session> UpdateSessionAsync(Session session, FieldMask updateMask, CancellationToken cancellationToken)

Updates the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
session Session

Required. The session to update. Format: projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}

updateMask FieldMask

Optional. Field mask is used to control which fields get updated. If the mask is not present, all fields will be updated.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSession

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
Session session = new Session();
FieldMask updateMask = new FieldMask();
// Make the request
Session response = await sessionServiceClient.UpdateSessionAsync(session, updateMask);

UpdateSessionAsync(UpdateSessionRequest, CallSettings)

public virtual Task<Session> UpdateSessionAsync(UpdateSessionRequest request, CallSettings callSettings = null)

Updates the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
request UpdateSessionRequest

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
TaskSession

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSessionRequest request = new UpdateSessionRequest
{
    Session = new Session(),
    UpdateMask = new FieldMask(),
};
// Make the request
Session response = await sessionServiceClient.UpdateSessionAsync(request);

UpdateSessionAsync(UpdateSessionRequest, CancellationToken)

public virtual Task<Session> UpdateSessionAsync(UpdateSessionRequest request, CancellationToken cancellationToken)

Updates the specific [Session][google.cloud.aiplatform.v1beta1.Session].

Parameters
Name Description
request UpdateSessionRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSession

A Task containing the RPC response.

Example
// Create client
SessionServiceClient sessionServiceClient = await SessionServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSessionRequest request = new UpdateSessionRequest
{
    Session = new Session(),
    UpdateMask = new FieldMask(),
};
// Make the request
Session response = await sessionServiceClient.UpdateSessionAsync(request);