<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/sql/v1beta4/cloud_sql_resources.proto

namespace Google\Cloud\Sql\V1beta4\DatabaseInstance\SqlOutOfDiskReport;

use UnexpectedValueException;

/**
 * This enum lists all possible states regarding out-of-disk issues.
 *
 * Protobuf type <code>google.cloud.sql.v1beta4.DatabaseInstance.SqlOutOfDiskReport.SqlOutOfDiskState</code>
 */
class SqlOutOfDiskState
{
    /**
     * Unspecified state
     *
     * Generated from protobuf enum <code>SQL_OUT_OF_DISK_STATE_UNSPECIFIED = 0;</code>
     */
    const SQL_OUT_OF_DISK_STATE_UNSPECIFIED = 0;
    /**
     * The instance has plenty space on data disk
     *
     * Generated from protobuf enum <code>NORMAL = 1;</code>
     */
    const NORMAL = 1;
    /**
     * Data disk is almost used up. It is shutdown to prevent data
     * corruption.
     *
     * Generated from protobuf enum <code>SOFT_SHUTDOWN = 2;</code>
     */
    const SOFT_SHUTDOWN = 2;

    private static $valueToName = [
        self::SQL_OUT_OF_DISK_STATE_UNSPECIFIED => 'SQL_OUT_OF_DISK_STATE_UNSPECIFIED',
        self::NORMAL => 'NORMAL',
        self::SOFT_SHUTDOWN => 'SOFT_SHUTDOWN',
    ];

    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(SqlOutOfDiskState::class, \Google\Cloud\Sql\V1beta4\DatabaseInstance_SqlOutOfDiskReport_SqlOutOfDiskState::class);

