<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/retail/v2/prediction_service.proto

namespace Google\Cloud\Retail\V2;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Response message for predict method.
 *
 * Generated from protobuf message <code>google.cloud.retail.v2.PredictResponse</code>
 */
class PredictResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * A list of recommended products. The order represents the ranking (from the
     * most relevant product to the least).
     *
     * Generated from protobuf field <code>repeated .google.cloud.retail.v2.PredictResponse.PredictionResult results = 1;</code>
     */
    private $results;
    /**
     * A unique attribution token. This should be included in the
     * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this
     * recommendation, which enables accurate attribution of recommendation model
     * performance.
     *
     * Generated from protobuf field <code>string attribution_token = 2;</code>
     */
    private $attribution_token = '';
    /**
     * IDs of products in the request that were missing from the inventory.
     *
     * Generated from protobuf field <code>repeated string missing_ids = 3;</code>
     */
    private $missing_ids;
    /**
     * True if the validateOnly property was set in the request.
     *
     * Generated from protobuf field <code>bool validate_only = 4;</code>
     */
    private $validate_only = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\Retail\V2\PredictResponse\PredictionResult>|\Google\Protobuf\Internal\RepeatedField $results
     *           A list of recommended products. The order represents the ranking (from the
     *           most relevant product to the least).
     *     @type string $attribution_token
     *           A unique attribution token. This should be included in the
     *           [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this
     *           recommendation, which enables accurate attribution of recommendation model
     *           performance.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $missing_ids
     *           IDs of products in the request that were missing from the inventory.
     *     @type bool $validate_only
     *           True if the validateOnly property was set in the request.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Retail\V2\PredictionService::initOnce();
        parent::__construct($data);
    }

    /**
     * A list of recommended products. The order represents the ranking (from the
     * most relevant product to the least).
     *
     * Generated from protobuf field <code>repeated .google.cloud.retail.v2.PredictResponse.PredictionResult results = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getResults()
    {
        return $this->results;
    }

    /**
     * A list of recommended products. The order represents the ranking (from the
     * most relevant product to the least).
     *
     * Generated from protobuf field <code>repeated .google.cloud.retail.v2.PredictResponse.PredictionResult results = 1;</code>
     * @param array<\Google\Cloud\Retail\V2\PredictResponse\PredictionResult>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setResults($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Retail\V2\PredictResponse\PredictionResult::class);
        $this->results = $arr;

        return $this;
    }

    /**
     * A unique attribution token. This should be included in the
     * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this
     * recommendation, which enables accurate attribution of recommendation model
     * performance.
     *
     * Generated from protobuf field <code>string attribution_token = 2;</code>
     * @return string
     */
    public function getAttributionToken()
    {
        return $this->attribution_token;
    }

    /**
     * A unique attribution token. This should be included in the
     * [UserEvent][google.cloud.retail.v2.UserEvent] logs resulting from this
     * recommendation, which enables accurate attribution of recommendation model
     * performance.
     *
     * Generated from protobuf field <code>string attribution_token = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setAttributionToken($var)
    {
        GPBUtil::checkString($var, True);
        $this->attribution_token = $var;

        return $this;
    }

    /**
     * IDs of products in the request that were missing from the inventory.
     *
     * Generated from protobuf field <code>repeated string missing_ids = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getMissingIds()
    {
        return $this->missing_ids;
    }

    /**
     * IDs of products in the request that were missing from the inventory.
     *
     * Generated from protobuf field <code>repeated string missing_ids = 3;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setMissingIds($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->missing_ids = $arr;

        return $this;
    }

    /**
     * True if the validateOnly property was set in the request.
     *
     * Generated from protobuf field <code>bool validate_only = 4;</code>
     * @return bool
     */
    public function getValidateOnly()
    {
        return $this->validate_only;
    }

    /**
     * True if the validateOnly property was set in the request.
     *
     * Generated from protobuf field <code>bool validate_only = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setValidateOnly($var)
    {
        GPBUtil::checkBool($var);
        $this->validate_only = $var;

        return $this;
    }

}

