# Cloud Shell v1 API - Class CloudShellServiceClient (2.6.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.6.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.CloudShellServiceClient)
- [2.5.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/2.5.0/Google.Cloud.Shell.V1.CloudShellServiceClient)
- [2.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/2.4.0/Google.Cloud.Shell.V1.CloudShellServiceClient)
- [2.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/2.3.0/Google.Cloud.Shell.V1.CloudShellServiceClient)
- [2.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/2.2.0/Google.Cloud.Shell.V1.CloudShellServiceClient)
- [2.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/2.1.0/Google.Cloud.Shell.V1.CloudShellServiceClient)
- [2.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/2.0.0/Google.Cloud.Shell.V1.CloudShellServiceClient)
- [1.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/1.1.0/Google.Cloud.Shell.V1.CloudShellServiceClient)
- [1.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/1.0.0/Google.Cloud.Shell.V1.CloudShellServiceClient)

    public abstract class CloudShellServiceClient

Reference documentation and code samples for the Cloud Shell v1 API class CloudShellServiceClient.

CloudShellService client wrapper, for convenient use.

## Inheritance

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

## 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

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

## Namespace

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

## Assembly

Google.Cloud.Shell.V1.dll

## Remarks

API for interacting with Google Cloud Shell. Each user of Cloud Shell has at
least one environment, which has the ID "default". Environment consists of a
Docker image defining what is installed on the environment and a home
directory containing the user's data that will remain across sessions.
Clients use this API to start and fetch information about their environment,
which can then be used to connect to that environment via a separate SSH
client.

## Properties

### AddPublicKeyOperationsClient

    public virtual OperationsClient AddPublicKeyOperationsClient { get; }

The long-running operations client for `AddPublicKey`.

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

### AuthorizeEnvironmentOperationsClient

    public virtual OperationsClient AuthorizeEnvironmentOperationsClient { get; }

The long-running operations client for `AuthorizeEnvironment`.

| **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 CloudShellService service, which is a host of "cloudshell.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 CloudShellService 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 CloudShellService scopes are:

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

<br />

### GrpcClient

    public virtual CloudShellService.CloudShellServiceClient GrpcClient { get; }

The underlying gRPC CloudShellService client

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.CloudShellServicehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.CloudShellService.CloudShellServiceClient` |   |

### RemovePublicKeyOperationsClient

    public virtual OperationsClient RemovePublicKeyOperationsClient { get; }

The long-running operations client for `RemovePublicKey`.

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

### StartEnvironmentOperationsClient

    public virtual OperationsClient StartEnvironmentOperationsClient { get; }

The long-running operations client for `StartEnvironment`.

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

## Methods

### AddPublicKey(AddPublicKeyRequest, CallSettings)

    public virtual Operation<AddPublicKeyResponse, AddPublicKeyMetadata> AddPublicKey(AddPublicKeyRequest request, CallSettings callSettings = null)

Adds a public SSH key to an environment, allowing clients with the
corresponding private key to connect to that environment via SSH. If a key
with the same content already exists, this will error with ALREADY_EXISTS.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.AddPublicKeyRequest` 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.Shell.V1/latest/Google.Cloud.Shell.V1.AddPublicKeyResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.AddPublicKeyMetadata` | The RPC response. |

**Example**

    // Create client
    CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.Create();
    // Initialize request argument(s)
    AddPublicKeyRequest request = new AddPublicKeyRequest
    {
        Environment = "",
        Key = "",
    };
    // Make the request
    Operation<AddPublicKeyResponse, AddPublicKeyMetadata> response = cloudShellServiceClient.AddPublicKey(request);

    // Poll until the returned long-running operation is complete
    Operation<AddPublicKeyResponse, AddPublicKeyMetadata> completedResponse = response.PollUntilCompleted();
    // Retrieve the operation result
    AddPublicKeyResponse 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<AddPublicKeyResponse, AddPublicKeyMetadata> retrievedResponse = cloudShellServiceClient.PollOnceAddPublicKey(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        AddPublicKeyResponse retrievedResult = retrievedResponse.Result;
    }

### AddPublicKeyAsync(AddPublicKeyRequest, CallSettings)

    public virtual Task<Operation<AddPublicKeyResponse, AddPublicKeyMetadata>> AddPublicKeyAsync(AddPublicKeyRequest request, CallSettings callSettings = null)

Adds a public SSH key to an environment, allowing clients with the
corresponding private key to connect to that environment via SSH. If a key
with the same content already exists, this will error with ALREADY_EXISTS.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.AddPublicKeyRequest` 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.Shell.V1/latest/Google.Cloud.Shell.V1.AddPublicKeyResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.AddPublicKeyMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
    // Initialize request argument(s)
    AddPublicKeyRequest request = new AddPublicKeyRequest
    {
        Environment = "",
        Key = "",
    };
    // Make the request
    Operation<AddPublicKeyResponse, AddPublicKeyMetadata> response = await cloudShellServiceClient.AddPublicKeyAsync(request);

    // Poll until the returned long-running operation is complete
    Operation<AddPublicKeyResponse, AddPublicKeyMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    AddPublicKeyResponse 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<AddPublicKeyResponse, AddPublicKeyMetadata> retrievedResponse = await cloudShellServiceClient.PollOnceAddPublicKeyAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        AddPublicKeyResponse retrievedResult = retrievedResponse.Result;
    }

### AddPublicKeyAsync(AddPublicKeyRequest, CancellationToken)

    public virtual Task<Operation<AddPublicKeyResponse, AddPublicKeyMetadata>> AddPublicKeyAsync(AddPublicKeyRequest request, CancellationToken cancellationToken)

Adds a public SSH key to an environment, allowing clients with the
corresponding private key to connect to that environment via SSH. If a key
with the same content already exists, this will error with ALREADY_EXISTS.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.AddPublicKeyRequest` 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.Shell.V1/latest/Google.Cloud.Shell.V1.AddPublicKeyResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.AddPublicKeyMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
    // Initialize request argument(s)
    AddPublicKeyRequest request = new AddPublicKeyRequest
    {
        Environment = "",
        Key = "",
    };
    // Make the request
    Operation<AddPublicKeyResponse, AddPublicKeyMetadata> response = await cloudShellServiceClient.AddPublicKeyAsync(request);

    // Poll until the returned long-running operation is complete
    Operation<AddPublicKeyResponse, AddPublicKeyMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    AddPublicKeyResponse 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<AddPublicKeyResponse, AddPublicKeyMetadata> retrievedResponse = await cloudShellServiceClient.PollOnceAddPublicKeyAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        AddPublicKeyResponse retrievedResult = retrievedResponse.Result;
    }

### AuthorizeEnvironment(AuthorizeEnvironmentRequest, CallSettings)

    public virtual Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> AuthorizeEnvironment(AuthorizeEnvironmentRequest request, CallSettings callSettings = null)

Sends OAuth credentials to a running environment on behalf of a user. When
this completes, the environment will be authorized to run various Google
Cloud command line tools without requiring the user to manually
authenticate.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.AuthorizeEnvironmentRequest` 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.Shell.V1/latest/Google.Cloud.Shell.V1.AuthorizeEnvironmentResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.AuthorizeEnvironmentMetadata` | The RPC response. |

**Example**

    // Create client
    CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.Create();
    // Initialize request argument(s)
    AuthorizeEnvironmentRequest request = new AuthorizeEnvironmentRequest
    {
        Name = "",
        AccessToken = "",
        ExpireTime = new Timestamp(),
        IdToken = "",
    };
    // Make the request
    Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> response = cloudShellServiceClient.AuthorizeEnvironment(request);

    // Poll until the returned long-running operation is complete
    Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> completedResponse = response.PollUntilCompleted();
    // Retrieve the operation result
    AuthorizeEnvironmentResponse 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<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> retrievedResponse = cloudShellServiceClient.PollOnceAuthorizeEnvironment(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        AuthorizeEnvironmentResponse retrievedResult = retrievedResponse.Result;
    }

### AuthorizeEnvironmentAsync(AuthorizeEnvironmentRequest, CallSettings)

    public virtual Task<Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata>> AuthorizeEnvironmentAsync(AuthorizeEnvironmentRequest request, CallSettings callSettings = null)

Sends OAuth credentials to a running environment on behalf of a user. When
this completes, the environment will be authorized to run various Google
Cloud command line tools without requiring the user to manually
authenticate.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.AuthorizeEnvironmentRequest` 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.Shell.V1/latest/Google.Cloud.Shell.V1.AuthorizeEnvironmentResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.AuthorizeEnvironmentMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
    // Initialize request argument(s)
    AuthorizeEnvironmentRequest request = new AuthorizeEnvironmentRequest
    {
        Name = "",
        AccessToken = "",
        ExpireTime = new Timestamp(),
        IdToken = "",
    };
    // Make the request
    Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> response = await cloudShellServiceClient.AuthorizeEnvironmentAsync(request);

    // Poll until the returned long-running operation is complete
    Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    AuthorizeEnvironmentResponse 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<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> retrievedResponse = await cloudShellServiceClient.PollOnceAuthorizeEnvironmentAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        AuthorizeEnvironmentResponse retrievedResult = retrievedResponse.Result;
    }

### AuthorizeEnvironmentAsync(AuthorizeEnvironmentRequest, CancellationToken)

    public virtual Task<Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata>> AuthorizeEnvironmentAsync(AuthorizeEnvironmentRequest request, CancellationToken cancellationToken)

Sends OAuth credentials to a running environment on behalf of a user. When
this completes, the environment will be authorized to run various Google
Cloud command line tools without requiring the user to manually
authenticate.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.AuthorizeEnvironmentRequest` 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.Shell.V1/latest/Google.Cloud.Shell.V1.AuthorizeEnvironmentResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.AuthorizeEnvironmentMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
    // Initialize request argument(s)
    AuthorizeEnvironmentRequest request = new AuthorizeEnvironmentRequest
    {
        Name = "",
        AccessToken = "",
        ExpireTime = new Timestamp(),
        IdToken = "",
    };
    // Make the request
    Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> response = await cloudShellServiceClient.AuthorizeEnvironmentAsync(request);

    // Poll until the returned long-running operation is complete
    Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    AuthorizeEnvironmentResponse 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<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> retrievedResponse = await cloudShellServiceClient.PollOnceAuthorizeEnvironmentAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        AuthorizeEnvironmentResponse retrievedResult = retrievedResponse.Result;
    }

### Create()

    public static CloudShellServiceClient Create()

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

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

### CreateAsync(CancellationToken)

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

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

| **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.Shell.V1/latest/Google.Cloud.Shell.V1.CloudShellServiceClient` | The task representing the created [CloudShellServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.CloudShellServiceClient). |

### GetEnvironment(EnvironmentName, CallSettings)

    public virtual Environment GetEnvironment(EnvironmentName name, CallSettings callSettings = null)

Gets an environment. Returns NOT_FOUND if the environment does not exist.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.EnvironmentName` Required. Name of the requested resource, for example `users/me/environments/default` or `users/someone@example.com/environments/default`. |
| `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.Shell.V1/latest/Google.Cloud.Shell.V1.Environment` | The RPC response. |

**Example**

    // Create client
    CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.Create();
    // Initialize request argument(s)
    EnvironmentName name = EnvironmentName.FromUserEnvironment("[USER]", "[ENVIRONMENT]");
    // Make the request
    Environment response = cloudShellServiceClient.GetEnvironment(name);

### GetEnvironment(GetEnvironmentRequest, CallSettings)

    public virtual Environment GetEnvironment(GetEnvironmentRequest request, CallSettings callSettings = null)

Gets an environment. Returns NOT_FOUND if the environment does not exist.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.GetEnvironmentRequest` 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.Shell.V1/latest/Google.Cloud.Shell.V1.Environment` | The RPC response. |

**Example**

    // Create client
    CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.Create();
    // Initialize request argument(s)
    GetEnvironmentRequest request = new GetEnvironmentRequest
    {
        EnvironmentName = EnvironmentName.FromUserEnvironment("[USER]", "[ENVIRONMENT]"),
    };
    // Make the request
    Environment response = cloudShellServiceClient.GetEnvironment(request);

### GetEnvironment(string, CallSettings)

    public virtual Environment GetEnvironment(string name, CallSettings callSettings = null)

Gets an environment. Returns NOT_FOUND if the environment does not exist.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://learn.microsoft.com/dotnet/api/system.string` Required. Name of the requested resource, for example `users/me/environments/default` or `users/someone@example.com/environments/default`. |
| `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.Shell.V1/latest/Google.Cloud.Shell.V1.Environment` | The RPC response. |

**Example**

    // Create client
    CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.Create();
    // Initialize request argument(s)
    string name = "users/[USER]/environments/[ENVIRONMENT]";
    // Make the request
    Environment response = cloudShellServiceClient.GetEnvironment(name);

### GetEnvironmentAsync(EnvironmentName, CallSettings)

    public virtual Task<Environment> GetEnvironmentAsync(EnvironmentName name, CallSettings callSettings = null)

Gets an environment. Returns NOT_FOUND if the environment does not exist.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.EnvironmentName` Required. Name of the requested resource, for example `users/me/environments/default` or `users/someone@example.com/environments/default`. |
| `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.Shell.V1/latest/Google.Cloud.Shell.V1.Environment` | A Task containing the RPC response. |

**Example**

    // Create client
    CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
    // Initialize request argument(s)
    EnvironmentName name = EnvironmentName.FromUserEnvironment("[USER]", "[ENVIRONMENT]");
    // Make the request
    Environment response = await cloudShellServiceClient.GetEnvironmentAsync(name);

### GetEnvironmentAsync(EnvironmentName, CancellationToken)

    public virtual Task<Environment> GetEnvironmentAsync(EnvironmentName name, CancellationToken cancellationToken)

Gets an environment. Returns NOT_FOUND if the environment does not exist.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.EnvironmentName` Required. Name of the requested resource, for example `users/me/environments/default` or `users/someone@example.com/environments/default`. |
| `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.Shell.V1/latest/Google.Cloud.Shell.V1.Environment` | A Task containing the RPC response. |

**Example**

    // Create client
    CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
    // Initialize request argument(s)
    EnvironmentName name = EnvironmentName.FromUserEnvironment("[USER]", "[ENVIRONMENT]");
    // Make the request
    Environment response = await cloudShellServiceClient.GetEnvironmentAsync(name);

### GetEnvironmentAsync(GetEnvironmentRequest, CallSettings)

    public virtual Task<Environment> GetEnvironmentAsync(GetEnvironmentRequest request, CallSettings callSettings = null)

Gets an environment. Returns NOT_FOUND if the environment does not exist.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.GetEnvironmentRequest` 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.Shell.V1/latest/Google.Cloud.Shell.V1.Environment` | A Task containing the RPC response. |

**Example**

    // Create client
    CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
    // Initialize request argument(s)
    GetEnvironmentRequest request = new GetEnvironmentRequest
    {
        EnvironmentName = EnvironmentName.FromUserEnvironment("[USER]", "[ENVIRONMENT]"),
    };
    // Make the request
    Environment response = await cloudShellServiceClient.GetEnvironmentAsync(request);

### GetEnvironmentAsync(GetEnvironmentRequest, CancellationToken)

    public virtual Task<Environment> GetEnvironmentAsync(GetEnvironmentRequest request, CancellationToken cancellationToken)

Gets an environment. Returns NOT_FOUND if the environment does not exist.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.GetEnvironmentRequest` 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.Shell.V1/latest/Google.Cloud.Shell.V1.Environment` | A Task containing the RPC response. |

**Example**

    // Create client
    CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
    // Initialize request argument(s)
    GetEnvironmentRequest request = new GetEnvironmentRequest
    {
        EnvironmentName = EnvironmentName.FromUserEnvironment("[USER]", "[ENVIRONMENT]"),
    };
    // Make the request
    Environment response = await cloudShellServiceClient.GetEnvironmentAsync(request);

### GetEnvironmentAsync(string, CallSettings)

    public virtual Task<Environment> GetEnvironmentAsync(string name, CallSettings callSettings = null)

Gets an environment. Returns NOT_FOUND if the environment does not exist.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://learn.microsoft.com/dotnet/api/system.string` Required. Name of the requested resource, for example `users/me/environments/default` or `users/someone@example.com/environments/default`. |
| `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.Shell.V1/latest/Google.Cloud.Shell.V1.Environment` | A Task containing the RPC response. |

**Example**

    // Create client
    CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
    // Initialize request argument(s)
    string name = "users/[USER]/environments/[ENVIRONMENT]";
    // Make the request
    Environment response = await cloudShellServiceClient.GetEnvironmentAsync(name);

### GetEnvironmentAsync(string, CancellationToken)

    public virtual Task<Environment> GetEnvironmentAsync(string name, CancellationToken cancellationToken)

Gets an environment. Returns NOT_FOUND if the environment does not exist.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://learn.microsoft.com/dotnet/api/system.string` Required. Name of the requested resource, for example `users/me/environments/default` or `users/someone@example.com/environments/default`. |
| `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.Shell.V1/latest/Google.Cloud.Shell.V1.Environment` | A Task containing the RPC response. |

**Example**

    // Create client
    CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
    // Initialize request argument(s)
    string name = "users/[USER]/environments/[ENVIRONMENT]";
    // Make the request
    Environment response = await cloudShellServiceClient.GetEnvironmentAsync(name);

### PollOnceAddPublicKey(string, CallSettings)

    public virtual Operation<AddPublicKeyResponse, AddPublicKeyMetadata> PollOnceAddPublicKey(string operationName, CallSettings callSettings = null)

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

| **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.Shell.V1/latest/Google.Cloud.Shell.V1.AddPublicKeyResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.AddPublicKeyMetadata` | The result of polling the operation. |

### PollOnceAddPublicKeyAsync(string, CallSettings)

    public virtual Task<Operation<AddPublicKeyResponse, AddPublicKeyMetadata>> PollOnceAddPublicKeyAsync(string operationName, CallSettings callSettings = null)

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

| **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.Shell.V1/latest/Google.Cloud.Shell.V1.AddPublicKeyResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.AddPublicKeyMetadata` | A task representing the result of polling the operation. |

### PollOnceAuthorizeEnvironment(string, CallSettings)

    public virtual Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata> PollOnceAuthorizeEnvironment(string operationName, CallSettings callSettings = null)

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

| **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.Shell.V1/latest/Google.Cloud.Shell.V1.AuthorizeEnvironmentResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.AuthorizeEnvironmentMetadata` | The result of polling the operation. |

### PollOnceAuthorizeEnvironmentAsync(string, CallSettings)

    public virtual Task<Operation<AuthorizeEnvironmentResponse, AuthorizeEnvironmentMetadata>> PollOnceAuthorizeEnvironmentAsync(string operationName, CallSettings callSettings = null)

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

| **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.Shell.V1/latest/Google.Cloud.Shell.V1.AuthorizeEnvironmentResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.AuthorizeEnvironmentMetadata` | A task representing the result of polling the operation. |

### PollOnceRemovePublicKey(string, CallSettings)

    public virtual Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata> PollOnceRemovePublicKey(string operationName, CallSettings callSettings = null)

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

| **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.Shell.V1/latest/Google.Cloud.Shell.V1.RemovePublicKeyResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.RemovePublicKeyMetadata` | The result of polling the operation. |

### PollOnceRemovePublicKeyAsync(string, CallSettings)

    public virtual Task<Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata>> PollOnceRemovePublicKeyAsync(string operationName, CallSettings callSettings = null)

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

| **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.Shell.V1/latest/Google.Cloud.Shell.V1.RemovePublicKeyResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.RemovePublicKeyMetadata` | A task representing the result of polling the operation. |

### PollOnceStartEnvironment(string, CallSettings)

    public virtual Operation<StartEnvironmentResponse, StartEnvironmentMetadata> PollOnceStartEnvironment(string operationName, CallSettings callSettings = null)

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

| **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.Shell.V1/latest/Google.Cloud.Shell.V1.StartEnvironmentResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.StartEnvironmentMetadata` | The result of polling the operation. |

### PollOnceStartEnvironmentAsync(string, CallSettings)

    public virtual Task<Operation<StartEnvironmentResponse, StartEnvironmentMetadata>> PollOnceStartEnvironmentAsync(string operationName, CallSettings callSettings = null)

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

| **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.Shell.V1/latest/Google.Cloud.Shell.V1.StartEnvironmentResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.StartEnvironmentMetadata` | A task representing the result of polling the operation. |

### RemovePublicKey(RemovePublicKeyRequest, CallSettings)

    public virtual Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata> RemovePublicKey(RemovePublicKeyRequest request, CallSettings callSettings = null)

Removes a public SSH key from an environment. Clients will no longer be
able to connect to the environment using the corresponding private key.
If a key with the same content is not present, this will error with
NOT_FOUND.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.RemovePublicKeyRequest` 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.Shell.V1/latest/Google.Cloud.Shell.V1.RemovePublicKeyResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.RemovePublicKeyMetadata` | The RPC response. |

**Example**

    // Create client
    CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.Create();
    // Initialize request argument(s)
    RemovePublicKeyRequest request = new RemovePublicKeyRequest
    {
        Environment = "",
        Key = "",
    };
    // Make the request
    Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata> response = cloudShellServiceClient.RemovePublicKey(request);

    // Poll until the returned long-running operation is complete
    Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata> completedResponse = response.PollUntilCompleted();
    // Retrieve the operation result
    RemovePublicKeyResponse 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<RemovePublicKeyResponse, RemovePublicKeyMetadata> retrievedResponse = cloudShellServiceClient.PollOnceRemovePublicKey(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        RemovePublicKeyResponse retrievedResult = retrievedResponse.Result;
    }

### RemovePublicKeyAsync(RemovePublicKeyRequest, CallSettings)

    public virtual Task<Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata>> RemovePublicKeyAsync(RemovePublicKeyRequest request, CallSettings callSettings = null)

Removes a public SSH key from an environment. Clients will no longer be
able to connect to the environment using the corresponding private key.
If a key with the same content is not present, this will error with
NOT_FOUND.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.RemovePublicKeyRequest` 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.Shell.V1/latest/Google.Cloud.Shell.V1.RemovePublicKeyResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.RemovePublicKeyMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
    // Initialize request argument(s)
    RemovePublicKeyRequest request = new RemovePublicKeyRequest
    {
        Environment = "",
        Key = "",
    };
    // Make the request
    Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata> response = await cloudShellServiceClient.RemovePublicKeyAsync(request);

    // Poll until the returned long-running operation is complete
    Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    RemovePublicKeyResponse 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<RemovePublicKeyResponse, RemovePublicKeyMetadata> retrievedResponse = await cloudShellServiceClient.PollOnceRemovePublicKeyAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        RemovePublicKeyResponse retrievedResult = retrievedResponse.Result;
    }

### RemovePublicKeyAsync(RemovePublicKeyRequest, CancellationToken)

    public virtual Task<Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata>> RemovePublicKeyAsync(RemovePublicKeyRequest request, CancellationToken cancellationToken)

Removes a public SSH key from an environment. Clients will no longer be
able to connect to the environment using the corresponding private key.
If a key with the same content is not present, this will error with
NOT_FOUND.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.RemovePublicKeyRequest` 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.Shell.V1/latest/Google.Cloud.Shell.V1.RemovePublicKeyResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.RemovePublicKeyMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
    // Initialize request argument(s)
    RemovePublicKeyRequest request = new RemovePublicKeyRequest
    {
        Environment = "",
        Key = "",
    };
    // Make the request
    Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata> response = await cloudShellServiceClient.RemovePublicKeyAsync(request);

    // Poll until the returned long-running operation is complete
    Operation<RemovePublicKeyResponse, RemovePublicKeyMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    RemovePublicKeyResponse 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<RemovePublicKeyResponse, RemovePublicKeyMetadata> retrievedResponse = await cloudShellServiceClient.PollOnceRemovePublicKeyAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        RemovePublicKeyResponse retrievedResult = retrievedResponse.Result;
    }

### ShutdownDefaultChannelsAsync()

    public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by [Create()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.CloudShellServiceClient#Google_Cloud_Shell_V1_CloudShellServiceClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.CloudShellServiceClient#Google_Cloud_Shell_V1_CloudShellServiceClient_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.Shell.V1/latest/Google.Cloud.Shell.V1.CloudShellServiceClient#Google_Cloud_Shell_V1_CloudShellServiceClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.CloudShellServiceClient#Google_Cloud_Shell_V1_CloudShellServiceClient_CreateAsync_System_Threading_CancellationToken_) will create new channels, which could in turn be shut down
by another call to this method.

### StartEnvironment(StartEnvironmentRequest, CallSettings)

    public virtual Operation<StartEnvironmentResponse, StartEnvironmentMetadata> StartEnvironment(StartEnvironmentRequest request, CallSettings callSettings = null)

Starts an existing environment, allowing clients to connect to it. The
returned operation will contain an instance of StartEnvironmentMetadata in
its metadata field. Users can wait for the environment to start by polling
this operation via GetOperation. Once the environment has finished starting
and is ready to accept connections, the operation will contain a
StartEnvironmentResponse in its response field.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.StartEnvironmentRequest` 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.Shell.V1/latest/Google.Cloud.Shell.V1.StartEnvironmentResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.StartEnvironmentMetadata` | The RPC response. |

**Example**

    // Create client
    CloudShellServiceClient cloudShellServiceClient = CloudShellServiceClient.Create();
    // Initialize request argument(s)
    StartEnvironmentRequest request = new StartEnvironmentRequest
    {
        Name = "",
        AccessToken = "",
        PublicKeys = { "", },
    };
    // Make the request
    Operation<StartEnvironmentResponse, StartEnvironmentMetadata> response = cloudShellServiceClient.StartEnvironment(request);

    // Poll until the returned long-running operation is complete
    Operation<StartEnvironmentResponse, StartEnvironmentMetadata> completedResponse = response.PollUntilCompleted();
    // Retrieve the operation result
    StartEnvironmentResponse 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<StartEnvironmentResponse, StartEnvironmentMetadata> retrievedResponse = cloudShellServiceClient.PollOnceStartEnvironment(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        StartEnvironmentResponse retrievedResult = retrievedResponse.Result;
    }

### StartEnvironmentAsync(StartEnvironmentRequest, CallSettings)

    public virtual Task<Operation<StartEnvironmentResponse, StartEnvironmentMetadata>> StartEnvironmentAsync(StartEnvironmentRequest request, CallSettings callSettings = null)

Starts an existing environment, allowing clients to connect to it. The
returned operation will contain an instance of StartEnvironmentMetadata in
its metadata field. Users can wait for the environment to start by polling
this operation via GetOperation. Once the environment has finished starting
and is ready to accept connections, the operation will contain a
StartEnvironmentResponse in its response field.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.StartEnvironmentRequest` 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.Shell.V1/latest/Google.Cloud.Shell.V1.StartEnvironmentResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.StartEnvironmentMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
    // Initialize request argument(s)
    StartEnvironmentRequest request = new StartEnvironmentRequest
    {
        Name = "",
        AccessToken = "",
        PublicKeys = { "", },
    };
    // Make the request
    Operation<StartEnvironmentResponse, StartEnvironmentMetadata> response = await cloudShellServiceClient.StartEnvironmentAsync(request);

    // Poll until the returned long-running operation is complete
    Operation<StartEnvironmentResponse, StartEnvironmentMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    StartEnvironmentResponse 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<StartEnvironmentResponse, StartEnvironmentMetadata> retrievedResponse = await cloudShellServiceClient.PollOnceStartEnvironmentAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        StartEnvironmentResponse retrievedResult = retrievedResponse.Result;
    }

### StartEnvironmentAsync(StartEnvironmentRequest, CancellationToken)

    public virtual Task<Operation<StartEnvironmentResponse, StartEnvironmentMetadata>> StartEnvironmentAsync(StartEnvironmentRequest request, CancellationToken cancellationToken)

Starts an existing environment, allowing clients to connect to it. The
returned operation will contain an instance of StartEnvironmentMetadata in
its metadata field. Users can wait for the environment to start by polling
this operation via GetOperation. Once the environment has finished starting
and is ready to accept connections, the operation will contain a
StartEnvironmentResponse in its response field.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.StartEnvironmentRequest` 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.Shell.V1/latest/Google.Cloud.Shell.V1.StartEnvironmentResponsehttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Shell.V1/latest/Google.Cloud.Shell.V1.StartEnvironmentMetadata` | A Task containing the RPC response. |

**Example**

    // Create client
    CloudShellServiceClient cloudShellServiceClient = await CloudShellServiceClient.CreateAsync();
    // Initialize request argument(s)
    StartEnvironmentRequest request = new StartEnvironmentRequest
    {
        Name = "",
        AccessToken = "",
        PublicKeys = { "", },
    };
    // Make the request
    Operation<StartEnvironmentResponse, StartEnvironmentMetadata> response = await cloudShellServiceClient.StartEnvironmentAsync(request);

    // Poll until the returned long-running operation is complete
    Operation<StartEnvironmentResponse, StartEnvironmentMetadata> completedResponse = await response.PollUntilCompletedAsync();
    // Retrieve the operation result
    StartEnvironmentResponse 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<StartEnvironmentResponse, StartEnvironmentMetadata> retrievedResponse = await cloudShellServiceClient.PollOnceStartEnvironmentAsync(operationName);
    // Check if the retrieved long-running operation has completed
    if (retrievedResponse.IsCompleted)
    {
        // If it has completed, then access the result
        StartEnvironmentResponse retrievedResult = retrievedResponse.Result;
    }