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

namespace Google\Cloud\DocumentAI\V1\Document\PageAnchor\PageRef;

use UnexpectedValueException;

/**
 * The type of layout that is being referenced.
 *
 * Protobuf type <code>google.cloud.documentai.v1.Document.PageAnchor.PageRef.LayoutType</code>
 */
class LayoutType
{
    /**
     * Layout Unspecified.
     *
     * Generated from protobuf enum <code>LAYOUT_TYPE_UNSPECIFIED = 0;</code>
     */
    const LAYOUT_TYPE_UNSPECIFIED = 0;
    /**
     * References a [Page.blocks][google.cloud.documentai.v1.Document.Page.blocks] element.
     *
     * Generated from protobuf enum <code>BLOCK = 1;</code>
     */
    const BLOCK = 1;
    /**
     * References a [Page.paragraphs][google.cloud.documentai.v1.Document.Page.paragraphs] element.
     *
     * Generated from protobuf enum <code>PARAGRAPH = 2;</code>
     */
    const PARAGRAPH = 2;
    /**
     * References a [Page.lines][google.cloud.documentai.v1.Document.Page.lines] element.
     *
     * Generated from protobuf enum <code>LINE = 3;</code>
     */
    const LINE = 3;
    /**
     * References a [Page.tokens][google.cloud.documentai.v1.Document.Page.tokens] element.
     *
     * Generated from protobuf enum <code>TOKEN = 4;</code>
     */
    const TOKEN = 4;
    /**
     * References a [Page.visual_elements][google.cloud.documentai.v1.Document.Page.visual_elements] element.
     *
     * Generated from protobuf enum <code>VISUAL_ELEMENT = 5;</code>
     */
    const VISUAL_ELEMENT = 5;
    /**
     * Refrrences a [Page.tables][google.cloud.documentai.v1.Document.Page.tables] element.
     *
     * Generated from protobuf enum <code>TABLE = 6;</code>
     */
    const TABLE = 6;
    /**
     * References a [Page.form_fields][google.cloud.documentai.v1.Document.Page.form_fields] element.
     *
     * Generated from protobuf enum <code>FORM_FIELD = 7;</code>
     */
    const FORM_FIELD = 7;

    private static $valueToName = [
        self::LAYOUT_TYPE_UNSPECIFIED => 'LAYOUT_TYPE_UNSPECIFIED',
        self::BLOCK => 'BLOCK',
        self::PARAGRAPH => 'PARAGRAPH',
        self::LINE => 'LINE',
        self::TOKEN => 'TOKEN',
        self::VISUAL_ELEMENT => 'VISUAL_ELEMENT',
        self::TABLE => 'TABLE',
        self::FORM_FIELD => 'FORM_FIELD',
    ];

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


