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

namespace Google\Cloud\AutoMl\V1beta1;

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

/**
 * Request message for [PredictionService.Predict][google.cloud.automl.v1beta1.PredictionService.Predict].
 *
 * Generated from protobuf message <code>google.cloud.automl.v1beta1.PredictRequest</code>
 */
class PredictRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Name of the model requested to serve the prediction.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    private $name = '';
    /**
     * Required.
     * Payload to perform a prediction on. The payload must match the
     * problem type that the model was trained to solve.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1beta1.ExamplePayload payload = 2;</code>
     */
    private $payload = null;
    /**
     * Additional domain-specific parameters, any string must be up to 25000
     * characters long.
     * *  For Image Classification:
     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
     *     makes predictions for an
     *     image, it will only produce results that have at least this confidence
     *     score threshold. The default is 0.5.
     *
     * Generated from protobuf field <code>map<string, string> params = 3;</code>
     */
    private $params;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Name of the model requested to serve the prediction.
     *     @type \Google\Cloud\AutoMl\V1beta1\ExamplePayload $payload
     *           Required.
     *           Payload to perform a prediction on. The payload must match the
     *           problem type that the model was trained to solve.
     *     @type array|\Google\Protobuf\Internal\MapField $params
     *           Additional domain-specific parameters, any string must be up to 25000
     *           characters long.
     *           *  For Image Classification:
     *              `score_threshold` - (float) A value from 0.0 to 1.0. When the model
     *               makes predictions for an
     *               image, it will only produce results that have at least this confidence
     *               score threshold. The default is 0.5.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Automl\V1Beta1\PredictionService::initOnce();
        parent::__construct($data);
    }

    /**
     * Name of the model requested to serve the prediction.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Name of the model requested to serve the prediction.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Required.
     * Payload to perform a prediction on. The payload must match the
     * problem type that the model was trained to solve.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1beta1.ExamplePayload payload = 2;</code>
     * @return \Google\Cloud\AutoMl\V1beta1\ExamplePayload
     */
    public function getPayload()
    {
        return $this->payload;
    }

    /**
     * Required.
     * Payload to perform a prediction on. The payload must match the
     * problem type that the model was trained to solve.
     *
     * Generated from protobuf field <code>.google.cloud.automl.v1beta1.ExamplePayload payload = 2;</code>
     * @param \Google\Cloud\AutoMl\V1beta1\ExamplePayload $var
     * @return $this
     */
    public function setPayload($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AutoMl\V1beta1\ExamplePayload::class);
        $this->payload = $var;

        return $this;
    }

    /**
     * Additional domain-specific parameters, any string must be up to 25000
     * characters long.
     * *  For Image Classification:
     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
     *     makes predictions for an
     *     image, it will only produce results that have at least this confidence
     *     score threshold. The default is 0.5.
     *
     * Generated from protobuf field <code>map<string, string> params = 3;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getParams()
    {
        return $this->params;
    }

    /**
     * Additional domain-specific parameters, any string must be up to 25000
     * characters long.
     * *  For Image Classification:
     *    `score_threshold` - (float) A value from 0.0 to 1.0. When the model
     *     makes predictions for an
     *     image, it will only produce results that have at least this confidence
     *     score threshold. The default is 0.5.
     *
     * Generated from protobuf field <code>map<string, string> params = 3;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setParams($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->params = $arr;

        return $this;
    }

}

