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

namespace Google\Cloud\Retail\V2;

use UnexpectedValueException;

/**
 * The use case of Cloud Retail Search.
 *
 * Protobuf type <code>google.cloud.retail.v2.SearchSolutionUseCase</code>
 */
class SearchSolutionUseCase
{
    /**
     * The value when it's unspecified. In this case, server behavior defaults to
     * [SEARCH_SOLUTION_USE_CASE_SEARCH][google.cloud.retail.v2.SearchSolutionUseCase.SEARCH_SOLUTION_USE_CASE_SEARCH].
     *
     * Generated from protobuf enum <code>SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0;</code>
     */
    const SEARCH_SOLUTION_USE_CASE_UNSPECIFIED = 0;
    /**
     * Search use case. Expects the traffic has a non-empty
     * [query][google.cloud.retail.v2.SearchRequest.query].
     *
     * Generated from protobuf enum <code>SEARCH_SOLUTION_USE_CASE_SEARCH = 1;</code>
     */
    const SEARCH_SOLUTION_USE_CASE_SEARCH = 1;
    /**
     * Browse use case. Expects the traffic has an empty
     * [query][google.cloud.retail.v2.SearchRequest.query].
     *
     * Generated from protobuf enum <code>SEARCH_SOLUTION_USE_CASE_BROWSE = 2;</code>
     */
    const SEARCH_SOLUTION_USE_CASE_BROWSE = 2;

    private static $valueToName = [
        self::SEARCH_SOLUTION_USE_CASE_UNSPECIFIED => 'SEARCH_SOLUTION_USE_CASE_UNSPECIFIED',
        self::SEARCH_SOLUTION_USE_CASE_SEARCH => 'SEARCH_SOLUTION_USE_CASE_SEARCH',
        self::SEARCH_SOLUTION_USE_CASE_BROWSE => 'SEARCH_SOLUTION_USE_CASE_BROWSE',
    ];

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

