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

namespace Google\Cloud\DiscoveryEngine\V1\SearchRequest;

use UnexpectedValueException;

/**
 * The backend to use for the ranking expression evaluation.
 *
 * Protobuf type <code>google.cloud.discoveryengine.v1.SearchRequest.RankingExpressionBackend</code>
 */
class RankingExpressionBackend
{
    /**
     * Default option for unspecified/unknown values.
     *
     * Generated from protobuf enum <code>RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0;</code>
     */
    const RANKING_EXPRESSION_BACKEND_UNSPECIFIED = 0;
    /**
     * Ranking by custom embedding model, the default way to evaluate the
     * ranking expression.
     *
     * Generated from protobuf enum <code>RANK_BY_EMBEDDING = 3;</code>
     */
    const RANK_BY_EMBEDDING = 3;
    /**
     * Ranking by custom formula.
     *
     * Generated from protobuf enum <code>RANK_BY_FORMULA = 4;</code>
     */
    const RANK_BY_FORMULA = 4;

    private static $valueToName = [
        self::RANKING_EXPRESSION_BACKEND_UNSPECIFIED => 'RANKING_EXPRESSION_BACKEND_UNSPECIFIED',
        self::RANK_BY_EMBEDDING => 'RANK_BY_EMBEDDING',
        self::RANK_BY_FORMULA => 'RANK_BY_FORMULA',
    ];

    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);
    }
}


