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

namespace Google\Cloud\Dialogflow\V2;

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

/**
 * The sentiment, such as positive/negative feeling or association, for a unit
 * of analysis, such as the query text. See:
 * https://cloud.google.com/natural-language/docs/basics#interpreting_sentiment_analysis_values
 * for how to interpret the result.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.v2.Sentiment</code>
 */
class Sentiment extends \Google\Protobuf\Internal\Message
{
    /**
     * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive
     * sentiment).
     *
     * Generated from protobuf field <code>float score = 1;</code>
     */
    protected $score = 0.0;
    /**
     * A non-negative number in the [0, +inf) range, which represents the absolute
     * magnitude of sentiment, regardless of score (positive or negative).
     *
     * Generated from protobuf field <code>float magnitude = 2;</code>
     */
    protected $magnitude = 0.0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type float $score
     *           Sentiment score between -1.0 (negative sentiment) and 1.0 (positive
     *           sentiment).
     *     @type float $magnitude
     *           A non-negative number in the [0, +inf) range, which represents the absolute
     *           magnitude of sentiment, regardless of score (positive or negative).
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\V2\Session::initOnce();
        parent::__construct($data);
    }

    /**
     * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive
     * sentiment).
     *
     * Generated from protobuf field <code>float score = 1;</code>
     * @return float
     */
    public function getScore()
    {
        return $this->score;
    }

    /**
     * Sentiment score between -1.0 (negative sentiment) and 1.0 (positive
     * sentiment).
     *
     * Generated from protobuf field <code>float score = 1;</code>
     * @param float $var
     * @return $this
     */
    public function setScore($var)
    {
        GPBUtil::checkFloat($var);
        $this->score = $var;

        return $this;
    }

    /**
     * A non-negative number in the [0, +inf) range, which represents the absolute
     * magnitude of sentiment, regardless of score (positive or negative).
     *
     * Generated from protobuf field <code>float magnitude = 2;</code>
     * @return float
     */
    public function getMagnitude()
    {
        return $this->magnitude;
    }

    /**
     * A non-negative number in the [0, +inf) range, which represents the absolute
     * magnitude of sentiment, regardless of score (positive or negative).
     *
     * Generated from protobuf field <code>float magnitude = 2;</code>
     * @param float $var
     * @return $this
     */
    public function setMagnitude($var)
    {
        GPBUtil::checkFloat($var);
        $this->magnitude = $var;

        return $this;
    }

}

