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

namespace Google\Cloud\DiscoveryEngine\V1\SearchRequest\NaturalLanguageQueryUnderstandingSpec;

use UnexpectedValueException;

/**
 * Enum describing how extracted filters are applied to the search.
 *
 * Protobuf type <code>google.cloud.discoveryengine.v1.SearchRequest.NaturalLanguageQueryUnderstandingSpec.ExtractedFilterBehavior</code>
 */
class ExtractedFilterBehavior
{
    /**
     * `EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED` will use the default behavior
     * for extracted filters. For single datastore search, the default is to
     * apply as hard filters. For multi-datastore search, the default is to
     * apply as soft boosts.
     *
     * Generated from protobuf enum <code>EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0;</code>
     */
    const EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED = 0;
    /**
     * Applies all extracted filters as hard filters on the results. Results
     * that do not pass the extracted filters will not be returned in the
     * result set.
     *
     * Generated from protobuf enum <code>HARD_FILTER = 1;</code>
     */
    const HARD_FILTER = 1;
    /**
     * Applies all extracted filters as soft boosts. Results that pass the
     * filters will be boosted up to higher ranks in the result set.
     *
     * Generated from protobuf enum <code>SOFT_BOOST = 2;</code>
     */
    const SOFT_BOOST = 2;

    private static $valueToName = [
        self::EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED => 'EXTRACTED_FILTER_BEHAVIOR_UNSPECIFIED',
        self::HARD_FILTER => 'HARD_FILTER',
        self::SOFT_BOOST => 'SOFT_BOOST',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}


