# Connect Gateway v1 API - Class GatewayControlClient (1.1.0)

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

- [1.1.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.GkeConnect.Gateway.V1/latest/Google.Cloud.GkeConnect.Gateway.V1.GatewayControlClient)
- [1.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.GkeConnect.Gateway.V1/1.0.0/Google.Cloud.GkeConnect.Gateway.V1.GatewayControlClient)

    public abstract class GatewayControlClient

Reference documentation and code samples for the Connect Gateway v1 API class GatewayControlClient.

GatewayControl client wrapper, for convenient use.

## Inheritance

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

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

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

## Namespace

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

## Assembly

Google.Cloud.GkeConnect.Gateway.V1.dll

## Remarks

GatewayControl is the control plane API for Connect Gateway.

## Properties

### DefaultEndpoint

    public static string DefaultEndpoint { get; }

The default endpoint for the GatewayControl service, which is a host of "connectgateway.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 GatewayControl 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 GatewayControl scopes are:

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

<br />

### GrpcClient

    public virtual GatewayControl.GatewayControlClient GrpcClient { get; }

The underlying gRPC GatewayControl client

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.GkeConnect.Gateway.V1/latest/Google.Cloud.GkeConnect.Gateway.V1.GatewayControlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.GkeConnect.Gateway.V1/latest/Google.Cloud.GkeConnect.Gateway.V1.GatewayControl.GatewayControlClient` |   |

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

## Methods

### Create()

    public static GatewayControlClient Create()

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

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

### CreateAsync(CancellationToken)

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

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

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

### GenerateCredentials(GenerateCredentialsRequest, CallSettings)

    public virtual GenerateCredentialsResponse GenerateCredentials(GenerateCredentialsRequest request, CallSettings callSettings = null)

GenerateCredentials provides connection information that allows a user to
access the specified membership using Connect Gateway.

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

**Example**

    // Create client
    GatewayControlClient gatewayControlClient = GatewayControlClient.Create();
    // Initialize request argument(s)
    GenerateCredentialsRequest request = new GenerateCredentialsRequest
    {
        Name = "",
        ForceUseAgent = false,
        Version = "",
        KubernetesNamespace = "",
        OperatingSystem = GenerateCredentialsRequest.Types.OperatingSystem.Unspecified,
    };
    // Make the request
    GenerateCredentialsResponse response = gatewayControlClient.GenerateCredentials(request);

### GenerateCredentialsAsync(GenerateCredentialsRequest, CallSettings)

    public virtual Task<GenerateCredentialsResponse> GenerateCredentialsAsync(GenerateCredentialsRequest request, CallSettings callSettings = null)

GenerateCredentials provides connection information that allows a user to
access the specified membership using Connect Gateway.

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

**Example**

    // Create client
    GatewayControlClient gatewayControlClient = await GatewayControlClient.CreateAsync();
    // Initialize request argument(s)
    GenerateCredentialsRequest request = new GenerateCredentialsRequest
    {
        Name = "",
        ForceUseAgent = false,
        Version = "",
        KubernetesNamespace = "",
        OperatingSystem = GenerateCredentialsRequest.Types.OperatingSystem.Unspecified,
    };
    // Make the request
    GenerateCredentialsResponse response = await gatewayControlClient.GenerateCredentialsAsync(request);

### GenerateCredentialsAsync(GenerateCredentialsRequest, CancellationToken)

    public virtual Task<GenerateCredentialsResponse> GenerateCredentialsAsync(GenerateCredentialsRequest request, CancellationToken cancellationToken)

GenerateCredentials provides connection information that allows a user to
access the specified membership using Connect Gateway.

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

**Example**

    // Create client
    GatewayControlClient gatewayControlClient = await GatewayControlClient.CreateAsync();
    // Initialize request argument(s)
    GenerateCredentialsRequest request = new GenerateCredentialsRequest
    {
        Name = "",
        ForceUseAgent = false,
        Version = "",
        KubernetesNamespace = "",
        OperatingSystem = GenerateCredentialsRequest.Types.OperatingSystem.Unspecified,
    };
    // Make the request
    GenerateCredentialsResponse response = await gatewayControlClient.GenerateCredentialsAsync(request);

### ShutdownDefaultChannelsAsync()

    public static Task ShutdownDefaultChannelsAsync()

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