<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/shopping/css/v1/accounts_labels.proto

namespace Google\Shopping\Css\V1\AccountLabel;

use UnexpectedValueException;

/**
 * The label type.
 *
 * Protobuf type <code>google.shopping.css.v1.AccountLabel.LabelType</code>
 */
class LabelType
{
    /**
     * Unknown label type.
     *
     * Generated from protobuf enum <code>LABEL_TYPE_UNSPECIFIED = 0;</code>
     */
    const LABEL_TYPE_UNSPECIFIED = 0;
    /**
     * Indicates that the label was created manually.
     *
     * Generated from protobuf enum <code>MANUAL = 1;</code>
     */
    const MANUAL = 1;
    /**
     * Indicates that the label was created automatically by CSS Center.
     *
     * Generated from protobuf enum <code>AUTOMATIC = 2;</code>
     */
    const AUTOMATIC = 2;

    private static $valueToName = [
        self::LABEL_TYPE_UNSPECIFIED => 'LABEL_TYPE_UNSPECIFIED',
        self::MANUAL => 'MANUAL',
        self::AUTOMATIC => 'AUTOMATIC',
    ];

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


