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

namespace Google\Cloud\Memorystore\V1\Instance;

use UnexpectedValueException;

/**
 * Possible authorization modes of the instance.
 *
 * Protobuf type <code>google.cloud.memorystore.v1.Instance.AuthorizationMode</code>
 */
class AuthorizationMode
{
    /**
     * Not set.
     *
     * Generated from protobuf enum <code>AUTHORIZATION_MODE_UNSPECIFIED = 0;</code>
     */
    const AUTHORIZATION_MODE_UNSPECIFIED = 0;
    /**
     * Authorization disabled.
     *
     * Generated from protobuf enum <code>AUTH_DISABLED = 1;</code>
     */
    const AUTH_DISABLED = 1;
    /**
     * IAM basic authorization.
     *
     * Generated from protobuf enum <code>IAM_AUTH = 2;</code>
     */
    const IAM_AUTH = 2;

    private static $valueToName = [
        self::AUTHORIZATION_MODE_UNSPECIFIED => 'AUTHORIZATION_MODE_UNSPECIFIED',
        self::AUTH_DISABLED => 'AUTH_DISABLED',
        self::IAM_AUTH => 'IAM_AUTH',
    ];

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


