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

namespace Google\Apps\Card\V1\Widget;

use UnexpectedValueException;

/**
 * Represents vertical alignment attribute.
 *
 * Protobuf type <code>google.apps.card.v1.Widget.VerticalAlignment</code>
 */
class VerticalAlignment
{
    /**
     * Unspecified type. Do not use.
     *
     * Generated from protobuf enum <code>VERTICAL_ALIGNMENT_UNSPECIFIED = 0;</code>
     */
    const VERTICAL_ALIGNMENT_UNSPECIFIED = 0;
    /**
     * Alignment to the top position.
     *
     * Generated from protobuf enum <code>TOP = 1;</code>
     */
    const TOP = 1;
    /**
     * Alignment to the middle position.
     *
     * Generated from protobuf enum <code>MIDDLE = 2;</code>
     */
    const MIDDLE = 2;
    /**
     * Alignment to the bottom position.
     *
     * Generated from protobuf enum <code>BOTTOM = 3;</code>
     */
    const BOTTOM = 3;

    private static $valueToName = [
        self::VERTICAL_ALIGNMENT_UNSPECIFIED => 'VERTICAL_ALIGNMENT_UNSPECIFIED',
        self::TOP => 'TOP',
        self::MIDDLE => 'MIDDLE',
        self::BOTTOM => 'BOTTOM',
    ];

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


