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

namespace Google\Cloud\Redis\Cluster\V1\EncryptionInfo;

use UnexpectedValueException;

/**
 * The state of the KMS key perceived by the system. Refer to the public
 * documentation for the impact of each state.
 *
 * Protobuf type <code>google.cloud.redis.cluster.v1.EncryptionInfo.KmsKeyState</code>
 */
class KmsKeyState
{
    /**
     * The default value. This value is unused.
     *
     * Generated from protobuf enum <code>KMS_KEY_STATE_UNSPECIFIED = 0;</code>
     */
    const KMS_KEY_STATE_UNSPECIFIED = 0;
    /**
     * The KMS key is enabled and correctly configured.
     *
     * Generated from protobuf enum <code>ENABLED = 1;</code>
     */
    const ENABLED = 1;
    /**
     * Permission denied on the KMS key.
     *
     * Generated from protobuf enum <code>PERMISSION_DENIED = 2;</code>
     */
    const PERMISSION_DENIED = 2;
    /**
     * The KMS key is disabled.
     *
     * Generated from protobuf enum <code>DISABLED = 3;</code>
     */
    const DISABLED = 3;
    /**
     * The KMS key is destroyed.
     *
     * Generated from protobuf enum <code>DESTROYED = 4;</code>
     */
    const DESTROYED = 4;
    /**
     * The KMS key is scheduled to be destroyed.
     *
     * Generated from protobuf enum <code>DESTROY_SCHEDULED = 5;</code>
     */
    const DESTROY_SCHEDULED = 5;
    /**
     * The EKM key is unreachable.
     *
     * Generated from protobuf enum <code>EKM_KEY_UNREACHABLE_DETECTED = 6;</code>
     */
    const EKM_KEY_UNREACHABLE_DETECTED = 6;
    /**
     * Billing is disabled for the project.
     *
     * Generated from protobuf enum <code>BILLING_DISABLED = 7;</code>
     */
    const BILLING_DISABLED = 7;
    /**
     * All other unknown failures.
     *
     * Generated from protobuf enum <code>UNKNOWN_FAILURE = 8;</code>
     */
    const UNKNOWN_FAILURE = 8;

    private static $valueToName = [
        self::KMS_KEY_STATE_UNSPECIFIED => 'KMS_KEY_STATE_UNSPECIFIED',
        self::ENABLED => 'ENABLED',
        self::PERMISSION_DENIED => 'PERMISSION_DENIED',
        self::DISABLED => 'DISABLED',
        self::DESTROYED => 'DESTROYED',
        self::DESTROY_SCHEDULED => 'DESTROY_SCHEDULED',
        self::EKM_KEY_UNREACHABLE_DETECTED => 'EKM_KEY_UNREACHABLE_DETECTED',
        self::BILLING_DISABLED => 'BILLING_DISABLED',
        self::UNKNOWN_FAILURE => 'UNKNOWN_FAILURE',
    ];

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


