# Google Cloud Storage Batch Operations V1 Client - Class PutObjectHold (0.7.0)

0.7.0 (latest) 0.6.0 0.5.0 0.4.0 0.3.1 0.2.1 0.1.2 Reference documentation and code samples for the Google Cloud Storage Batch Operations V1 Client class PutObjectHold.

Describes options to update object hold.

Generated from protobuf message `google.cloud.storagebatchoperations.v1.PutObjectHold`

## Namespace

Google \\ Cloud \\ StorageBatchOperations \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ temporary_hold` | `int` Required. Updates object temporary holds state. When object temporary hold is set, object cannot be deleted or replaced. |
| `↳ event_based_hold` | `int` Required. Updates object event based holds state. When object event based hold is set, object cannot be deleted or replaced. Resets object's time in the bucket for the purposes of the retention period. |

### getTemporaryHold

Required. Updates object temporary holds state. When object temporary hold
is set, object cannot be deleted or replaced.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [HoldStatus](https://docs.cloud.google.com/php/docs/reference/cloud-storagebatchoperations/latest/V1.PutObjectHold.HoldStatus). |

### setTemporaryHold

Required. Updates object temporary holds state. When object temporary hold
is set, object cannot be deleted or replaced.

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

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

### getEventBasedHold

Required. Updates object event based holds state. When object event based
hold is set, object cannot be deleted or replaced. Resets object's time in
the bucket for the purposes of the retention period.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [HoldStatus](https://docs.cloud.google.com/php/docs/reference/cloud-storagebatchoperations/latest/V1.PutObjectHold.HoldStatus). |

### setEventBasedHold

Required. Updates object event based holds state. When object event based
hold is set, object cannot be deleted or replaced. Resets object's time in
the bucket for the purposes of the retention period.

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

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