<?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 retrievable option of a catalog attribute.
 *
 * Protobuf type <code>google.cloud.retail.v2.CatalogAttribute.RetrievableOption</code>
 */
class RetrievableOption
{
    /**
     * Value used when unset.
     *
     * Generated from protobuf enum <code>RETRIEVABLE_OPTION_UNSPECIFIED = 0;</code>
     */
    const RETRIEVABLE_OPTION_UNSPECIFIED = 0;
    /**
     * Retrievable option enabled for an attribute.
     *
     * Generated from protobuf enum <code>RETRIEVABLE_ENABLED = 1;</code>
     */
    const RETRIEVABLE_ENABLED = 1;
    /**
     * Retrievable option disabled for an attribute.
     *
     * Generated from protobuf enum <code>RETRIEVABLE_DISABLED = 2;</code>
     */
    const RETRIEVABLE_DISABLED = 2;

    private static $valueToName = [
        self::RETRIEVABLE_OPTION_UNSPECIFIED => 'RETRIEVABLE_OPTION_UNSPECIFIED',
        self::RETRIEVABLE_ENABLED => 'RETRIEVABLE_ENABLED',
        self::RETRIEVABLE_DISABLED => 'RETRIEVABLE_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);
    }
}


