# Google Cloud Dataproc v1 API - Class SessionControllerClient (5.27.0)

5.27.0 (latest) 5.26.0 5.25.0 5.24.0 5.23.0 5.22.0 5.21.0 5.20.0 5.19.0 5.18.0 5.17.0 5.16.0 5.15.0 5.14.0 5.13.0 5.12.0 5.11.0 5.10.0 5.9.0 5.8.0 5.7.0 5.6.0 5.5.0 5.4.0 5.3.0 5.2.0 5.1.0 5.0.0 4.0.0 3.4.0 3.3.0 3.2.0 3.1.0

    public abstract class SessionControllerClient

Reference documentation and code samples for the Google Cloud Dataproc v1 API class SessionControllerClient.

SessionController client wrapper, for convenient use.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> SessionControllerClient

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Derived Types

[SessionControllerClientImpl](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionControllerClientImpl)

## Namespace

[Google.Cloud.Dataproc.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1)

## Assembly

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** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.OperationsClient.html` |   |

### 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** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### DefaultScopes

    public static IReadOnlyList<string> DefaultScopes { get; }

The default SessionController scopes.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1https://learn.microsoft.com/dotnet/api/system.string` |   |

**Remarks** The default SessionController scopes are:

- <https://www.googleapis.com/auth/cloud-platform>
- <https://www.googleapis.com/auth/dataproc>
- <https://www.googleapis.com/auth/dataproc.read-only>

### DeleteSessionOperationsClient

    public virtual OperationsClient DeleteSessionOperationsClient { get; }

The long-running operations client for `DeleteSession`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.OperationsClient.html` |   |

### GrpcClient

    public virtual SessionController.SessionControllerClient GrpcClient { get; }

The underlying gRPC SessionController client

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionControllerhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionController.SessionControllerClient` |   |

### IAMPolicyClient

    public virtual IAMPolicyClient IAMPolicyClient { get; }

The [IAMPolicyClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.IAMPolicyClient.html) associated with this client.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Iam.V1/latest/Google.Cloud.Iam.V1.IAMPolicyClient.html` |   |

### ServiceMetadata

    public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.ServiceMetadata.html` |   |

### TerminateSessionOperationsClient

    public virtual OperationsClient TerminateSessionOperationsClient { get; }

The long-running operations client for `TerminateSession`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.OperationsClient.html` |   |

## Methods

### Create()

    public static SessionControllerClient Create()

Synchronously creates a [SessionControllerClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionControllerClient) using the default credentials, endpoint and
settings. To specify custom credentials or other settings, use [SessionControllerClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionControllerClientBuilder).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionControllerClient` | The created [SessionControllerClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionControllerClient). |

### CreateAsync(CancellationToken)

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

Asynchronously creates a [SessionControllerClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionControllerClient) using the default credentials, endpoint and
settings. To specify custom credentials or other settings, use [SessionControllerClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionControllerClientBuilder).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` The [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use while creating the client. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionControllerClient` | The task representing the created [SessionControllerClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.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` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.LocationName.html` Required. The parent resource where this session will be created. |
| `session` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session` Required. The interactive session to create. |
| `sessionId` | `https://learn.microsoft.com/dotnet/api/system.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` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | The RPC response. |

**Example**

    // 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.CreateSessionRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | The RPC response. |

**Example**

    // 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` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The parent resource where this session will be created. |
| `session` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session` Required. The interactive session to create. |
| `sessionId` | `https://learn.microsoft.com/dotnet/api/system.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` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | The RPC response. |

**Example**

    // 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` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.LocationName.html` Required. The parent resource where this session will be created. |
| `session` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session` Required. The interactive session to create. |
| `sessionId` | `https://learn.microsoft.com/dotnet/api/system.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` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | A Task containing the RPC response. |

**Example**

    // 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` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.LocationName.html` Required. The parent resource where this session will be created. |
| `session` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session` Required. The interactive session to create. |
| `sessionId` | `https://learn.microsoft.com/dotnet/api/system.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` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | A Task containing the RPC response. |

**Example**

    // 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.CreateSessionRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | A Task containing the RPC response. |

**Example**

    // 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.CreateSessionRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | A Task containing the RPC response. |

**Example**

    // 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` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The parent resource where this session will be created. |
| `session` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session` Required. The interactive session to create. |
| `sessionId` | `https://learn.microsoft.com/dotnet/api/system.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` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | A Task containing the RPC response. |

**Example**

    // 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` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The parent resource where this session will be created. |
| `session` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session` Required. The interactive session to create. |
| `sessionId` | `https://learn.microsoft.com/dotnet/api/system.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` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | A Task containing the RPC response. |

**Example**

    // 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.DeleteSessionRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | The RPC response. |

**Example**

    // 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionName` Required. The name of the session resource to delete. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | The RPC response. |

**Example**

    // 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` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The name of the session resource to delete. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | The RPC response. |

**Example**

    // 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.DeleteSessionRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | A Task containing the RPC response. |

**Example**

    // 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.DeleteSessionRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | A Task containing the RPC response. |

**Example**

    // 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionName` Required. The name of the session resource to delete. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | A Task containing the RPC response. |

**Example**

    // 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionName` Required. The name of the session resource to delete. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | A Task containing the RPC response. |

**Example**

    // 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` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The name of the session resource to delete. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | A Task containing the RPC response. |

**Example**

    // 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` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The name of the session resource to delete. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | A Task containing the RPC response. |

**Example**

    // 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.GetSessionRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session` | The RPC response. |

**Example**

    // 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionName` Required. The name of the session to retrieve. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session` | The RPC response. |

**Example**

    // 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` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The name of the session to retrieve. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session` | The RPC response. |

**Example**

    // 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.GetSessionRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session` | A Task containing the RPC response. |

**Example**

    // 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.GetSessionRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session` | A Task containing the RPC response. |

**Example**

    // 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionName` Required. The name of the session to retrieve. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session` | A Task containing the RPC response. |

**Example**

    // 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionName` Required. The name of the session to retrieve. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session` | A Task containing the RPC response. |

**Example**

    // 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` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The name of the session to retrieve. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session` | A Task containing the RPC response. |

**Example**

    // 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` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The name of the session to retrieve. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session` | A Task containing the RPC response. |

**Example**

    // 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` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.LocationName.html` Required. The parent, which owns this collection of sessions. |
| `pageToken` | `https://learn.microsoft.com/dotnet/api/system.string` The token returned from the previous request. A value of `null` or an empty string retrieves the first page. |
| `pageSize` | `https://learn.microsoft.com/dotnet/api/system.int32` 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` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.ListSessionsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session` | A pageable sequence of [Session](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session) resources. |

**Example**

    // 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.ListSessionsRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.ListSessionsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session` | A pageable sequence of [Session](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session) resources. |

**Example**

    // 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` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The parent, which owns this collection of sessions. |
| `pageToken` | `https://learn.microsoft.com/dotnet/api/system.string` The token returned from the previous request. A value of `null` or an empty string retrieves the first page. |
| `pageSize` | `https://learn.microsoft.com/dotnet/api/system.int32` 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` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.ListSessionsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session` | A pageable sequence of [Session](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session) resources. |

**Example**

    // 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` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.LocationName.html` Required. The parent, which owns this collection of sessions. |
| `pageToken` | `https://learn.microsoft.com/dotnet/api/system.string` The token returned from the previous request. A value of `null` or an empty string retrieves the first page. |
| `pageSize` | `https://learn.microsoft.com/dotnet/api/system.int32` 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` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedAsyncEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.ListSessionsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session` | A pageable asynchronous sequence of [Session](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session) resources. |

**Example**

    // 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 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
    await 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 = 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.ListSessionsRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedAsyncEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.ListSessionsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session` | A pageable asynchronous sequence of [Session](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session) resources. |

**Example**

    // 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 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
    await 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 = 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` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The parent, which owns this collection of sessions. |
| `pageToken` | `https://learn.microsoft.com/dotnet/api/system.string` The token returned from the previous request. A value of `null` or an empty string retrieves the first page. |
| `pageSize` | `https://learn.microsoft.com/dotnet/api/system.int32` 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` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedAsyncEnumerable-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.ListSessionsResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session` | A pageable asynchronous sequence of [Session](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Session) resources. |

**Example**

    // 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 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
    await 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 = 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` | `https://learn.microsoft.com/dotnet/api/system.string` The name of a previously invoked operation. Must not be `null` or empty. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | 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` | `https://learn.microsoft.com/dotnet/api/system.string` The name of a previously invoked operation. Must not be `null` or empty. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | 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` | `https://learn.microsoft.com/dotnet/api/system.string` The name of a previously invoked operation. Must not be `null` or empty. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | 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` | `https://learn.microsoft.com/dotnet/api/system.string` The name of a previously invoked operation. Must not be `null` or empty. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | 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` | `https://learn.microsoft.com/dotnet/api/system.string` The name of a previously invoked operation. Must not be `null` or empty. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | 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` | `https://learn.microsoft.com/dotnet/api/system.string` The name of a previously invoked operation. Must not be `null` or empty. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | A task representing the result of polling the operation. |

### ShutdownDefaultChannelsAsync()

    public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionControllerClient#Google_Cloud_Dataproc_V1_SessionControllerClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionControllerClient#Google_Cloud_Dataproc_V1_SessionControllerClient_CreateAsync_System_Threading_CancellationToken_). Channels which weren't automatically created are not
affected.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task` | A task representing the asynchronous shutdown operation. |

**Remarks** After calling this method, further calls to [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionControllerClient#Google_Cloud_Dataproc_V1_SessionControllerClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionControllerClient#Google_Cloud_Dataproc_V1_SessionControllerClient_CreateAsync_System_Threading_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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionName` Required. The name of the session resource to terminate. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | The RPC response. |

**Example**

    // 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.TerminateSessionRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | The RPC response. |

**Example**

    // 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` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The name of the session resource to terminate. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | The RPC response. |

**Example**

    // 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionName` Required. The name of the session resource to terminate. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | A Task containing the RPC response. |

**Example**

    // 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionName` Required. The name of the session resource to terminate. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | A Task containing the RPC response. |

**Example**

    // 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.TerminateSessionRequest` The request object containing all of the parameters for the API call. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | A Task containing the RPC response. |

**Example**

    // 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` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.TerminateSessionRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | A Task containing the RPC response. |

**Example**

    // 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` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The name of the session resource to terminate. |
| `callSettings` | `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Grpc.CallSettings.html` If not null, applies overrides to this RPC call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | A Task containing the RPC response. |

**Example**

    // 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` | `https://learn.microsoft.com/dotnet/api/system.string` Required. The name of the session resource to terminate. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operation-2.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.Sessionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Dataproc.V1/latest/Google.Cloud.Dataproc.V1.SessionOperationMetadata` | A Task containing the RPC response. |

**Example**

    // 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;
    }