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

namespace Google\Cloud\Retail\V2\CatalogAttribute;

use UnexpectedValueException;

/**
 * The status of the exact-searchable option of a catalog attribute.
 *
 * Protobuf type <code>google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption</code>
 */
class ExactSearchableOption
{
    /**
     * Value used when unset. Defaults to
     * [EXACT_SEARCHABLE_DISABLED][google.cloud.retail.v2.CatalogAttribute.ExactSearchableOption.EXACT_SEARCHABLE_DISABLED].
     *
     * Generated from protobuf enum <code>EXACT_SEARCHABLE_OPTION_UNSPECIFIED = 0;</code>
     */
    const EXACT_SEARCHABLE_OPTION_UNSPECIFIED = 0;
    /**
     * Exact searchable option enabled for an attribute.
     *
     * Generated from protobuf enum <code>EXACT_SEARCHABLE_ENABLED = 1;</code>
     */
    const EXACT_SEARCHABLE_ENABLED = 1;
    /**
     * Exact searchable option disabled for an attribute.
     *
     * Generated from protobuf enum <code>EXACT_SEARCHABLE_DISABLED = 2;</code>
     */
    const EXACT_SEARCHABLE_DISABLED = 2;

    private static $valueToName = [
        self::EXACT_SEARCHABLE_OPTION_UNSPECIFIED => 'EXACT_SEARCHABLE_OPTION_UNSPECIFIED',
        self::EXACT_SEARCHABLE_ENABLED => 'EXACT_SEARCHABLE_ENABLED',
        self::EXACT_SEARCHABLE_DISABLED => 'EXACT_SEARCHABLE_DISABLED',
    ];

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


