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

namespace Google\Cloud\Speech\V2;

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

/**
 * Provides information to the Recognizer that specifies how to process the
 * recognition request.
 *
 * Generated from protobuf message <code>google.cloud.speech.v2.RecognitionConfig</code>
 */
class RecognitionConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Speech recognition features to enable.
     *
     * Generated from protobuf field <code>.google.cloud.speech.v2.RecognitionFeatures features = 2;</code>
     */
    private $features = null;
    /**
     * Speech adaptation context that weights recognizer predictions for specific
     * words and phrases.
     *
     * Generated from protobuf field <code>.google.cloud.speech.v2.SpeechAdaptation adaptation = 6;</code>
     */
    private $adaptation = null;
    protected $decoding_config;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Speech\V2\AutoDetectDecodingConfig $auto_decoding_config
     *           Automatically detect decoding parameters.
     *           Preferred for supported formats.
     *     @type \Google\Cloud\Speech\V2\ExplicitDecodingConfig $explicit_decoding_config
     *           Explicitly specified decoding parameters.
     *           Required if using headerless PCM audio (linear16, mulaw, alaw).
     *     @type \Google\Cloud\Speech\V2\RecognitionFeatures $features
     *           Speech recognition features to enable.
     *     @type \Google\Cloud\Speech\V2\SpeechAdaptation $adaptation
     *           Speech adaptation context that weights recognizer predictions for specific
     *           words and phrases.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Speech\V2\CloudSpeech::initOnce();
        parent::__construct($data);
    }

    /**
     * Automatically detect decoding parameters.
     * Preferred for supported formats.
     *
     * Generated from protobuf field <code>.google.cloud.speech.v2.AutoDetectDecodingConfig auto_decoding_config = 7;</code>
     * @return \Google\Cloud\Speech\V2\AutoDetectDecodingConfig|null
     */
    public function getAutoDecodingConfig()
    {
        return $this->readOneof(7);
    }

    public function hasAutoDecodingConfig()
    {
        return $this->hasOneof(7);
    }

    /**
     * Automatically detect decoding parameters.
     * Preferred for supported formats.
     *
     * Generated from protobuf field <code>.google.cloud.speech.v2.AutoDetectDecodingConfig auto_decoding_config = 7;</code>
     * @param \Google\Cloud\Speech\V2\AutoDetectDecodingConfig $var
     * @return $this
     */
    public function setAutoDecodingConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Speech\V2\AutoDetectDecodingConfig::class);
        $this->writeOneof(7, $var);

        return $this;
    }

    /**
     * Explicitly specified decoding parameters.
     * Required if using headerless PCM audio (linear16, mulaw, alaw).
     *
     * Generated from protobuf field <code>.google.cloud.speech.v2.ExplicitDecodingConfig explicit_decoding_config = 8;</code>
     * @return \Google\Cloud\Speech\V2\ExplicitDecodingConfig|null
     */
    public function getExplicitDecodingConfig()
    {
        return $this->readOneof(8);
    }

    public function hasExplicitDecodingConfig()
    {
        return $this->hasOneof(8);
    }

    /**
     * Explicitly specified decoding parameters.
     * Required if using headerless PCM audio (linear16, mulaw, alaw).
     *
     * Generated from protobuf field <code>.google.cloud.speech.v2.ExplicitDecodingConfig explicit_decoding_config = 8;</code>
     * @param \Google\Cloud\Speech\V2\ExplicitDecodingConfig $var
     * @return $this
     */
    public function setExplicitDecodingConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Speech\V2\ExplicitDecodingConfig::class);
        $this->writeOneof(8, $var);

        return $this;
    }

    /**
     * Speech recognition features to enable.
     *
     * Generated from protobuf field <code>.google.cloud.speech.v2.RecognitionFeatures features = 2;</code>
     * @return \Google\Cloud\Speech\V2\RecognitionFeatures|null
     */
    public function getFeatures()
    {
        return $this->features;
    }

    public function hasFeatures()
    {
        return isset($this->features);
    }

    public function clearFeatures()
    {
        unset($this->features);
    }

    /**
     * Speech recognition features to enable.
     *
     * Generated from protobuf field <code>.google.cloud.speech.v2.RecognitionFeatures features = 2;</code>
     * @param \Google\Cloud\Speech\V2\RecognitionFeatures $var
     * @return $this
     */
    public function setFeatures($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Speech\V2\RecognitionFeatures::class);
        $this->features = $var;

        return $this;
    }

    /**
     * Speech adaptation context that weights recognizer predictions for specific
     * words and phrases.
     *
     * Generated from protobuf field <code>.google.cloud.speech.v2.SpeechAdaptation adaptation = 6;</code>
     * @return \Google\Cloud\Speech\V2\SpeechAdaptation|null
     */
    public function getAdaptation()
    {
        return $this->adaptation;
    }

    public function hasAdaptation()
    {
        return isset($this->adaptation);
    }

    public function clearAdaptation()
    {
        unset($this->adaptation);
    }

    /**
     * Speech adaptation context that weights recognizer predictions for specific
     * words and phrases.
     *
     * Generated from protobuf field <code>.google.cloud.speech.v2.SpeechAdaptation adaptation = 6;</code>
     * @param \Google\Cloud\Speech\V2\SpeechAdaptation $var
     * @return $this
     */
    public function setAdaptation($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Speech\V2\SpeechAdaptation::class);
        $this->adaptation = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getDecodingConfig()
    {
        return $this->whichOneof("decoding_config");
    }

}

