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

namespace Google\Cloud\Dataproc\V1\SessionOperationMetadata;

use UnexpectedValueException;

/**
 * Operation type for Session resources
 *
 * Protobuf type <code>google.cloud.dataproc.v1.SessionOperationMetadata.SessionOperationType</code>
 */
class SessionOperationType
{
    /**
     * Session operation type is unknown.
     *
     * Generated from protobuf enum <code>SESSION_OPERATION_TYPE_UNSPECIFIED = 0;</code>
     */
    const SESSION_OPERATION_TYPE_UNSPECIFIED = 0;
    /**
     * Create Session operation type.
     *
     * Generated from protobuf enum <code>CREATE = 1;</code>
     */
    const CREATE = 1;
    /**
     * Terminate Session operation type.
     *
     * Generated from protobuf enum <code>TERMINATE = 2;</code>
     */
    const TERMINATE = 2;
    /**
     * Delete Session operation type.
     *
     * Generated from protobuf enum <code>DELETE = 3;</code>
     */
    const DELETE = 3;

    private static $valueToName = [
        self::SESSION_OPERATION_TYPE_UNSPECIFIED => 'SESSION_OPERATION_TYPE_UNSPECIFIED',
        self::CREATE => 'CREATE',
        self::TERMINATE => 'TERMINATE',
        self::DELETE => 'DELETE',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(SessionOperationType::class, \Google\Cloud\Dataproc\V1\SessionOperationMetadata_SessionOperationType::class);

