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

namespace Google\Cloud\Dialogflow\Cx\V3\AdvancedSettings;

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

/**
 * Define behaviors of speech to text detection.
 *
 * Generated from protobuf message <code>google.cloud.dialogflow.cx.v3.AdvancedSettings.SpeechSettings</code>
 */
class SpeechSettings extends \Google\Protobuf\Internal\Message
{
    /**
     * Sensitivity of the speech model that detects the end of speech.
     * Scale from 0 to 100.
     *
     * Generated from protobuf field <code>int32 endpointer_sensitivity = 1;</code>
     */
    protected $endpointer_sensitivity = 0;
    /**
     * Timeout before detecting no speech.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration no_speech_timeout = 2;</code>
     */
    protected $no_speech_timeout = null;
    /**
     * Use timeout based endpointing, interpreting endpointer sensitivity as
     * seconds of timeout value.
     *
     * Generated from protobuf field <code>bool use_timeout_based_endpointing = 3;</code>
     */
    protected $use_timeout_based_endpointing = false;
    /**
     * Mapping from language to Speech-to-Text model. The mapped Speech-to-Text
     * model will be selected for requests from its corresponding language.
     * For more information, see
     * [Speech
     * models](https://cloud.google.com/dialogflow/cx/docs/concept/speech-models).
     *
     * Generated from protobuf field <code>map<string, string> models = 5;</code>
     */
    private $models;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $endpointer_sensitivity
     *           Sensitivity of the speech model that detects the end of speech.
     *           Scale from 0 to 100.
     *     @type \Google\Protobuf\Duration $no_speech_timeout
     *           Timeout before detecting no speech.
     *     @type bool $use_timeout_based_endpointing
     *           Use timeout based endpointing, interpreting endpointer sensitivity as
     *           seconds of timeout value.
     *     @type array|\Google\Protobuf\Internal\MapField $models
     *           Mapping from language to Speech-to-Text model. The mapped Speech-to-Text
     *           model will be selected for requests from its corresponding language.
     *           For more information, see
     *           [Speech
     *           models](https://cloud.google.com/dialogflow/cx/docs/concept/speech-models).
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dialogflow\Cx\V3\AdvancedSettings::initOnce();
        parent::__construct($data);
    }

    /**
     * Sensitivity of the speech model that detects the end of speech.
     * Scale from 0 to 100.
     *
     * Generated from protobuf field <code>int32 endpointer_sensitivity = 1;</code>
     * @return int
     */
    public function getEndpointerSensitivity()
    {
        return $this->endpointer_sensitivity;
    }

    /**
     * Sensitivity of the speech model that detects the end of speech.
     * Scale from 0 to 100.
     *
     * Generated from protobuf field <code>int32 endpointer_sensitivity = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setEndpointerSensitivity($var)
    {
        GPBUtil::checkInt32($var);
        $this->endpointer_sensitivity = $var;

        return $this;
    }

    /**
     * Timeout before detecting no speech.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration no_speech_timeout = 2;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getNoSpeechTimeout()
    {
        return $this->no_speech_timeout;
    }

    public function hasNoSpeechTimeout()
    {
        return isset($this->no_speech_timeout);
    }

    public function clearNoSpeechTimeout()
    {
        unset($this->no_speech_timeout);
    }

    /**
     * Timeout before detecting no speech.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration no_speech_timeout = 2;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setNoSpeechTimeout($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->no_speech_timeout = $var;

        return $this;
    }

    /**
     * Use timeout based endpointing, interpreting endpointer sensitivity as
     * seconds of timeout value.
     *
     * Generated from protobuf field <code>bool use_timeout_based_endpointing = 3;</code>
     * @return bool
     */
    public function getUseTimeoutBasedEndpointing()
    {
        return $this->use_timeout_based_endpointing;
    }

    /**
     * Use timeout based endpointing, interpreting endpointer sensitivity as
     * seconds of timeout value.
     *
     * Generated from protobuf field <code>bool use_timeout_based_endpointing = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setUseTimeoutBasedEndpointing($var)
    {
        GPBUtil::checkBool($var);
        $this->use_timeout_based_endpointing = $var;

        return $this;
    }

    /**
     * Mapping from language to Speech-to-Text model. The mapped Speech-to-Text
     * model will be selected for requests from its corresponding language.
     * For more information, see
     * [Speech
     * models](https://cloud.google.com/dialogflow/cx/docs/concept/speech-models).
     *
     * Generated from protobuf field <code>map<string, string> models = 5;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getModels()
    {
        return $this->models;
    }

    /**
     * Mapping from language to Speech-to-Text model. The mapped Speech-to-Text
     * model will be selected for requests from its corresponding language.
     * For more information, see
     * [Speech
     * models](https://cloud.google.com/dialogflow/cx/docs/concept/speech-models).
     *
     * Generated from protobuf field <code>map<string, string> models = 5;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setModels($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->models = $arr;

        return $this;
    }

}

