<?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 indexable option of a catalog attribute.
 *
 * Protobuf type <code>google.cloud.retail.v2.CatalogAttribute.IndexableOption</code>
 */
class IndexableOption
{
    /**
     * Value used when unset. Defaults to
     * [INDEXABLE_ENABLED][google.cloud.retail.v2.CatalogAttribute.IndexableOption.INDEXABLE_ENABLED].
     *
     * Generated from protobuf enum <code>INDEXABLE_OPTION_UNSPECIFIED = 0;</code>
     */
    const INDEXABLE_OPTION_UNSPECIFIED = 0;
    /**
     * Indexable option enabled for an attribute.
     *
     * Generated from protobuf enum <code>INDEXABLE_ENABLED = 1;</code>
     */
    const INDEXABLE_ENABLED = 1;
    /**
     * Indexable option disabled for an attribute.
     *
     * Generated from protobuf enum <code>INDEXABLE_DISABLED = 2;</code>
     */
    const INDEXABLE_DISABLED = 2;

    private static $valueToName = [
        self::INDEXABLE_OPTION_UNSPECIFIED => 'INDEXABLE_OPTION_UNSPECIFIED',
        self::INDEXABLE_ENABLED => 'INDEXABLE_ENABLED',
        self::INDEXABLE_DISABLED => 'INDEXABLE_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);
    }
}


