<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/dialogflow/v2/intent.proto

namespace Google\Cloud\Dialogflow\V2\Intent\Message\ColumnProperties;

use UnexpectedValueException;

/**
 * Text alignments within a cell.
 *
 * Protobuf type <code>google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment</code>
 */
class HorizontalAlignment
{
    /**
     * Text is aligned to the leading edge of the column.
     *
     * Generated from protobuf enum <code>HORIZONTAL_ALIGNMENT_UNSPECIFIED = 0;</code>
     */
    const HORIZONTAL_ALIGNMENT_UNSPECIFIED = 0;
    /**
     * Text is aligned to the leading edge of the column.
     *
     * Generated from protobuf enum <code>LEADING = 1;</code>
     */
    const LEADING = 1;
    /**
     * Text is centered in the column.
     *
     * Generated from protobuf enum <code>CENTER = 2;</code>
     */
    const CENTER = 2;
    /**
     * Text is aligned to the trailing edge of the column.
     *
     * Generated from protobuf enum <code>TRAILING = 3;</code>
     */
    const TRAILING = 3;

    private static $valueToName = [
        self::HORIZONTAL_ALIGNMENT_UNSPECIFIED => 'HORIZONTAL_ALIGNMENT_UNSPECIFIED',
        self::LEADING => 'LEADING',
        self::CENTER => 'CENTER',
        self::TRAILING => 'TRAILING',
    ];

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


