Google Cloud Retail V2 Client - Class PredictResponse (1.5.0)

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
NameDescription
data array

Optional. Data for populating the Message object.

↳ results array<Google\Cloud\Retail\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 logs resulting from this recommendation, which enables accurate attribution of recommendation model performance.

↳ missing_ids array

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
TypeDescription
Google\Protobuf\Internal\RepeatedField

setResults

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

Parameter
NameDescription
var array<Google\Cloud\Retail\V2\PredictResponse\PredictionResult>
Returns
TypeDescription
$this

getAttributionToken

A unique attribution token. This should be included in the UserEvent logs resulting from this recommendation, which enables accurate attribution of recommendation model performance.

Returns
TypeDescription
string

setAttributionToken

A unique attribution token. This should be included in the UserEvent logs resulting from this recommendation, which enables accurate attribution of recommendation model performance.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getMissingIds

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

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setMissingIds

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

Parameter
NameDescription
var string[]
Returns
TypeDescription
$this

getValidateOnly

True if the validateOnly property was set in the request.

Returns
TypeDescription
bool

setValidateOnly

True if the validateOnly property was set in the request.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this