# Google Cloud Storage Transfer V1 Client - Class TransferJob (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 TransferJob.

This resource represents the configuration of a transfer job that runs
periodically.

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

## Namespace

Google \\ Cloud \\ StorageTransfer \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` A unique name (within the transfer project) assigned when the job is created. If this field is empty in a CreateTransferJobRequest, Storage Transfer Service assigns a unique name. Otherwise, the specified name is used as the unique name for this job. If the specified name is in use by a job, the creation request fails with an [ALREADY_EXISTS](https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Code.html#_Google_Rpc_Code__ALREADY_EXISTS) error. This name must start with `"transferJobs/"` prefix and end with a letter or a number, and should be no more than 128 characters. For transfers involving PosixFilesystem, this name must start with `transferJobs/OPI` specifically. For all other transfer types, this name must not start with `transferJobs/OPI`. Non-PosixFilesystem example: `"transferJobs/^(?!OPI)[A-Za-z0-9-._~]*[A-Za-z0-9]$"` PosixFilesystem example: `"transferJobs/OPI^[A-Za-z0-9-._~]*[A-Za-z0-9]$"` Applications must not rely on the enforcement of naming requirements involving OPI. Invalid job names fail with an [INVALID_ARGUMENT](https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Code.html#_Google_Rpc_Code__INVALID_ARGUMENT) error. |
| `↳ description` | `string` A description provided by the user for the job. Its max length is 1024 bytes when Unicode-encoded. |
| `↳ project_id` | `string` The ID of the Google Cloud project that owns the job. |
| `↳ service_account` | `string` Optional. The user-managed service account to which to delegate service agent permissions. You can grant Cloud Storage bucket permissions to this service account instead of to the Transfer Service service agent. Format is `projects/-/serviceAccounts/ACCOUNT_EMAIL_OR_UNIQUEID` Either the service account email (`SERVICE_ACCOUNT_NAME\@PROJECT_ID.iam.gserviceaccount.com`) or the unique ID (`123456789012345678901`) are accepted in the string. The `-` wildcard character is required; replacing it with a project ID is invalid. See <https://cloud.google.com//storage-transfer/docs/delegate-service-agent-permissions> for required permissions. |
| `↳ transfer_spec` | `https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.TransferSpec` Transfer specification. |
| `↳ replication_spec` | `https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.ReplicationSpec` Replication specification. |
| `↳ notification_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.NotificationConfig` Notification configuration. |
| `↳ logging_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.LoggingConfig` Logging configuration. |
| `↳ schedule` | `https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.Schedule` Specifies schedule for the transfer job. This is an optional field. When the field is not set, the job never executes a transfer, unless you invoke RunTransferJob or update the job to have a non-empty schedule. |
| `↳ event_stream` | `https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.EventStream` Specifies the event stream for the transfer job for event-driven transfers. When EventStream is specified, the Schedule fields are ignored. |
| `↳ status` | `int` Status of the job. This value MUST be specified for `CreateTransferJobRequests`. **Note:** The effect of the new job status takes place during a subsequent job run. For example, if you change the job status from [ENABLED](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.TransferJob.Status#_Google_Cloud_StorageTransfer_V1_TransferJob_Status__ENABLED) to [DISABLED](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.TransferJob.Status#_Google_Cloud_StorageTransfer_V1_TransferJob_Status__DISABLED), and an operation spawned by the transfer is running, the status change would not affect the current operation. |
| `↳ creation_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time that the transfer job was created. |
| `↳ last_modification_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time that the transfer job was last modified. |
| `↳ deletion_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time that the transfer job was deleted. |
| `↳ latest_operation_name` | `string` The name of the most recently started TransferOperation of this JobConfig. Present if a TransferOperation has been created for this JobConfig. |

### getName

A unique name (within the transfer project) assigned when the job is
created. If this field is empty in a CreateTransferJobRequest, Storage
Transfer Service assigns a unique name. Otherwise, the specified name
is used as the unique name for this job.

If the specified name is in use by a job, the creation request fails with
an [ALREADY_EXISTS](https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Code.html#_Google_Rpc_Code__ALREADY_EXISTS) error.
This name must start with `"transferJobs/"` prefix and end with a letter or
a number, and should be no more than 128 characters. For transfers
involving PosixFilesystem, this name must start with `transferJobs/OPI`
specifically. For all other transfer types, this name must not start with
`transferJobs/OPI`.
Non-PosixFilesystem example:
`"transferJobs/^(?!OPI)[A-Za-z0-9-._~]*[A-Za-z0-9]$"`
PosixFilesystem example:
`"transferJobs/OPI^[A-Za-z0-9-._~]*[A-Za-z0-9]$"`
Applications must not rely on the enforcement of naming requirements
involving OPI.
Invalid job names fail with an
[INVALID_ARGUMENT](https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Code.html#_Google_Rpc_Code__INVALID_ARGUMENT) error.

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

### setName

A unique name (within the transfer project) assigned when the job is
created. If this field is empty in a CreateTransferJobRequest, Storage
Transfer Service assigns a unique name. Otherwise, the specified name
is used as the unique name for this job.

If the specified name is in use by a job, the creation request fails with
an [ALREADY_EXISTS](https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Code.html#_Google_Rpc_Code__ALREADY_EXISTS) error.
This name must start with `"transferJobs/"` prefix and end with a letter or
a number, and should be no more than 128 characters. For transfers
involving PosixFilesystem, this name must start with `transferJobs/OPI`
specifically. For all other transfer types, this name must not start with
`transferJobs/OPI`.
Non-PosixFilesystem example:
`"transferJobs/^(?!OPI)[A-Za-z0-9-._~]*[A-Za-z0-9]$"`
PosixFilesystem example:
`"transferJobs/OPI^[A-Za-z0-9-._~]*[A-Za-z0-9]$"`
Applications must not rely on the enforcement of naming requirements
involving OPI.
Invalid job names fail with an
[INVALID_ARGUMENT](https://docs.cloud.google.com/php/docs/reference/common-protos/latest/Rpc.Code.html#_Google_Rpc_Code__INVALID_ARGUMENT) error.

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

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

### getDescription

A description provided by the user for the job. Its max length is 1024
bytes when Unicode-encoded.

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

### setDescription

A description provided by the user for the job. Its max length is 1024
bytes when Unicode-encoded.

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

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

### getProjectId

The ID of the Google Cloud project that owns the job.

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

### setProjectId

The ID of the Google Cloud project that owns the job.

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

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

### getServiceAccount

Optional. The user-managed service account to which to delegate service
agent permissions. You can grant Cloud Storage bucket permissions to this
service account instead of to the Transfer Service service agent.

Format is
`projects/-/serviceAccounts/ACCOUNT_EMAIL_OR_UNIQUEID`
Either the service account email
(`SERVICE_ACCOUNT_NAME\@PROJECT_ID.iam.gserviceaccount.com`) or the unique
ID (`123456789012345678901`) are accepted in the string. The `-`
wildcard character is required; replacing it with a project ID is invalid.
See
<https://cloud.google.com//storage-transfer/docs/delegate-service-agent-permissions>
for required permissions.

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

### setServiceAccount

Optional. The user-managed service account to which to delegate service
agent permissions. You can grant Cloud Storage bucket permissions to this
service account instead of to the Transfer Service service agent.

Format is
`projects/-/serviceAccounts/ACCOUNT_EMAIL_OR_UNIQUEID`
Either the service account email
(`SERVICE_ACCOUNT_NAME\@PROJECT_ID.iam.gserviceaccount.com`) or the unique
ID (`123456789012345678901`) are accepted in the string. The `-`
wildcard character is required; replacing it with a project ID is invalid.
See
<https://cloud.google.com//storage-transfer/docs/delegate-service-agent-permissions>
for required permissions.

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

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

### getTransferSpec

Transfer specification.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.TransferSpec|null` |   |

### hasTransferSpec

### clearTransferSpec

### setTransferSpec

Transfer specification.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.TransferSpec` |

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

### getReplicationSpec

Replication specification.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.ReplicationSpec|null` |   |

### hasReplicationSpec

### clearReplicationSpec

### setReplicationSpec

Replication specification.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.ReplicationSpec` |

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

### getNotificationConfig

Notification configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.NotificationConfig|null` |   |

### hasNotificationConfig

### clearNotificationConfig

### setNotificationConfig

Notification configuration.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.NotificationConfig` |

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

### getLoggingConfig

Logging configuration.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.LoggingConfig|null` |   |

### hasLoggingConfig

### clearLoggingConfig

### setLoggingConfig

Logging configuration.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.LoggingConfig` |

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

### getSchedule

Specifies schedule for the transfer job.

This is an optional field. When the field is not set, the job never
executes a transfer, unless you invoke RunTransferJob or update the job to
have a non-empty schedule.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.Schedule|null` |   |

### hasSchedule

### clearSchedule

### setSchedule

Specifies schedule for the transfer job.

This is an optional field. When the field is not set, the job never
executes a transfer, unless you invoke RunTransferJob or update the job to
have a non-empty schedule.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.Schedule` |

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

### getEventStream

Specifies the event stream for the transfer job for event-driven transfers.

When EventStream is specified, the Schedule fields are ignored.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.EventStream|null` |   |

### hasEventStream

### clearEventStream

### setEventStream

Specifies the event stream for the transfer job for event-driven transfers.

When EventStream is specified, the Schedule fields are ignored.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.EventStream` |

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

### getStatus

Status of the job. This value MUST be specified for
`CreateTransferJobRequests`.

**Note:** The effect of the new job status takes place during a subsequent
job run. For example, if you change the job status from
[ENABLED](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.TransferJob.Status#_Google_Cloud_StorageTransfer_V1_TransferJob_Status__ENABLED) to
[DISABLED](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.TransferJob.Status#_Google_Cloud_StorageTransfer_V1_TransferJob_Status__DISABLED), and an
operation spawned by the transfer is running, the status change would not
affect the current operation.

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

### setStatus

Status of the job. This value MUST be specified for
`CreateTransferJobRequests`.

**Note:** The effect of the new job status takes place during a subsequent
job run. For example, if you change the job status from
[ENABLED](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.TransferJob.Status#_Google_Cloud_StorageTransfer_V1_TransferJob_Status__ENABLED) to
[DISABLED](https://docs.cloud.google.com/php/docs/reference/cloud-storage-transfer/latest/V1.TransferJob.Status#_Google_Cloud_StorageTransfer_V1_TransferJob_Status__DISABLED), and an
operation spawned by the transfer is running, the status change would not
affect the current operation.

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

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

### getCreationTime

Output only. The time that the transfer job was created.

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

### hasCreationTime

### clearCreationTime

### setCreationTime

Output only. The time that the transfer job was created.

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

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

### getLastModificationTime

Output only. The time that the transfer job was last modified.

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

### hasLastModificationTime

### clearLastModificationTime

### setLastModificationTime

Output only. The time that the transfer job was last modified.

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

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

### getDeletionTime

Output only. The time that the transfer job was deleted.

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

### hasDeletionTime

### clearDeletionTime

### setDeletionTime

Output only. The time that the transfer job was deleted.

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

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

### getLatestOperationName

The name of the most recently started TransferOperation of this JobConfig.

Present if a TransferOperation has been created for this JobConfig.

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

### setLatestOperationName

The name of the most recently started TransferOperation of this JobConfig.

Present if a TransferOperation has been created for this JobConfig.

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

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