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

namespace Google\Cloud\AIPlatform\V1;

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

/**
 * Describes the options to customize dynamic retrieval.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.DynamicRetrievalConfig</code>
 */
class DynamicRetrievalConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * The mode of the predictor to be used in dynamic retrieval.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.DynamicRetrievalConfig.Mode mode = 1;</code>
     */
    protected $mode = 0;
    /**
     * Optional. The threshold to be used in dynamic retrieval.
     * If not set, a system default value is used.
     *
     * Generated from protobuf field <code>optional float dynamic_threshold = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $dynamic_threshold = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $mode
     *           The mode of the predictor to be used in dynamic retrieval.
     *     @type float $dynamic_threshold
     *           Optional. The threshold to be used in dynamic retrieval.
     *           If not set, a system default value is used.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\Tool::initOnce();
        parent::__construct($data);
    }

    /**
     * The mode of the predictor to be used in dynamic retrieval.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.DynamicRetrievalConfig.Mode mode = 1;</code>
     * @return int
     */
    public function getMode()
    {
        return $this->mode;
    }

    /**
     * The mode of the predictor to be used in dynamic retrieval.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.DynamicRetrievalConfig.Mode mode = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setMode($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\AIPlatform\V1\DynamicRetrievalConfig\Mode::class);
        $this->mode = $var;

        return $this;
    }

    /**
     * Optional. The threshold to be used in dynamic retrieval.
     * If not set, a system default value is used.
     *
     * Generated from protobuf field <code>optional float dynamic_threshold = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return float
     */
    public function getDynamicThreshold()
    {
        return isset($this->dynamic_threshold) ? $this->dynamic_threshold : 0.0;
    }

    public function hasDynamicThreshold()
    {
        return isset($this->dynamic_threshold);
    }

    public function clearDynamicThreshold()
    {
        unset($this->dynamic_threshold);
    }

    /**
     * Optional. The threshold to be used in dynamic retrieval.
     * If not set, a system default value is used.
     *
     * Generated from protobuf field <code>optional float dynamic_threshold = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param float $var
     * @return $this
     */
    public function setDynamicThreshold($var)
    {
        GPBUtil::checkFloat($var);
        $this->dynamic_threshold = $var;

        return $this;
    }

}

