# Google Cloud Storage Transfer V1 Client - Class MetadataOptions (2.4.0)

2.4.0 (latest) 2.3.2 2.2.1 2.1.1 2.0.2 1.5.0 1.4.5 1.3.1 1.2.0 1.1.1 1.0.6 Reference documentation and code samples for the Google Cloud Storage Transfer V1 Client class MetadataOptions.

Specifies the metadata options for running a transfer.

Generated from protobuf message `google.storagetransfer.v1.MetadataOptions`

## Namespace

Google \\ Cloud \\ StorageTransfer \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ symlink` | `int` Specifies how symlinks should be handled by the transfer. By default, symlinks are not preserved. Only applicable to transfers involving POSIX file systems, and ignored for other transfers. |
| `↳ mode` | `int` Specifies how each file's mode attribute should be handled by the transfer. By default, mode is not preserved. Only applicable to transfers involving POSIX file systems, and ignored for other transfers. |
| `↳ gid` | `int` Specifies how each file's POSIX group ID (GID) attribute should be handled by the transfer. By default, GID is not preserved. Only applicable to transfers involving POSIX file systems, and ignored for other transfers. |
| `↳ uid` | `int` Specifies how each file's POSIX user ID (UID) attribute should be handled by the transfer. By default, UID is not preserved. Only applicable to transfers involving POSIX file systems, and ignored for other transfers. |
| `↳ acl` | `int` Specifies how each object's ACLs should be preserved for transfers between Google Cloud Storage buckets. If unspecified, the default behavior is the same as ACL_DESTINATION_BUCKET_DEFAULT. |
| `↳ storage_class` | `int` Specifies the storage class to set on objects being transferred to Google Cloud Storage buckets. If unspecified, the default behavior is the same as [STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.StorageClass#_Google_Cloud_StorageTransfer_V1_MetadataOptions_StorageClass__STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT). |
| `↳ temporary_hold` | `int` Specifies how each object's temporary hold status should be preserved for transfers between Google Cloud Storage buckets. If unspecified, the default behavior is the same as [TEMPORARY_HOLD_PRESERVE](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.TemporaryHold#_Google_Cloud_StorageTransfer_V1_MetadataOptions_TemporaryHold__TEMPORARY_HOLD_PRESERVE). |
| `↳ kms_key` | `int` Specifies how each object's Cloud KMS customer-managed encryption key (CMEK) is preserved for transfers between Google Cloud Storage buckets. If unspecified, the default behavior is the same as [KMS_KEY_DESTINATION_BUCKET_DEFAULT](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.KmsKey#_Google_Cloud_StorageTransfer_V1_MetadataOptions_KmsKey__KMS_KEY_DESTINATION_BUCKET_DEFAULT). |
| `↳ time_created` | `int` Specifies how each object's `timeCreated` metadata is preserved for transfers. If unspecified, the default behavior is the same as [TIME_CREATED_SKIP](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.TimeCreated#_Google_Cloud_StorageTransfer_V1_MetadataOptions_TimeCreated__TIME_CREATED_SKIP). This behavior is supported for transfers to Cloud Storage buckets from Cloud Storage, Amazon S3, S3-compatible storage, and Azure sources. |

### getSymlink

Specifies how symlinks should be handled by the transfer. By default,
symlinks are not preserved. Only applicable to transfers involving
POSIX file systems, and ignored for other transfers.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Symlink](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.Symlink). |

### setSymlink

Specifies how symlinks should be handled by the transfer. By default,
symlinks are not preserved. Only applicable to transfers involving
POSIX file systems, and ignored for other transfers.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Symlink](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.Symlink). |

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

### getMode

Specifies how each file's mode attribute should be handled by the transfer.

By default, mode is not preserved. Only applicable to transfers involving
POSIX file systems, and ignored for other transfers.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Mode](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.Mode). |

### setMode

Specifies how each file's mode attribute should be handled by the transfer.

By default, mode is not preserved. Only applicable to transfers involving
POSIX file systems, and ignored for other transfers.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Mode](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.Mode). |

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

### getGid

Specifies how each file's POSIX group ID (GID) attribute should be handled
by the transfer. By default, GID is not preserved. Only applicable to
transfers involving POSIX file systems, and ignored for other transfers.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type GID. |

### setGid

Specifies how each file's POSIX group ID (GID) attribute should be handled
by the transfer. By default, GID is not preserved. Only applicable to
transfers involving POSIX file systems, and ignored for other transfers.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type GID. |

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

### getUid

Specifies how each file's POSIX user ID (UID) attribute should be handled
by the transfer. By default, UID is not preserved. Only applicable to
transfers involving POSIX file systems, and ignored for other transfers.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type UID. |

### setUid

Specifies how each file's POSIX user ID (UID) attribute should be handled
by the transfer. By default, UID is not preserved. Only applicable to
transfers involving POSIX file systems, and ignored for other transfers.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type UID. |

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

### getAcl

Specifies how each object's ACLs should be preserved for transfers between
Google Cloud Storage buckets. If unspecified, the default behavior is the
same as ACL_DESTINATION_BUCKET_DEFAULT.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Acl](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.Acl). |

### setAcl

Specifies how each object's ACLs should be preserved for transfers between
Google Cloud Storage buckets. If unspecified, the default behavior is the
same as ACL_DESTINATION_BUCKET_DEFAULT.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Acl](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.Acl). |

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

### getStorageClass

Specifies the storage class to set on objects being transferred to Google
Cloud Storage buckets. If unspecified, the default behavior is the same as
[STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.StorageClass#_Google_Cloud_StorageTransfer_V1_MetadataOptions_StorageClass__STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [StorageClass](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.StorageClass). |

### setStorageClass

Specifies the storage class to set on objects being transferred to Google
Cloud Storage buckets. If unspecified, the default behavior is the same as
[STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.StorageClass#_Google_Cloud_StorageTransfer_V1_MetadataOptions_StorageClass__STORAGE_CLASS_DESTINATION_BUCKET_DEFAULT).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [StorageClass](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.StorageClass). |

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

### getTemporaryHold

Specifies how each object's temporary hold status should be preserved for
transfers between Google Cloud Storage buckets. If unspecified, the
default behavior is the same as
[TEMPORARY_HOLD_PRESERVE](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.TemporaryHold#_Google_Cloud_StorageTransfer_V1_MetadataOptions_TemporaryHold__TEMPORARY_HOLD_PRESERVE).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [TemporaryHold](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.TemporaryHold). |

### setTemporaryHold

Specifies how each object's temporary hold status should be preserved for
transfers between Google Cloud Storage buckets. If unspecified, the
default behavior is the same as
[TEMPORARY_HOLD_PRESERVE](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.TemporaryHold#_Google_Cloud_StorageTransfer_V1_MetadataOptions_TemporaryHold__TEMPORARY_HOLD_PRESERVE).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [TemporaryHold](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.TemporaryHold). |

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

### getKmsKey

Specifies how each object's Cloud KMS customer-managed encryption key
(CMEK) is preserved for transfers between Google Cloud Storage buckets. If
unspecified, the default behavior is the same as
[KMS_KEY_DESTINATION_BUCKET_DEFAULT](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.KmsKey#_Google_Cloud_StorageTransfer_V1_MetadataOptions_KmsKey__KMS_KEY_DESTINATION_BUCKET_DEFAULT).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [KmsKey](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.KmsKey). |

### setKmsKey

Specifies how each object's Cloud KMS customer-managed encryption key
(CMEK) is preserved for transfers between Google Cloud Storage buckets. If
unspecified, the default behavior is the same as
[KMS_KEY_DESTINATION_BUCKET_DEFAULT](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.KmsKey#_Google_Cloud_StorageTransfer_V1_MetadataOptions_KmsKey__KMS_KEY_DESTINATION_BUCKET_DEFAULT).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [KmsKey](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.KmsKey). |

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

### getTimeCreated

Specifies how each object's `timeCreated` metadata is preserved for
transfers. If unspecified, the default behavior is the same as
[TIME_CREATED_SKIP](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.TimeCreated#_Google_Cloud_StorageTransfer_V1_MetadataOptions_TimeCreated__TIME_CREATED_SKIP).

This behavior is supported for transfers to Cloud Storage buckets from
Cloud Storage, Amazon S3, S3-compatible storage, and Azure sources.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [TimeCreated](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.TimeCreated). |

### setTimeCreated

Specifies how each object's `timeCreated` metadata is preserved for
transfers. If unspecified, the default behavior is the same as
[TIME_CREATED_SKIP](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.TimeCreated#_Google_Cloud_StorageTransfer_V1_MetadataOptions_TimeCreated__TIME_CREATED_SKIP).

This behavior is supported for transfers to Cloud Storage buckets from
Cloud Storage, Amazon S3, S3-compatible storage, and Azure sources.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [TimeCreated](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.MetadataOptions.TimeCreated). |

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