<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/notebooks/v2/instance.proto

namespace Google\Cloud\Notebooks\V2;

use UnexpectedValueException;

/**
 * The definition of the states of this instance.
 *
 * Protobuf type <code>google.cloud.notebooks.v2.State</code>
 */
class State
{
    /**
     * State is not specified.
     *
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
     */
    const STATE_UNSPECIFIED = 0;
    /**
     * The control logic is starting the instance.
     *
     * Generated from protobuf enum <code>STARTING = 1;</code>
     */
    const STARTING = 1;
    /**
     * The control logic is installing required frameworks and registering the
     * instance with notebook proxy
     *
     * Generated from protobuf enum <code>PROVISIONING = 2;</code>
     */
    const PROVISIONING = 2;
    /**
     * The instance is running.
     *
     * Generated from protobuf enum <code>ACTIVE = 3;</code>
     */
    const ACTIVE = 3;
    /**
     * The control logic is stopping the instance.
     *
     * Generated from protobuf enum <code>STOPPING = 4;</code>
     */
    const STOPPING = 4;
    /**
     * The instance is stopped.
     *
     * Generated from protobuf enum <code>STOPPED = 5;</code>
     */
    const STOPPED = 5;
    /**
     * The instance is deleted.
     *
     * Generated from protobuf enum <code>DELETED = 6;</code>
     */
    const DELETED = 6;
    /**
     * The instance is upgrading.
     *
     * Generated from protobuf enum <code>UPGRADING = 7;</code>
     */
    const UPGRADING = 7;
    /**
     * The instance is being created.
     *
     * Generated from protobuf enum <code>INITIALIZING = 8;</code>
     */
    const INITIALIZING = 8;
    /**
     * The instance is suspending.
     *
     * Generated from protobuf enum <code>SUSPENDING = 9;</code>
     */
    const SUSPENDING = 9;
    /**
     * The instance is suspended.
     *
     * Generated from protobuf enum <code>SUSPENDED = 10;</code>
     */
    const SUSPENDED = 10;

    private static $valueToName = [
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::STARTING => 'STARTING',
        self::PROVISIONING => 'PROVISIONING',
        self::ACTIVE => 'ACTIVE',
        self::STOPPING => 'STOPPING',
        self::STOPPED => 'STOPPED',
        self::DELETED => 'DELETED',
        self::UPGRADING => 'UPGRADING',
        self::INITIALIZING => 'INITIALIZING',
        self::SUSPENDING => 'SUSPENDING',
        self::SUSPENDED => 'SUSPENDED',
    ];

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

