public abstract class SessionControllerClient
Reference documentation and code samples for the Google Cloud Dataproc v1 API class SessionControllerClient.
SessionController client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Dataproc.V1Assembly
Google.Cloud.Dataproc.V1.dll
Remarks
The SessionController
provides methods to manage interactive sessions.
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 SessionController service, which is a host of "dataproc.googleapis.com" and a port of 443.
Property Value | |
---|---|
Type | Description |
string |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default SessionController scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyListstring |
The default SessionController scopes are:
DeleteSessionOperationsClient
public virtual OperationsClient DeleteSessionOperationsClient { get; }
The long-running operations client for DeleteSession
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
GrpcClient
public virtual SessionController.SessionControllerClient GrpcClient { get; }
The underlying gRPC SessionController client
Property Value | |
---|---|
Type | Description |
SessionControllerSessionControllerClient |
IAMPolicyClient
public virtual IAMPolicyClient IAMPolicyClient { get; }
The IAMPolicyClient associated with this client.
Property Value | |
---|---|
Type | Description |
IAMPolicyClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Property Value | |
---|---|
Type | Description |
ServiceMetadata |
TerminateSessionOperationsClient
public virtual OperationsClient TerminateSessionOperationsClient { get; }
The long-running operations client for TerminateSession
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
Methods
Create()
public static SessionControllerClient Create()
Synchronously creates a SessionControllerClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use SessionControllerClientBuilder.
Returns | |
---|---|
Type | Description |
SessionControllerClient | The created SessionControllerClient. |
CreateAsync(CancellationToken)
public static Task<SessionControllerClient> CreateAsync(CancellationToken cancellationToken = default)
Asynchronously creates a SessionControllerClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use SessionControllerClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
TaskSessionControllerClient | The task representing the created SessionControllerClient. |
CreateSession(LocationName, Session, string, CallSettings)
public virtual Operation<Session, SessionOperationMetadata> CreateSession(LocationName parent, Session session, string sessionId, CallSettings callSettings = null)
Create an interactive session asynchronously.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The parent resource where this session will be created. |
session | Session Required. The interactive session to create. |
sessionId | string Required. The ID to use for the session, which becomes the final component of the session's resource name. This value must be 4-63 characters. Valid characters are /[a-z][0-9]-/. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationSessionSessionOperationMetadata | The RPC response. |
// Create client
SessionControllerClient sessionControllerClient = SessionControllerClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Session session = new Session();
string sessionId = "";
// Make the request
Operation<Session, SessionOperationMetadata> response = sessionControllerClient.CreateSession(parent, session, sessionId);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = sessionControllerClient.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, SessionOperationMetadata> CreateSession(CreateSessionRequest request, CallSettings callSettings = null)
Create an interactive session asynchronously.
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 |
OperationSessionSessionOperationMetadata | The RPC response. |
// Create client
SessionControllerClient sessionControllerClient = SessionControllerClient.Create();
// Initialize request argument(s)
CreateSessionRequest request = new CreateSessionRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Session = new Session(),
SessionId = "",
RequestId = "",
};
// Make the request
Operation<Session, SessionOperationMetadata> response = sessionControllerClient.CreateSession(request);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = sessionControllerClient.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, string, CallSettings)
public virtual Operation<Session, SessionOperationMetadata> CreateSession(string parent, Session session, string sessionId, CallSettings callSettings = null)
Create an interactive session asynchronously.
Parameters | |
---|---|
Name | Description |
parent | string Required. The parent resource where this session will be created. |
session | Session Required. The interactive session to create. |
sessionId | string Required. The ID to use for the session, which becomes the final component of the session's resource name. This value must be 4-63 characters. Valid characters are /[a-z][0-9]-/. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationSessionSessionOperationMetadata | The RPC response. |
// Create client
SessionControllerClient sessionControllerClient = SessionControllerClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Session session = new Session();
string sessionId = "";
// Make the request
Operation<Session, SessionOperationMetadata> response = sessionControllerClient.CreateSession(parent, session, sessionId);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = sessionControllerClient.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, string, CallSettings)
public virtual Task<Operation<Session, SessionOperationMetadata>> CreateSessionAsync(LocationName parent, Session session, string sessionId, CallSettings callSettings = null)
Create an interactive session asynchronously.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The parent resource where this session will be created. |
session | Session Required. The interactive session to create. |
sessionId | string Required. The ID to use for the session, which becomes the final component of the session's resource name. This value must be 4-63 characters. Valid characters are /[a-z][0-9]-/. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationSessionSessionOperationMetadata | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Session session = new Session();
string sessionId = "";
// Make the request
Operation<Session, SessionOperationMetadata> response = await sessionControllerClient.CreateSessionAsync(parent, session, sessionId);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = await sessionControllerClient.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, string, CancellationToken)
public virtual Task<Operation<Session, SessionOperationMetadata>> CreateSessionAsync(LocationName parent, Session session, string sessionId, CancellationToken cancellationToken)
Create an interactive session asynchronously.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The parent resource where this session will be created. |
session | Session Required. The interactive session to create. |
sessionId | string Required. The ID to use for the session, which becomes the final component of the session's resource name. This value must be 4-63 characters. Valid characters are /[a-z][0-9]-/. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationSessionSessionOperationMetadata | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Session session = new Session();
string sessionId = "";
// Make the request
Operation<Session, SessionOperationMetadata> response = await sessionControllerClient.CreateSessionAsync(parent, session, sessionId);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = await sessionControllerClient.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, SessionOperationMetadata>> CreateSessionAsync(CreateSessionRequest request, CallSettings callSettings = null)
Create an interactive session asynchronously.
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 |
TaskOperationSessionSessionOperationMetadata | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
CreateSessionRequest request = new CreateSessionRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Session = new Session(),
SessionId = "",
RequestId = "",
};
// Make the request
Operation<Session, SessionOperationMetadata> response = await sessionControllerClient.CreateSessionAsync(request);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = await sessionControllerClient.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, SessionOperationMetadata>> CreateSessionAsync(CreateSessionRequest request, CancellationToken cancellationToken)
Create an interactive session asynchronously.
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 |
TaskOperationSessionSessionOperationMetadata | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
CreateSessionRequest request = new CreateSessionRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Session = new Session(),
SessionId = "",
RequestId = "",
};
// Make the request
Operation<Session, SessionOperationMetadata> response = await sessionControllerClient.CreateSessionAsync(request);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = await sessionControllerClient.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, string, CallSettings)
public virtual Task<Operation<Session, SessionOperationMetadata>> CreateSessionAsync(string parent, Session session, string sessionId, CallSettings callSettings = null)
Create an interactive session asynchronously.
Parameters | |
---|---|
Name | Description |
parent | string Required. The parent resource where this session will be created. |
session | Session Required. The interactive session to create. |
sessionId | string Required. The ID to use for the session, which becomes the final component of the session's resource name. This value must be 4-63 characters. Valid characters are /[a-z][0-9]-/. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationSessionSessionOperationMetadata | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Session session = new Session();
string sessionId = "";
// Make the request
Operation<Session, SessionOperationMetadata> response = await sessionControllerClient.CreateSessionAsync(parent, session, sessionId);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = await sessionControllerClient.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, string, CancellationToken)
public virtual Task<Operation<Session, SessionOperationMetadata>> CreateSessionAsync(string parent, Session session, string sessionId, CancellationToken cancellationToken)
Create an interactive session asynchronously.
Parameters | |
---|---|
Name | Description |
parent | string Required. The parent resource where this session will be created. |
session | Session Required. The interactive session to create. |
sessionId | string Required. The ID to use for the session, which becomes the final component of the session's resource name. This value must be 4-63 characters. Valid characters are /[a-z][0-9]-/. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationSessionSessionOperationMetadata | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Session session = new Session();
string sessionId = "";
// Make the request
Operation<Session, SessionOperationMetadata> response = await sessionControllerClient.CreateSessionAsync(parent, session, sessionId);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = await sessionControllerClient.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<Session, SessionOperationMetadata> DeleteSession(DeleteSessionRequest request, CallSettings callSettings = null)
Deletes the interactive session resource. If the session is not in terminal state, it is terminated, and then deleted.
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 |
OperationSessionSessionOperationMetadata | The RPC response. |
// Create client
SessionControllerClient sessionControllerClient = SessionControllerClient.Create();
// Initialize request argument(s)
DeleteSessionRequest request = new DeleteSessionRequest
{
SessionName = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]"),
RequestId = "",
};
// Make the request
Operation<Session, SessionOperationMetadata> response = sessionControllerClient.DeleteSession(request);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = sessionControllerClient.PollOnceDeleteSession(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(SessionName, CallSettings)
public virtual Operation<Session, SessionOperationMetadata> DeleteSession(SessionName name, CallSettings callSettings = null)
Deletes the interactive session resource. If the session is not in terminal state, it is terminated, and then deleted.
Parameters | |
---|---|
Name | Description |
name | SessionName Required. The name of the session resource to delete. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationSessionSessionOperationMetadata | The RPC response. |
// Create client
SessionControllerClient sessionControllerClient = SessionControllerClient.Create();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]");
// Make the request
Operation<Session, SessionOperationMetadata> response = sessionControllerClient.DeleteSession(name);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = sessionControllerClient.PollOnceDeleteSession(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(string, CallSettings)
public virtual Operation<Session, SessionOperationMetadata> DeleteSession(string name, CallSettings callSettings = null)
Deletes the interactive session resource. If the session is not in terminal state, it is terminated, and then deleted.
Parameters | |
---|---|
Name | Description |
name | string Required. The name of the session resource to delete. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationSessionSessionOperationMetadata | The RPC response. |
// Create client
SessionControllerClient sessionControllerClient = SessionControllerClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sessions/[SESSION]";
// Make the request
Operation<Session, SessionOperationMetadata> response = sessionControllerClient.DeleteSession(name);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = sessionControllerClient.PollOnceDeleteSession(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;
}
DeleteSessionAsync(DeleteSessionRequest, CallSettings)
public virtual Task<Operation<Session, SessionOperationMetadata>> DeleteSessionAsync(DeleteSessionRequest request, CallSettings callSettings = null)
Deletes the interactive session resource. If the session is not in terminal state, it is terminated, and then deleted.
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 |
TaskOperationSessionSessionOperationMetadata | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
DeleteSessionRequest request = new DeleteSessionRequest
{
SessionName = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]"),
RequestId = "",
};
// Make the request
Operation<Session, SessionOperationMetadata> response = await sessionControllerClient.DeleteSessionAsync(request);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = await sessionControllerClient.PollOnceDeleteSessionAsync(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;
}
DeleteSessionAsync(DeleteSessionRequest, CancellationToken)
public virtual Task<Operation<Session, SessionOperationMetadata>> DeleteSessionAsync(DeleteSessionRequest request, CancellationToken cancellationToken)
Deletes the interactive session resource. If the session is not in terminal state, it is terminated, and then deleted.
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 |
TaskOperationSessionSessionOperationMetadata | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
DeleteSessionRequest request = new DeleteSessionRequest
{
SessionName = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]"),
RequestId = "",
};
// Make the request
Operation<Session, SessionOperationMetadata> response = await sessionControllerClient.DeleteSessionAsync(request);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = await sessionControllerClient.PollOnceDeleteSessionAsync(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;
}
DeleteSessionAsync(SessionName, CallSettings)
public virtual Task<Operation<Session, SessionOperationMetadata>> DeleteSessionAsync(SessionName name, CallSettings callSettings = null)
Deletes the interactive session resource. If the session is not in terminal state, it is terminated, and then deleted.
Parameters | |
---|---|
Name | Description |
name | SessionName Required. The name of the session resource to delete. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationSessionSessionOperationMetadata | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]");
// Make the request
Operation<Session, SessionOperationMetadata> response = await sessionControllerClient.DeleteSessionAsync(name);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = await sessionControllerClient.PollOnceDeleteSessionAsync(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;
}
DeleteSessionAsync(SessionName, CancellationToken)
public virtual Task<Operation<Session, SessionOperationMetadata>> DeleteSessionAsync(SessionName name, CancellationToken cancellationToken)
Deletes the interactive session resource. If the session is not in terminal state, it is terminated, and then deleted.
Parameters | |
---|---|
Name | Description |
name | SessionName Required. The name of the session resource to delete. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationSessionSessionOperationMetadata | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]");
// Make the request
Operation<Session, SessionOperationMetadata> response = await sessionControllerClient.DeleteSessionAsync(name);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = await sessionControllerClient.PollOnceDeleteSessionAsync(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;
}
DeleteSessionAsync(string, CallSettings)
public virtual Task<Operation<Session, SessionOperationMetadata>> DeleteSessionAsync(string name, CallSettings callSettings = null)
Deletes the interactive session resource. If the session is not in terminal state, it is terminated, and then deleted.
Parameters | |
---|---|
Name | Description |
name | string Required. The name of the session resource to delete. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationSessionSessionOperationMetadata | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sessions/[SESSION]";
// Make the request
Operation<Session, SessionOperationMetadata> response = await sessionControllerClient.DeleteSessionAsync(name);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = await sessionControllerClient.PollOnceDeleteSessionAsync(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;
}
DeleteSessionAsync(string, CancellationToken)
public virtual Task<Operation<Session, SessionOperationMetadata>> DeleteSessionAsync(string name, CancellationToken cancellationToken)
Deletes the interactive session resource. If the session is not in terminal state, it is terminated, and then deleted.
Parameters | |
---|---|
Name | Description |
name | string Required. The name of the session resource to delete. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationSessionSessionOperationMetadata | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sessions/[SESSION]";
// Make the request
Operation<Session, SessionOperationMetadata> response = await sessionControllerClient.DeleteSessionAsync(name);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = await sessionControllerClient.PollOnceDeleteSessionAsync(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;
}
GetSession(GetSessionRequest, CallSettings)
public virtual Session GetSession(GetSessionRequest request, CallSettings callSettings = null)
Gets the resource representation for an interactive 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. |
// Create client
SessionControllerClient sessionControllerClient = SessionControllerClient.Create();
// Initialize request argument(s)
GetSessionRequest request = new GetSessionRequest
{
SessionName = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]"),
};
// Make the request
Session response = sessionControllerClient.GetSession(request);
GetSession(SessionName, CallSettings)
public virtual Session GetSession(SessionName name, CallSettings callSettings = null)
Gets the resource representation for an interactive session.
Parameters | |
---|---|
Name | Description |
name | SessionName Required. The name of the session to retrieve. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Session | The RPC response. |
// Create client
SessionControllerClient sessionControllerClient = SessionControllerClient.Create();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]");
// Make the request
Session response = sessionControllerClient.GetSession(name);
GetSession(string, CallSettings)
public virtual Session GetSession(string name, CallSettings callSettings = null)
Gets the resource representation for an interactive session.
Parameters | |
---|---|
Name | Description |
name | string Required. The name of the session to retrieve. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Session | The RPC response. |
// Create client
SessionControllerClient sessionControllerClient = SessionControllerClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sessions/[SESSION]";
// Make the request
Session response = sessionControllerClient.GetSession(name);
GetSessionAsync(GetSessionRequest, CallSettings)
public virtual Task<Session> GetSessionAsync(GetSessionRequest request, CallSettings callSettings = null)
Gets the resource representation for an interactive 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. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
GetSessionRequest request = new GetSessionRequest
{
SessionName = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]"),
};
// Make the request
Session response = await sessionControllerClient.GetSessionAsync(request);
GetSessionAsync(GetSessionRequest, CancellationToken)
public virtual Task<Session> GetSessionAsync(GetSessionRequest request, CancellationToken cancellationToken)
Gets the resource representation for an interactive 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. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
GetSessionRequest request = new GetSessionRequest
{
SessionName = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]"),
};
// Make the request
Session response = await sessionControllerClient.GetSessionAsync(request);
GetSessionAsync(SessionName, CallSettings)
public virtual Task<Session> GetSessionAsync(SessionName name, CallSettings callSettings = null)
Gets the resource representation for an interactive session.
Parameters | |
---|---|
Name | Description |
name | SessionName Required. The name of the session to retrieve. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskSession | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]");
// Make the request
Session response = await sessionControllerClient.GetSessionAsync(name);
GetSessionAsync(SessionName, CancellationToken)
public virtual Task<Session> GetSessionAsync(SessionName name, CancellationToken cancellationToken)
Gets the resource representation for an interactive session.
Parameters | |
---|---|
Name | Description |
name | SessionName Required. The name of the session to retrieve. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSession | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]");
// Make the request
Session response = await sessionControllerClient.GetSessionAsync(name);
GetSessionAsync(string, CallSettings)
public virtual Task<Session> GetSessionAsync(string name, CallSettings callSettings = null)
Gets the resource representation for an interactive session.
Parameters | |
---|---|
Name | Description |
name | string Required. The name of the session to retrieve. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskSession | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sessions/[SESSION]";
// Make the request
Session response = await sessionControllerClient.GetSessionAsync(name);
GetSessionAsync(string, CancellationToken)
public virtual Task<Session> GetSessionAsync(string name, CancellationToken cancellationToken)
Gets the resource representation for an interactive session.
Parameters | |
---|---|
Name | Description |
name | string Required. The name of the session to retrieve. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSession | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sessions/[SESSION]";
// Make the request
Session response = await sessionControllerClient.GetSessionAsync(name);
ListSessions(LocationName, string, int?, CallSettings)
public virtual PagedEnumerable<ListSessionsResponse, Session> ListSessions(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists interactive sessions.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The parent, which owns this collection of sessions. |
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListSessionsResponseSession | A pageable sequence of Session resources. |
// Create client
SessionControllerClient sessionControllerClient = SessionControllerClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListSessionsResponse, Session> response = sessionControllerClient.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 interactive sessions.
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. |
// Create client
SessionControllerClient sessionControllerClient = SessionControllerClient.Create();
// Initialize request argument(s)
ListSessionsRequest request = new ListSessionsRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Filter = "",
};
// Make the request
PagedEnumerable<ListSessionsResponse, Session> response = sessionControllerClient.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(string, string, int?, CallSettings)
public virtual PagedEnumerable<ListSessionsResponse, Session> ListSessions(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists interactive sessions.
Parameters | |
---|---|
Name | Description |
parent | string Required. The parent, which owns this collection of sessions. |
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListSessionsResponseSession | A pageable sequence of Session resources. |
// Create client
SessionControllerClient sessionControllerClient = SessionControllerClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListSessionsResponse, Session> response = sessionControllerClient.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 interactive sessions.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The parent, which owns this collection of sessions. |
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableListSessionsResponseSession | A pageable asynchronous sequence of Session resources. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListSessionsResponse, Session> response = sessionControllerClient.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 interactive sessions.
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. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
ListSessionsRequest request = new ListSessionsRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListSessionsResponse, Session> response = sessionControllerClient.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(string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListSessionsResponse, Session> ListSessionsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists interactive sessions.
Parameters | |
---|---|
Name | Description |
parent | string Required. The parent, which owns this collection of sessions. |
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableListSessionsResponseSession | A pageable asynchronous sequence of Session resources. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListSessionsResponse, Session> response = sessionControllerClient.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, SessionOperationMetadata> 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 |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationSessionSessionOperationMetadata | The result of polling the operation. |
PollOnceCreateSessionAsync(string, CallSettings)
public virtual Task<Operation<Session, SessionOperationMetadata>> 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 |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationSessionSessionOperationMetadata | A task representing the result of polling the operation. |
PollOnceDeleteSession(string, CallSettings)
public virtual Operation<Session, SessionOperationMetadata> 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 |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationSessionSessionOperationMetadata | The result of polling the operation. |
PollOnceDeleteSessionAsync(string, CallSettings)
public virtual Task<Operation<Session, SessionOperationMetadata>> 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 |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationSessionSessionOperationMetadata | A task representing the result of polling the operation. |
PollOnceTerminateSession(string, CallSettings)
public virtual Operation<Session, SessionOperationMetadata> PollOnceTerminateSession(string operationName, CallSettings callSettings = null)
Poll an operation once, using an operationName
from a previous invocation of TerminateSession
.
Parameters | |
---|---|
Name | Description |
operationName | string The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationSessionSessionOperationMetadata | The result of polling the operation. |
PollOnceTerminateSessionAsync(string, CallSettings)
public virtual Task<Operation<Session, SessionOperationMetadata>> PollOnceTerminateSessionAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
TerminateSession
.
Parameters | |
---|---|
Name | Description |
operationName | string The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationSessionSessionOperationMetadata | 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. |
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.
TerminateSession(SessionName, CallSettings)
public virtual Operation<Session, SessionOperationMetadata> TerminateSession(SessionName name, CallSettings callSettings = null)
Terminates the interactive session.
Parameters | |
---|---|
Name | Description |
name | SessionName Required. The name of the session resource to terminate. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationSessionSessionOperationMetadata | The RPC response. |
// Create client
SessionControllerClient sessionControllerClient = SessionControllerClient.Create();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]");
// Make the request
Operation<Session, SessionOperationMetadata> response = sessionControllerClient.TerminateSession(name);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = sessionControllerClient.PollOnceTerminateSession(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;
}
TerminateSession(TerminateSessionRequest, CallSettings)
public virtual Operation<Session, SessionOperationMetadata> TerminateSession(TerminateSessionRequest request, CallSettings callSettings = null)
Terminates the interactive session.
Parameters | |
---|---|
Name | Description |
request | TerminateSessionRequest 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 |
OperationSessionSessionOperationMetadata | The RPC response. |
// Create client
SessionControllerClient sessionControllerClient = SessionControllerClient.Create();
// Initialize request argument(s)
TerminateSessionRequest request = new TerminateSessionRequest
{
SessionName = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]"),
RequestId = "",
};
// Make the request
Operation<Session, SessionOperationMetadata> response = sessionControllerClient.TerminateSession(request);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = sessionControllerClient.PollOnceTerminateSession(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;
}
TerminateSession(string, CallSettings)
public virtual Operation<Session, SessionOperationMetadata> TerminateSession(string name, CallSettings callSettings = null)
Terminates the interactive session.
Parameters | |
---|---|
Name | Description |
name | string Required. The name of the session resource to terminate. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationSessionSessionOperationMetadata | The RPC response. |
// Create client
SessionControllerClient sessionControllerClient = SessionControllerClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sessions/[SESSION]";
// Make the request
Operation<Session, SessionOperationMetadata> response = sessionControllerClient.TerminateSession(name);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = sessionControllerClient.PollOnceTerminateSession(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;
}
TerminateSessionAsync(SessionName, CallSettings)
public virtual Task<Operation<Session, SessionOperationMetadata>> TerminateSessionAsync(SessionName name, CallSettings callSettings = null)
Terminates the interactive session.
Parameters | |
---|---|
Name | Description |
name | SessionName Required. The name of the session resource to terminate. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationSessionSessionOperationMetadata | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]");
// Make the request
Operation<Session, SessionOperationMetadata> response = await sessionControllerClient.TerminateSessionAsync(name);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = await sessionControllerClient.PollOnceTerminateSessionAsync(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;
}
TerminateSessionAsync(SessionName, CancellationToken)
public virtual Task<Operation<Session, SessionOperationMetadata>> TerminateSessionAsync(SessionName name, CancellationToken cancellationToken)
Terminates the interactive session.
Parameters | |
---|---|
Name | Description |
name | SessionName Required. The name of the session resource to terminate. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationSessionSessionOperationMetadata | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
SessionName name = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]");
// Make the request
Operation<Session, SessionOperationMetadata> response = await sessionControllerClient.TerminateSessionAsync(name);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = await sessionControllerClient.PollOnceTerminateSessionAsync(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;
}
TerminateSessionAsync(TerminateSessionRequest, CallSettings)
public virtual Task<Operation<Session, SessionOperationMetadata>> TerminateSessionAsync(TerminateSessionRequest request, CallSettings callSettings = null)
Terminates the interactive session.
Parameters | |
---|---|
Name | Description |
request | TerminateSessionRequest 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 |
TaskOperationSessionSessionOperationMetadata | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
TerminateSessionRequest request = new TerminateSessionRequest
{
SessionName = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]"),
RequestId = "",
};
// Make the request
Operation<Session, SessionOperationMetadata> response = await sessionControllerClient.TerminateSessionAsync(request);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = await sessionControllerClient.PollOnceTerminateSessionAsync(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;
}
TerminateSessionAsync(TerminateSessionRequest, CancellationToken)
public virtual Task<Operation<Session, SessionOperationMetadata>> TerminateSessionAsync(TerminateSessionRequest request, CancellationToken cancellationToken)
Terminates the interactive session.
Parameters | |
---|---|
Name | Description |
request | TerminateSessionRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationSessionSessionOperationMetadata | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
TerminateSessionRequest request = new TerminateSessionRequest
{
SessionName = SessionName.FromProjectLocationSession("[PROJECT]", "[LOCATION]", "[SESSION]"),
RequestId = "",
};
// Make the request
Operation<Session, SessionOperationMetadata> response = await sessionControllerClient.TerminateSessionAsync(request);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = await sessionControllerClient.PollOnceTerminateSessionAsync(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;
}
TerminateSessionAsync(string, CallSettings)
public virtual Task<Operation<Session, SessionOperationMetadata>> TerminateSessionAsync(string name, CallSettings callSettings = null)
Terminates the interactive session.
Parameters | |
---|---|
Name | Description |
name | string Required. The name of the session resource to terminate. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationSessionSessionOperationMetadata | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sessions/[SESSION]";
// Make the request
Operation<Session, SessionOperationMetadata> response = await sessionControllerClient.TerminateSessionAsync(name);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = await sessionControllerClient.PollOnceTerminateSessionAsync(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;
}
TerminateSessionAsync(string, CancellationToken)
public virtual Task<Operation<Session, SessionOperationMetadata>> TerminateSessionAsync(string name, CancellationToken cancellationToken)
Terminates the interactive session.
Parameters | |
---|---|
Name | Description |
name | string Required. The name of the session resource to terminate. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationSessionSessionOperationMetadata | A Task containing the RPC response. |
// Create client
SessionControllerClient sessionControllerClient = await SessionControllerClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/sessions/[SESSION]";
// Make the request
Operation<Session, SessionOperationMetadata> response = await sessionControllerClient.TerminateSessionAsync(name);
// Poll until the returned long-running operation is complete
Operation<Session, SessionOperationMetadata> 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, SessionOperationMetadata> retrievedResponse = await sessionControllerClient.PollOnceTerminateSessionAsync(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;
}