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

namespace Google\Cloud\Sql\V1beta4;

use UnexpectedValueException;

/**
 * The suspension reason of the database instance if the state is SUSPENDED.
 *
 * Protobuf type <code>google.cloud.sql.v1beta4.SqlSuspensionReason</code>
 */
class SqlSuspensionReason
{
    /**
     * This is an unknown suspension reason.
     *
     * Generated from protobuf enum <code>SQL_SUSPENSION_REASON_UNSPECIFIED = 0;</code>
     */
    const SQL_SUSPENSION_REASON_UNSPECIFIED = 0;
    /**
     * The instance is suspended due to billing issues (for example:, GCP account
     * issue)
     *
     * Generated from protobuf enum <code>BILLING_ISSUE = 2;</code>
     */
    const BILLING_ISSUE = 2;
    /**
     * The instance is suspended due to illegal content (for example:, child
     * pornography, copyrighted material, etc.).
     *
     * Generated from protobuf enum <code>LEGAL_ISSUE = 3;</code>
     */
    const LEGAL_ISSUE = 3;
    /**
     * The instance is causing operational issues (for example:, causing the
     * database to crash).
     *
     * Generated from protobuf enum <code>OPERATIONAL_ISSUE = 4;</code>
     */
    const OPERATIONAL_ISSUE = 4;
    /**
     * The KMS key used by the instance is either revoked or denied access to
     *
     * Generated from protobuf enum <code>KMS_KEY_ISSUE = 5;</code>
     */
    const KMS_KEY_ISSUE = 5;

    private static $valueToName = [
        self::SQL_SUSPENSION_REASON_UNSPECIFIED => 'SQL_SUSPENSION_REASON_UNSPECIFIED',
        self::BILLING_ISSUE => 'BILLING_ISSUE',
        self::LEGAL_ISSUE => 'LEGAL_ISSUE',
        self::OPERATIONAL_ISSUE => 'OPERATIONAL_ISSUE',
        self::KMS_KEY_ISSUE => 'KMS_KEY_ISSUE',
    ];

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

