<?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;

use UnexpectedValueException;

/**
 * Available authorization mode of a Redis cluster.
 *
 * Protobuf type <code>google.cloud.redis.cluster.v1.AuthorizationMode</code>
 */
class AuthorizationMode
{
    /**
     * Not set.
     *
     * Generated from protobuf enum <code>AUTH_MODE_UNSPECIFIED = 0;</code>
     */
    const AUTH_MODE_UNSPECIFIED = 0;
    /**
     * IAM basic authorization mode
     *
     * Generated from protobuf enum <code>AUTH_MODE_IAM_AUTH = 1;</code>
     */
    const AUTH_MODE_IAM_AUTH = 1;
    /**
     * Authorization disabled mode
     *
     * Generated from protobuf enum <code>AUTH_MODE_DISABLED = 2;</code>
     */
    const AUTH_MODE_DISABLED = 2;

    private static $valueToName = [
        self::AUTH_MODE_UNSPECIFIED => 'AUTH_MODE_UNSPECIFIED',
        self::AUTH_MODE_IAM_AUTH => 'AUTH_MODE_IAM_AUTH',
        self::AUTH_MODE_DISABLED => 'AUTH_MODE_DISABLED',
    ];

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

