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

namespace Google\Cloud\Dataplex\V1\SessionEvent\QueryDetail;

use UnexpectedValueException;

/**
 * Query Execution engine.
 *
 * Protobuf type <code>google.cloud.dataplex.v1.SessionEvent.QueryDetail.Engine</code>
 */
class Engine
{
    /**
     * An unspecified Engine type.
     *
     * Generated from protobuf enum <code>ENGINE_UNSPECIFIED = 0;</code>
     */
    const ENGINE_UNSPECIFIED = 0;
    /**
     * Spark-sql engine is specified in Query.
     *
     * Generated from protobuf enum <code>SPARK_SQL = 1;</code>
     */
    const SPARK_SQL = 1;
    /**
     * BigQuery engine is specified in Query.
     *
     * Generated from protobuf enum <code>BIGQUERY = 2;</code>
     */
    const BIGQUERY = 2;

    private static $valueToName = [
        self::ENGINE_UNSPECIFIED => 'ENGINE_UNSPECIFIED',
        self::SPARK_SQL => 'SPARK_SQL',
        self::BIGQUERY => 'BIGQUERY',
    ];

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


