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

namespace Google\Cloud\AIPlatform\V1\NotebookRuntime;

use UnexpectedValueException;

/**
 * The substate of the NotebookRuntime to display state of runtime.
 * The resource of NotebookRuntime is in ACTIVE state for these sub state.
 *
 * Protobuf type <code>google.cloud.aiplatform.v1.NotebookRuntime.RuntimeState</code>
 */
class RuntimeState
{
    /**
     * Unspecified runtime state.
     *
     * Generated from protobuf enum <code>RUNTIME_STATE_UNSPECIFIED = 0;</code>
     */
    const RUNTIME_STATE_UNSPECIFIED = 0;
    /**
     * NotebookRuntime is in running state.
     *
     * Generated from protobuf enum <code>RUNNING = 1;</code>
     */
    const RUNNING = 1;
    /**
     * NotebookRuntime is in starting state.
     *
     * Generated from protobuf enum <code>BEING_STARTED = 2;</code>
     */
    const BEING_STARTED = 2;
    /**
     * NotebookRuntime is in stopping state.
     *
     * Generated from protobuf enum <code>BEING_STOPPED = 3;</code>
     */
    const BEING_STOPPED = 3;
    /**
     * NotebookRuntime is in stopped state.
     *
     * Generated from protobuf enum <code>STOPPED = 4;</code>
     */
    const STOPPED = 4;
    /**
     * NotebookRuntime is in upgrading state. It is in the middle of upgrading
     * process.
     *
     * Generated from protobuf enum <code>BEING_UPGRADED = 5;</code>
     */
    const BEING_UPGRADED = 5;
    /**
     * NotebookRuntime was unable to start/stop properly.
     *
     * Generated from protobuf enum <code>ERROR = 100;</code>
     */
    const ERROR = 100;
    /**
     * NotebookRuntime is in invalid state. Cannot be recovered.
     *
     * Generated from protobuf enum <code>INVALID = 101;</code>
     */
    const INVALID = 101;

    private static $valueToName = [
        self::RUNTIME_STATE_UNSPECIFIED => 'RUNTIME_STATE_UNSPECIFIED',
        self::RUNNING => 'RUNNING',
        self::BEING_STARTED => 'BEING_STARTED',
        self::BEING_STOPPED => 'BEING_STOPPED',
        self::STOPPED => 'STOPPED',
        self::BEING_UPGRADED => 'BEING_UPGRADED',
        self::ERROR => 'ERROR',
        self::INVALID => 'INVALID',
    ];

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


