<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/container/v1/cluster_service.proto

namespace Google\Cloud\Container\V1\DatabaseEncryption;

use UnexpectedValueException;

/**
 * State of etcd encryption.
 *
 * Protobuf type <code>google.container.v1.DatabaseEncryption.State</code>
 */
class State
{
    /**
     * Should never be set
     *
     * Generated from protobuf enum <code>UNKNOWN = 0;</code>
     */
    const UNKNOWN = 0;
    /**
     * Secrets in etcd are encrypted.
     *
     * Generated from protobuf enum <code>ENCRYPTED = 1;</code>
     */
    const ENCRYPTED = 1;
    /**
     * Secrets in etcd are stored in plain text (at etcd level) - this is
     * unrelated to Compute Engine level full disk encryption.
     *
     * Generated from protobuf enum <code>DECRYPTED = 2;</code>
     */
    const DECRYPTED = 2;

    private static $valueToName = [
        self::UNKNOWN => 'UNKNOWN',
        self::ENCRYPTED => 'ENCRYPTED',
        self::DECRYPTED => 'DECRYPTED',
    ];

    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(State::class, \Google\Cloud\Container\V1\DatabaseEncryption_State::class);

