# Google Cloud Functions V2 Client - Class StorageSource (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 StorageSource.

Location of the source in an archive file in Google Cloud Storage.

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

## Namespace

Google \\ Cloud \\ Functions \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ bucket` | `string` Google Cloud Storage bucket containing the source (see [Bucket Name Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). |
| `↳ object` | `string` Google Cloud Storage object containing the source. This object must be a gzipped archive file (`.tar.gz`) containing source to build. |
| `↳ generation` | `int|string` Google Cloud Storage generation for the object. If the generation is omitted, the latest generation will be used. |
| `↳ source_upload_url` | `string` When the specified storage bucket is a 1st gen function uploard url bucket, this field should be set as the generated upload url for 1st gen deployment. |

### getBucket

Google Cloud Storage bucket containing the source (see
[Bucket Name
Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).

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

### setBucket

Google Cloud Storage bucket containing the source (see
[Bucket Name
Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).

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

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

### getObject

Google Cloud Storage object containing the source.

This object must be a gzipped archive file (`.tar.gz`) containing source to
build.

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

### setObject

Google Cloud Storage object containing the source.

This object must be a gzipped archive file (`.tar.gz`) containing source to
build.

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

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

### getGeneration

Google Cloud Storage generation for the object. If the generation is
omitted, the latest generation will be used.

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

### setGeneration

Google Cloud Storage generation for the object. If the generation is
omitted, the latest generation will be used.

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

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

### getSourceUploadUrl

When the specified storage bucket is a 1st gen function uploard url bucket,
this field should be set as the generated upload url for 1st gen
deployment.

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

### setSourceUploadUrl

When the specified storage bucket is a 1st gen function uploard url bucket,
this field should be set as the generated upload url for 1st gen
deployment.

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

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