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

namespace Google\Cloud\AutoMl\V1;

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

/**
 * Contains annotation details specific to text sentiment.
 *
 * Generated from protobuf message <code>google.cloud.automl.v1.TextSentimentAnnotation</code>
 */
class TextSentimentAnnotation extends \Google\Protobuf\Internal\Message
{
    /**
     * Output only. The sentiment with the semantic, as given to the
     * [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] when populating the dataset from which the model used
     * for the prediction had been trained.
     * The sentiment values are between 0 and
     * Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive),
     * with higher value meaning more positive sentiment. They are completely
     * relative, i.e. 0 means least positive sentiment and sentiment_max means
     * the most positive from the sentiments present in the train data. Therefore
     *  e.g. if train data had only negative sentiment, then sentiment_max, would
     * be still negative (although least negative).
     * The sentiment shouldn't be confused with "score" or "magnitude"
     * from the previous Natural Language Sentiment Analysis API.
     *
     * Generated from protobuf field <code>int32 sentiment = 1;</code>
     */
    private $sentiment = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $sentiment
     *           Output only. The sentiment with the semantic, as given to the
     *           [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] when populating the dataset from which the model used
     *           for the prediction had been trained.
     *           The sentiment values are between 0 and
     *           Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive),
     *           with higher value meaning more positive sentiment. They are completely
     *           relative, i.e. 0 means least positive sentiment and sentiment_max means
     *           the most positive from the sentiments present in the train data. Therefore
     *            e.g. if train data had only negative sentiment, then sentiment_max, would
     *           be still negative (although least negative).
     *           The sentiment shouldn't be confused with "score" or "magnitude"
     *           from the previous Natural Language Sentiment Analysis API.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Automl\V1\TextSentiment::initOnce();
        parent::__construct($data);
    }

    /**
     * Output only. The sentiment with the semantic, as given to the
     * [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] when populating the dataset from which the model used
     * for the prediction had been trained.
     * The sentiment values are between 0 and
     * Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive),
     * with higher value meaning more positive sentiment. They are completely
     * relative, i.e. 0 means least positive sentiment and sentiment_max means
     * the most positive from the sentiments present in the train data. Therefore
     *  e.g. if train data had only negative sentiment, then sentiment_max, would
     * be still negative (although least negative).
     * The sentiment shouldn't be confused with "score" or "magnitude"
     * from the previous Natural Language Sentiment Analysis API.
     *
     * Generated from protobuf field <code>int32 sentiment = 1;</code>
     * @return int
     */
    public function getSentiment()
    {
        return $this->sentiment;
    }

    /**
     * Output only. The sentiment with the semantic, as given to the
     * [AutoMl.ImportData][google.cloud.automl.v1.AutoMl.ImportData] when populating the dataset from which the model used
     * for the prediction had been trained.
     * The sentiment values are between 0 and
     * Dataset.text_sentiment_dataset_metadata.sentiment_max (inclusive),
     * with higher value meaning more positive sentiment. They are completely
     * relative, i.e. 0 means least positive sentiment and sentiment_max means
     * the most positive from the sentiments present in the train data. Therefore
     *  e.g. if train data had only negative sentiment, then sentiment_max, would
     * be still negative (although least negative).
     * The sentiment shouldn't be confused with "score" or "magnitude"
     * from the previous Natural Language Sentiment Analysis API.
     *
     * Generated from protobuf field <code>int32 sentiment = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setSentiment($var)
    {
        GPBUtil::checkInt32($var);
        $this->sentiment = $var;

        return $this;
    }

}

