# Cloud Build v2 API - Class Connection (1.5.0)

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

- [1.5.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.Connection)
- [1.4.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/1.4.0/Google.Cloud.CloudBuild.V2.Connection)
- [1.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/1.3.0/Google.Cloud.CloudBuild.V2.Connection)
- [1.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/1.2.0/Google.Cloud.CloudBuild.V2.Connection)
- [1.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/1.1.0/Google.Cloud.CloudBuild.V2.Connection)
- [1.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/1.0.0/Google.Cloud.CloudBuild.V2.Connection)

    public sealed class Connection : IMessage<Connection>, IEquatable<Connection>, IDeepCloneable<Connection>, IBufferMessage, IMessage

Reference documentation and code samples for the Cloud Build v2 API class Connection.

A connection to a SCM like GitHub, GitHub Enterprise, Bitbucket Data Center,
Bitbucket Cloud or GitLab.

## Inheritance

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

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Connection](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.Connection), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Connection](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.Connection), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Connection](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.Connection), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## 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.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

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

## Assembly

Google.Cloud.CloudBuild.V2.dll

## Constructors

### Connection()

    public Connection()

### Connection(Connection)

    public Connection(Connection other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.Connection` |

## Properties

### Annotations

    public MapField<string, string> Annotations { get; }

Allows clients to store small amounts of arbitrary data.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.MapField-2.htmlhttps://learn.microsoft.com/dotnet/api/system.stringhttps://learn.microsoft.com/dotnet/api/system.string` |   |

### BitbucketCloudConfig

    public BitbucketCloudConfig BitbucketCloudConfig { get; set; }

Configuration for connections to Bitbucket Cloud.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.BitbucketCloudConfig` |   |

### BitbucketDataCenterConfig

    public BitbucketDataCenterConfig BitbucketDataCenterConfig { get; set; }

Configuration for connections to Bitbucket Data Center.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.BitbucketDataCenterConfig` |   |

### ConnectionConfigCase

    public Connection.ConnectionConfigOneofCase ConnectionConfigCase { get; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.Connectionhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.Connection.ConnectionConfigOneofCase` |   |

### ConnectionName

    public ConnectionName ConnectionName { get; set; }

[ConnectionName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.ConnectionName)-typed view over the [Name](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.Connection#Google_Cloud_CloudBuild_V2_Connection_Name) resource name property.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.ConnectionName` |   |

### CreateTime

    public Timestamp CreateTime { get; set; }

Output only. Server assigned timestamp for when the connection was created.

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

### Disabled

    public bool Disabled { get; set; }

If disabled is set to true, functionality is disabled for this connection.
Repository based API methods and webhooks processing for repositories in
this connection will be disabled.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### Etag

    public string Etag { get; set; }

This checksum is computed by the server based on the value of other
fields, and may be sent on update and delete requests to ensure the
client has an up-to-date value before proceeding.

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

### GithubConfig

    public GitHubConfig GithubConfig { get; set; }

Configuration for connections to github.com.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.GitHubConfig` |   |

### GithubEnterpriseConfig

    public GitHubEnterpriseConfig GithubEnterpriseConfig { get; set; }

Configuration for connections to an instance of GitHub Enterprise.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.GitHubEnterpriseConfig` |   |

### GitlabConfig

    public GitLabConfig GitlabConfig { get; set; }

Configuration for connections to gitlab.com or an instance of GitLab
Enterprise.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.GitLabConfig` |   |

### InstallationState

    public InstallationState InstallationState { get; set; }

Output only. Installation state of the Connection.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.CloudBuild.V2/latest/Google.Cloud.CloudBuild.V2.InstallationState` |   |

### Name

    public string Name { get; set; }

Immutable. The resource name of the connection, in the format
`projects/{project}/locations/{location}/connections/{connection_id}`.

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

### Reconciling

    public bool Reconciling { get; set; }

Output only. Set to true when the connection is being set up or updated in
the background.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### UpdateTime

    public Timestamp UpdateTime { get; set; }

Output only. Server assigned timestamp for when the connection was updated.

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