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

namespace Google\Apps\Card\V1\ChipList;

use UnexpectedValueException;

/**
 * The chip list layout.
 *
 * Protobuf type <code>google.apps.card.v1.ChipList.Layout</code>
 */
class Layout
{
    /**
     * Don't use. Unspecified.
     *
     * Generated from protobuf enum <code>LAYOUT_UNSPECIFIED = 0;</code>
     */
    const LAYOUT_UNSPECIFIED = 0;
    /**
     * Default value. The chip list wraps to the next line if there isn't enough
     * horizontal space.
     *
     * Generated from protobuf enum <code>WRAPPED = 1;</code>
     */
    const WRAPPED = 1;
    /**
     * The chips scroll horizontally if they don't fit in the available space.
     *
     * Generated from protobuf enum <code>HORIZONTAL_SCROLLABLE = 2;</code>
     */
    const HORIZONTAL_SCROLLABLE = 2;

    private static $valueToName = [
        self::LAYOUT_UNSPECIFIED => 'LAYOUT_UNSPECIFIED',
        self::WRAPPED => 'WRAPPED',
        self::HORIZONTAL_SCROLLABLE => 'HORIZONTAL_SCROLLABLE',
    ];

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


