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

namespace Google\Cloud\Dataproc\V1;

use UnexpectedValueException;

/**
 * Cluster components that can be activated.
 * Next ID: 16.
 *
 * Protobuf type <code>google.cloud.dataproc.v1.Component</code>
 */
class Component
{
    /**
     * Unspecified component. Specifying this will cause Cluster creation to fail.
     *
     * Generated from protobuf enum <code>COMPONENT_UNSPECIFIED = 0;</code>
     */
    const COMPONENT_UNSPECIFIED = 0;
    /**
     * The Anaconda python distribution. The Anaconda component is not supported
     * in the Dataproc
     * <a
     * href="/dataproc/docs/concepts/versioning/dataproc-release-2.0">2.0
     * image</a>. The 2.0 image is pre-installed with Miniconda.
     *
     * Generated from protobuf enum <code>ANACONDA = 5;</code>
     */
    const ANACONDA = 5;
    /**
     * Docker
     *
     * Generated from protobuf enum <code>DOCKER = 13;</code>
     */
    const DOCKER = 13;
    /**
     * The Druid query engine. (alpha)
     *
     * Generated from protobuf enum <code>DRUID = 9;</code>
     */
    const DRUID = 9;
    /**
     * Flink
     *
     * Generated from protobuf enum <code>FLINK = 14;</code>
     */
    const FLINK = 14;
    /**
     * HBase. (beta)
     *
     * Generated from protobuf enum <code>HBASE = 11;</code>
     */
    const HBASE = 11;
    /**
     * The Hive Web HCatalog (the REST service for accessing HCatalog).
     *
     * Generated from protobuf enum <code>HIVE_WEBHCAT = 3;</code>
     */
    const HIVE_WEBHCAT = 3;
    /**
     * The Jupyter Notebook.
     *
     * Generated from protobuf enum <code>JUPYTER = 1;</code>
     */
    const JUPYTER = 1;
    /**
     * The Presto query engine.
     *
     * Generated from protobuf enum <code>PRESTO = 6;</code>
     */
    const PRESTO = 6;
    /**
     * The Ranger service.
     *
     * Generated from protobuf enum <code>RANGER = 12;</code>
     */
    const RANGER = 12;
    /**
     * The Solr service.
     *
     * Generated from protobuf enum <code>SOLR = 10;</code>
     */
    const SOLR = 10;
    /**
     * The Zeppelin notebook.
     *
     * Generated from protobuf enum <code>ZEPPELIN = 4;</code>
     */
    const ZEPPELIN = 4;
    /**
     * The Zookeeper service.
     *
     * Generated from protobuf enum <code>ZOOKEEPER = 8;</code>
     */
    const ZOOKEEPER = 8;

    private static $valueToName = [
        self::COMPONENT_UNSPECIFIED => 'COMPONENT_UNSPECIFIED',
        self::ANACONDA => 'ANACONDA',
        self::DOCKER => 'DOCKER',
        self::DRUID => 'DRUID',
        self::FLINK => 'FLINK',
        self::HBASE => 'HBASE',
        self::HIVE_WEBHCAT => 'HIVE_WEBHCAT',
        self::JUPYTER => 'JUPYTER',
        self::PRESTO => 'PRESTO',
        self::RANGER => 'RANGER',
        self::SOLR => 'SOLR',
        self::ZEPPELIN => 'ZEPPELIN',
        self::ZOOKEEPER => 'ZOOKEEPER',
    ];

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

