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

namespace Google\Cloud\DiscoveryEngine\V1\SearchResponse\SearchResult;

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

/**
 * A set of ranking signals.
 *
 * Generated from protobuf message <code>google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals</code>
 */
class RankSignals extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. Keyword matching adjustment.
     *
     * Generated from protobuf field <code>optional float keyword_similarity_score = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $keyword_similarity_score = null;
    /**
     * Optional. Semantic relevance adjustment.
     *
     * Generated from protobuf field <code>optional float relevance_score = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $relevance_score = null;
    /**
     * Optional. Semantic similarity adjustment.
     *
     * Generated from protobuf field <code>optional float semantic_similarity_score = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $semantic_similarity_score = null;
    /**
     * Optional. Predicted conversion rate adjustment as a rank.
     *
     * Generated from protobuf field <code>optional float pctr_rank = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $pctr_rank = null;
    /**
     * Optional. Topicality adjustment as a rank.
     *
     * Generated from protobuf field <code>optional float topicality_rank = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $topicality_rank = null;
    /**
     * Optional. Age of the document in hours.
     *
     * Generated from protobuf field <code>optional float document_age = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $document_age = null;
    /**
     * Optional. Combined custom boosts for a doc.
     *
     * Generated from protobuf field <code>optional float boosting_factor = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $boosting_factor = null;
    /**
     * Optional. The default rank of the result.
     *
     * Generated from protobuf field <code>float default_rank = 32 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $default_rank = 0.0;
    /**
     * Optional. A list of custom clearbox signals.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal custom_signals = 33 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $custom_signals;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type float $keyword_similarity_score
     *           Optional. Keyword matching adjustment.
     *     @type float $relevance_score
     *           Optional. Semantic relevance adjustment.
     *     @type float $semantic_similarity_score
     *           Optional. Semantic similarity adjustment.
     *     @type float $pctr_rank
     *           Optional. Predicted conversion rate adjustment as a rank.
     *     @type float $topicality_rank
     *           Optional. Topicality adjustment as a rank.
     *     @type float $document_age
     *           Optional. Age of the document in hours.
     *     @type float $boosting_factor
     *           Optional. Combined custom boosts for a doc.
     *     @type float $default_rank
     *           Optional. The default rank of the result.
     *     @type \Google\Cloud\DiscoveryEngine\V1\SearchResponse\SearchResult\RankSignals\CustomSignal[] $custom_signals
     *           Optional. A list of custom clearbox signals.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Discoveryengine\V1\SearchService::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Keyword matching adjustment.
     *
     * Generated from protobuf field <code>optional float keyword_similarity_score = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return float
     */
    public function getKeywordSimilarityScore()
    {
        return isset($this->keyword_similarity_score) ? $this->keyword_similarity_score : 0.0;
    }

    public function hasKeywordSimilarityScore()
    {
        return isset($this->keyword_similarity_score);
    }

    public function clearKeywordSimilarityScore()
    {
        unset($this->keyword_similarity_score);
    }

    /**
     * Optional. Keyword matching adjustment.
     *
     * Generated from protobuf field <code>optional float keyword_similarity_score = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param float $var
     * @return $this
     */
    public function setKeywordSimilarityScore($var)
    {
        GPBUtil::checkFloat($var);
        $this->keyword_similarity_score = $var;

        return $this;
    }

    /**
     * Optional. Semantic relevance adjustment.
     *
     * Generated from protobuf field <code>optional float relevance_score = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return float
     */
    public function getRelevanceScore()
    {
        return isset($this->relevance_score) ? $this->relevance_score : 0.0;
    }

    public function hasRelevanceScore()
    {
        return isset($this->relevance_score);
    }

    public function clearRelevanceScore()
    {
        unset($this->relevance_score);
    }

    /**
     * Optional. Semantic relevance adjustment.
     *
     * Generated from protobuf field <code>optional float relevance_score = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param float $var
     * @return $this
     */
    public function setRelevanceScore($var)
    {
        GPBUtil::checkFloat($var);
        $this->relevance_score = $var;

        return $this;
    }

    /**
     * Optional. Semantic similarity adjustment.
     *
     * Generated from protobuf field <code>optional float semantic_similarity_score = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return float
     */
    public function getSemanticSimilarityScore()
    {
        return isset($this->semantic_similarity_score) ? $this->semantic_similarity_score : 0.0;
    }

    public function hasSemanticSimilarityScore()
    {
        return isset($this->semantic_similarity_score);
    }

    public function clearSemanticSimilarityScore()
    {
        unset($this->semantic_similarity_score);
    }

    /**
     * Optional. Semantic similarity adjustment.
     *
     * Generated from protobuf field <code>optional float semantic_similarity_score = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param float $var
     * @return $this
     */
    public function setSemanticSimilarityScore($var)
    {
        GPBUtil::checkFloat($var);
        $this->semantic_similarity_score = $var;

        return $this;
    }

    /**
     * Optional. Predicted conversion rate adjustment as a rank.
     *
     * Generated from protobuf field <code>optional float pctr_rank = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return float
     */
    public function getPctrRank()
    {
        return isset($this->pctr_rank) ? $this->pctr_rank : 0.0;
    }

    public function hasPctrRank()
    {
        return isset($this->pctr_rank);
    }

    public function clearPctrRank()
    {
        unset($this->pctr_rank);
    }

    /**
     * Optional. Predicted conversion rate adjustment as a rank.
     *
     * Generated from protobuf field <code>optional float pctr_rank = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param float $var
     * @return $this
     */
    public function setPctrRank($var)
    {
        GPBUtil::checkFloat($var);
        $this->pctr_rank = $var;

        return $this;
    }

    /**
     * Optional. Topicality adjustment as a rank.
     *
     * Generated from protobuf field <code>optional float topicality_rank = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return float
     */
    public function getTopicalityRank()
    {
        return isset($this->topicality_rank) ? $this->topicality_rank : 0.0;
    }

    public function hasTopicalityRank()
    {
        return isset($this->topicality_rank);
    }

    public function clearTopicalityRank()
    {
        unset($this->topicality_rank);
    }

    /**
     * Optional. Topicality adjustment as a rank.
     *
     * Generated from protobuf field <code>optional float topicality_rank = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param float $var
     * @return $this
     */
    public function setTopicalityRank($var)
    {
        GPBUtil::checkFloat($var);
        $this->topicality_rank = $var;

        return $this;
    }

    /**
     * Optional. Age of the document in hours.
     *
     * Generated from protobuf field <code>optional float document_age = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return float
     */
    public function getDocumentAge()
    {
        return isset($this->document_age) ? $this->document_age : 0.0;
    }

    public function hasDocumentAge()
    {
        return isset($this->document_age);
    }

    public function clearDocumentAge()
    {
        unset($this->document_age);
    }

    /**
     * Optional. Age of the document in hours.
     *
     * Generated from protobuf field <code>optional float document_age = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param float $var
     * @return $this
     */
    public function setDocumentAge($var)
    {
        GPBUtil::checkFloat($var);
        $this->document_age = $var;

        return $this;
    }

    /**
     * Optional. Combined custom boosts for a doc.
     *
     * Generated from protobuf field <code>optional float boosting_factor = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return float
     */
    public function getBoostingFactor()
    {
        return isset($this->boosting_factor) ? $this->boosting_factor : 0.0;
    }

    public function hasBoostingFactor()
    {
        return isset($this->boosting_factor);
    }

    public function clearBoostingFactor()
    {
        unset($this->boosting_factor);
    }

    /**
     * Optional. Combined custom boosts for a doc.
     *
     * Generated from protobuf field <code>optional float boosting_factor = 8 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param float $var
     * @return $this
     */
    public function setBoostingFactor($var)
    {
        GPBUtil::checkFloat($var);
        $this->boosting_factor = $var;

        return $this;
    }

    /**
     * Optional. The default rank of the result.
     *
     * Generated from protobuf field <code>float default_rank = 32 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return float
     */
    public function getDefaultRank()
    {
        return $this->default_rank;
    }

    /**
     * Optional. The default rank of the result.
     *
     * Generated from protobuf field <code>float default_rank = 32 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param float $var
     * @return $this
     */
    public function setDefaultRank($var)
    {
        GPBUtil::checkFloat($var);
        $this->default_rank = $var;

        return $this;
    }

    /**
     * Optional. A list of custom clearbox signals.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal custom_signals = 33 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return RepeatedField<\Google\Cloud\DiscoveryEngine\V1\SearchResponse\SearchResult\RankSignals\CustomSignal>
     */
    public function getCustomSignals()
    {
        return $this->custom_signals;
    }

    /**
     * Optional. A list of custom clearbox signals.
     *
     * Generated from protobuf field <code>repeated .google.cloud.discoveryengine.v1.SearchResponse.SearchResult.RankSignals.CustomSignal custom_signals = 33 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\DiscoveryEngine\V1\SearchResponse\SearchResult\RankSignals\CustomSignal[] $var
     * @return $this
     */
    public function setCustomSignals($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DiscoveryEngine\V1\SearchResponse\SearchResult\RankSignals\CustomSignal::class);
        $this->custom_signals = $arr;

        return $this;
    }

}

