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

namespace Google\Cloud\Retail\V2\SearchRequest;

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

/**
 * The specification for query spell correction.
 *
 * Generated from protobuf message <code>google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec</code>
 */
class SpellCorrectionSpec extends \Google\Protobuf\Internal\Message
{
    /**
     * The mode under which spell correction should take effect to
     * replace the original search query. Default to
     * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode mode = 1;</code>
     */
    private $mode = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $mode
     *           The mode under which spell correction should take effect to
     *           replace the original search query. Default to
     *           [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Retail\V2\SearchService::initOnce();
        parent::__construct($data);
    }

    /**
     * The mode under which spell correction should take effect to
     * replace the original search query. Default to
     * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode mode = 1;</code>
     * @return int
     */
    public function getMode()
    {
        return $this->mode;
    }

    /**
     * The mode under which spell correction should take effect to
     * replace the original search query. Default to
     * [Mode.AUTO][google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.SearchRequest.SpellCorrectionSpec.Mode mode = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setMode($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Retail\V2\SearchRequest\SpellCorrectionSpec\Mode::class);
        $this->mode = $var;

        return $this;
    }

}


