<?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 in-transit encryption modes of the instance.
 *
 * Protobuf type <code>google.cloud.memorystore.v1.Instance.TransitEncryptionMode</code>
 */
class TransitEncryptionMode
{
    /**
     * Not set.
     *
     * Generated from protobuf enum <code>TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0;</code>
     */
    const TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0;
    /**
     * In-transit encryption is disabled.
     *
     * Generated from protobuf enum <code>TRANSIT_ENCRYPTION_DISABLED = 1;</code>
     */
    const TRANSIT_ENCRYPTION_DISABLED = 1;
    /**
     * Server-managed encryption is used for in-transit encryption.
     *
     * Generated from protobuf enum <code>SERVER_AUTHENTICATION = 2;</code>
     */
    const SERVER_AUTHENTICATION = 2;

    private static $valueToName = [
        self::TRANSIT_ENCRYPTION_MODE_UNSPECIFIED => 'TRANSIT_ENCRYPTION_MODE_UNSPECIFIED',
        self::TRANSIT_ENCRYPTION_DISABLED => 'TRANSIT_ENCRYPTION_DISABLED',
        self::SERVER_AUTHENTICATION => 'SERVER_AUTHENTICATION',
    ];

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


