<?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 health information.
 *
 * Protobuf type <code>google.cloud.aiplatform.v1.NotebookRuntime.HealthState</code>
 */
class HealthState
{
    /**
     * Unspecified health state.
     *
     * Generated from protobuf enum <code>HEALTH_STATE_UNSPECIFIED = 0;</code>
     */
    const HEALTH_STATE_UNSPECIFIED = 0;
    /**
     * NotebookRuntime is in healthy state. Applies to ACTIVE state.
     *
     * Generated from protobuf enum <code>HEALTHY = 1;</code>
     */
    const HEALTHY = 1;
    /**
     * NotebookRuntime is in unhealthy state. Applies to ACTIVE state.
     *
     * Generated from protobuf enum <code>UNHEALTHY = 2;</code>
     */
    const UNHEALTHY = 2;

    private static $valueToName = [
        self::HEALTH_STATE_UNSPECIFIED => 'HEALTH_STATE_UNSPECIFIED',
        self::HEALTHY => 'HEALTHY',
        self::UNHEALTHY => 'UNHEALTHY',
    ];

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


