# Google Cloud Functions V2 Client - Class Source (2.1.3)

2.1.3 (latest) 2.1.2 2.0.6 1.7.0 1.6.5 1.5.0 1.4.2 1.3.1 1.2.0 1.1.2 1.0.3 Reference documentation and code samples for the Google Cloud Functions V2 Client class Source.

The location of the function source code.

Generated from protobuf message `google.cloud.functions.v2.Source`

## Namespace

Google \\ Cloud \\ Functions \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ storage_source` | `https://docs.cloud.google.com/php/docs/reference/cloud-functions/latest/V2.StorageSource` If provided, get the source from this location in Google Cloud Storage. |
| `↳ repo_source` | `https://docs.cloud.google.com/php/docs/reference/cloud-functions/latest/V2.RepoSource` If provided, get the source from this location in a Cloud Source Repository. |
| `↳ git_uri` | `string` If provided, get the source from GitHub repository. This option is valid only for GCF 1st Gen function. Example: <https://github.com/> |

### getStorageSource

If provided, get the source from this location in Google Cloud Storage.

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

### hasStorageSource

### setStorageSource

If provided, get the source from this location in Google Cloud Storage.

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

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

### getRepoSource

If provided, get the source from this location in a Cloud Source
Repository.

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

### hasRepoSource

### setRepoSource

If provided, get the source from this location in a Cloud Source
Repository.

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

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

### getGitUri

If provided, get the source from GitHub repository. This option is valid
only for GCF 1st Gen function.

Example: <https://github.com/>


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

### hasGitUri

### setGitUri

If provided, get the source from GitHub repository. This option is valid
only for GCF 1st Gen function.

Example: <https://github.com/>


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

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

### getSource

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