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

Response message for predict method.

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

## Namespace

Google \\ Cloud \\ Retail \\ V2

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ results` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.PredictResponse.PredictionResult>` A list of recommended products. The order represents the ranking (from the most relevant product to the least). |
| `↳ attribution_token` | `string` A unique attribution token. This should be included in the [UserEvent](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.UserEvent) logs resulting from this recommendation, which enables accurate attribution of recommendation model performance. |
| `↳ missing_ids` | `string[]` IDs of products in the request that were missing from the inventory. |
| `↳ validate_only` | `bool` True if the validateOnly property was set in the request. |

### getResults

A list of recommended products. The order represents the ranking (from the
most relevant product to the least).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.PredictResponse.PredictionResult>` |   |

### setResults

A list of recommended products. The order represents the ranking (from the
most relevant product to the least).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.PredictResponse.PredictionResult>` |

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

### getAttributionToken

A unique attribution token. This should be included in the
[UserEvent](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.UserEvent) logs resulting from this
recommendation, which enables accurate attribution of recommendation model
performance.

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

### setAttributionToken

A unique attribution token. This should be included in the
[UserEvent](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.UserEvent) logs resulting from this
recommendation, which enables accurate attribution of recommendation model
performance.

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

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

### getMissingIds

IDs of products in the request that were missing from the inventory.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setMissingIds

IDs of products in the request that were missing from the inventory.

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

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

### getValidateOnly

True if the validateOnly property was set in the request.

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

### setValidateOnly

True if the validateOnly property was set in the request.

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

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