# Google Cloud Build V2 Client - Class Connection (1.1.2)

1.1.2 (latest) 1.1.1 1.0.4 0.16.3 0.15.0 0.14.0 0.13.2 0.12.0 0.11.0 0.10.0 0.9.0 0.8.0 0.7.3 0.6.1 0.5.1 0.4.0 0.3.8 Reference documentation and code samples for the Google Cloud Build V2 Client class Connection.

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

Generated from protobuf message `google.devtools.cloudbuild.v2.Connection`

## Namespace

Google \\ Cloud \\ Build \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Immutable. The resource name of the connection, in the format `projects/{project}/locations/{location}/connections/{connection_id}`. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. Server assigned timestamp for when the connection was created. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. Server assigned timestamp for when the connection was updated. |
| `↳ github_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.GitHubConfig` Configuration for connections to github.com. |
| `↳ github_enterprise_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.GitHubEnterpriseConfig` Configuration for connections to an instance of GitHub Enterprise. |
| `↳ gitlab_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.GitLabConfig` Configuration for connections to gitlab.com or an instance of GitLab Enterprise. |
| `↳ bitbucket_data_center_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.BitbucketDataCenterConfig` Configuration for connections to Bitbucket Data Center. |
| `↳ bitbucket_cloud_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.BitbucketCloudConfig` Configuration for connections to Bitbucket Cloud. |
| `↳ installation_state` | `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.InstallationState` Output only. Installation state of the Connection. |
| `↳ disabled` | `bool` 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. |
| `↳ reconciling` | `bool` Output only. Set to true when the connection is being set up or updated in the background. |
| `↳ annotations` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Allows clients to store small amounts of arbitrary data. |
| `↳ etag` | `string` 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. |

### getName

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCreateTime

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasCreateTime

### clearCreateTime

### setCreateTime

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUpdateTime

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getGithubConfig

Configuration for connections to github.com.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.GitHubConfig|null` |   |

### hasGithubConfig

### setGithubConfig

Configuration for connections to github.com.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.GitHubConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getGithubEnterpriseConfig

Configuration for connections to an instance of GitHub Enterprise.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.GitHubEnterpriseConfig|null` |   |

### hasGithubEnterpriseConfig

### setGithubEnterpriseConfig

Configuration for connections to an instance of GitHub Enterprise.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.GitHubEnterpriseConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getGitlabConfig

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.GitLabConfig|null` |   |

### hasGitlabConfig

### setGitlabConfig

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.GitLabConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getBitbucketDataCenterConfig

Configuration for connections to Bitbucket Data Center.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.BitbucketDataCenterConfig|null` |   |

### hasBitbucketDataCenterConfig

### setBitbucketDataCenterConfig

Configuration for connections to Bitbucket Data Center.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.BitbucketDataCenterConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getBitbucketCloudConfig

Configuration for connections to Bitbucket Cloud.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.BitbucketCloudConfig|null` |   |

### hasBitbucketCloudConfig

### setBitbucketCloudConfig

Configuration for connections to Bitbucket Cloud.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.BitbucketCloudConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getInstallationState

Output only. Installation state of the Connection.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.InstallationState|null` |   |

### hasInstallationState

### clearInstallationState

### setInstallationState

Output only. Installation state of the Connection.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-build/latest/V2.InstallationState` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDisabled

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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setDisabled

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getReconciling

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setReconciling

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `bool` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAnnotations

Allows clients to store small amounts of arbitrary data.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setAnnotations

Allows clients to store small amounts of arbitrary data.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getEtag

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.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setEtag

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getConnectionConfig

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |