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

namespace Google\Cloud\Dataplex\V1\DiscoveryEvent;

use UnexpectedValueException;

/**
 * The type of the entity.
 *
 * Protobuf type <code>google.cloud.dataplex.v1.DiscoveryEvent.EntityType</code>
 */
class EntityType
{
    /**
     * An unspecified event type.
     *
     * Generated from protobuf enum <code>ENTITY_TYPE_UNSPECIFIED = 0;</code>
     */
    const ENTITY_TYPE_UNSPECIFIED = 0;
    /**
     * Entities representing structured data.
     *
     * Generated from protobuf enum <code>TABLE = 1;</code>
     */
    const TABLE = 1;
    /**
     * Entities representing unstructured data.
     *
     * Generated from protobuf enum <code>FILESET = 2;</code>
     */
    const FILESET = 2;

    private static $valueToName = [
        self::ENTITY_TYPE_UNSPECIFIED => 'ENTITY_TYPE_UNSPECIFIED',
        self::TABLE => 'TABLE',
        self::FILESET => 'FILESET',
    ];

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


