<?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.
 *
 * 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.
     *
     * Generated from protobuf enum <code>ANACONDA = 5;</code>
     */
    const ANACONDA = 5;
    /**
     * 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 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::HIVE_WEBHCAT => 'HIVE_WEBHCAT',
        self::JUPYTER => 'JUPYTER',
        self::PRESTO => 'PRESTO',
        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);
    }
}

