# Google Cloud Retail V2 Client - Class WriteUserEventRequest (2.5.3)

2.5.3 (latest) 2.5.2 2.4.0 2.3.1 2.2.1 2.1.3 2.0.0 1.7.0 1.6.4 1.5.0 1.4.2 1.3.1 1.2.1 1.1.1 1.0.1 Reference documentation and code samples for the Google Cloud Retail V2 Client class WriteUserEventRequest.

Request message for WriteUserEvent method.

Generated from protobuf message `google.cloud.retail.v2.WriteUserEventRequest`

## Namespace

Google \\ Cloud \\ Retail \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ parent` | `string` Required. The parent catalog resource name, such as `projects/1234/locations/global/catalogs/default_catalog`. |
| `↳ user_event` | `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.UserEvent` Required. User event to write. |
| `↳ write_async` | `bool` If set to true, the user event will be written asynchronously after validation, and the API will respond without waiting for the write. Therefore, silent failures can occur even if the API returns success. In case of silent failures, error messages can be found in Stackdriver logs. |

### getParent

Required. The parent catalog resource name, such as
`projects/1234/locations/global/catalogs/default_catalog`.

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

### setParent

Required. The parent catalog resource name, such as
`projects/1234/locations/global/catalogs/default_catalog`.

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

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

### getUserEvent

Required. User event to write.

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

### hasUserEvent

### clearUserEvent

### setUserEvent

Required. User event to write.

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

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

### getWriteAsync

If set to true, the user event will be written asynchronously after
validation, and the API will respond without waiting for the write.

Therefore, silent failures can occur even if the API returns success. In
case of silent failures, error messages can be found in Stackdriver logs.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setWriteAsync

If set to true, the user event will be written asynchronously after
validation, and the API will respond without waiting for the write.

Therefore, silent failures can occur even if the API returns success. In
case of silent failures, error messages can be found in Stackdriver logs.

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

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