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

namespace Google\Cloud\Dataplex\V1\SessionEvent;

use UnexpectedValueException;

/**
 * The type of the event.
 *
 * Protobuf type <code>google.cloud.dataplex.v1.SessionEvent.EventType</code>
 */
class EventType
{
    /**
     * An unspecified event type.
     *
     * Generated from protobuf enum <code>EVENT_TYPE_UNSPECIFIED = 0;</code>
     */
    const EVENT_TYPE_UNSPECIFIED = 0;
    /**
     * Event when the session is assigned to a user.
     *
     * Generated from protobuf enum <code>START = 1;</code>
     */
    const START = 1;
    /**
     * Event for stop of a session.
     *
     * Generated from protobuf enum <code>STOP = 2;</code>
     */
    const STOP = 2;
    /**
     * Query events in the session.
     *
     * Generated from protobuf enum <code>QUERY = 3;</code>
     */
    const QUERY = 3;
    /**
     * Event for creation of a cluster. It is not yet assigned to a user.
     * This comes before START in the sequence
     *
     * Generated from protobuf enum <code>CREATE = 4;</code>
     */
    const CREATE = 4;

    private static $valueToName = [
        self::EVENT_TYPE_UNSPECIFIED => 'EVENT_TYPE_UNSPECIFIED',
        self::START => 'START',
        self::STOP => 'STOP',
        self::QUERY => 'QUERY',
        self::CREATE => 'CREATE',
    ];

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


