<?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;
    /**
     * Deprecated: Use `RANK_BY_EMBEDDING` instead.
     * Ranking by custom embedding model, the default way to evaluate the
     * ranking expression. Legacy enum option, `RANK_BY_EMBEDDING` should be
     * used instead.
     *
     * Generated from protobuf enum <code>BYOE = 1 [deprecated = true];</code>
     */
    const BYOE = 1;
    /**
     * Deprecated: Use `RANK_BY_FORMULA` instead.
     * Ranking by custom formula. Legacy enum option, `RANK_BY_FORMULA` should
     * be used instead.
     *
     * Generated from protobuf enum <code>CLEARBOX = 2 [deprecated = true];</code>
     */
    const CLEARBOX = 2;
    /**
     * 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::BYOE => 'BYOE',
        self::CLEARBOX => 'CLEARBOX',
        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);
    }
}

