<?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 event.
 *
 * Protobuf type <code>google.cloud.dataplex.v1.DiscoveryEvent.EventType</code>
 */
class EventType
{
    /**
     * An unspecified event type.
     *
     * Generated from protobuf enum <code>EVENT_TYPE_UNSPECIFIED = 0;</code>
     */
    const EVENT_TYPE_UNSPECIFIED = 0;
    /**
     * An event representing discovery configuration in effect.
     *
     * Generated from protobuf enum <code>CONFIG = 1;</code>
     */
    const CONFIG = 1;
    /**
     * An event representing a metadata entity being created.
     *
     * Generated from protobuf enum <code>ENTITY_CREATED = 2;</code>
     */
    const ENTITY_CREATED = 2;
    /**
     * An event representing a metadata entity being updated.
     *
     * Generated from protobuf enum <code>ENTITY_UPDATED = 3;</code>
     */
    const ENTITY_UPDATED = 3;
    /**
     * An event representing a metadata entity being deleted.
     *
     * Generated from protobuf enum <code>ENTITY_DELETED = 4;</code>
     */
    const ENTITY_DELETED = 4;
    /**
     * An event representing a partition being created.
     *
     * Generated from protobuf enum <code>PARTITION_CREATED = 5;</code>
     */
    const PARTITION_CREATED = 5;
    /**
     * An event representing a partition being updated.
     *
     * Generated from protobuf enum <code>PARTITION_UPDATED = 6;</code>
     */
    const PARTITION_UPDATED = 6;
    /**
     * An event representing a partition being deleted.
     *
     * Generated from protobuf enum <code>PARTITION_DELETED = 7;</code>
     */
    const PARTITION_DELETED = 7;

    private static $valueToName = [
        self::EVENT_TYPE_UNSPECIFIED => 'EVENT_TYPE_UNSPECIFIED',
        self::CONFIG => 'CONFIG',
        self::ENTITY_CREATED => 'ENTITY_CREATED',
        self::ENTITY_UPDATED => 'ENTITY_UPDATED',
        self::ENTITY_DELETED => 'ENTITY_DELETED',
        self::PARTITION_CREATED => 'PARTITION_CREATED',
        self::PARTITION_UPDATED => 'PARTITION_UPDATED',
        self::PARTITION_DELETED => 'PARTITION_DELETED',
    ];

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


