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

namespace Google\Ads\DataManager\V1\AwsWrappedKeyInfo;

use UnexpectedValueException;

/**
 * The type of algorithm used to encrypt the data.
 *
 * Protobuf type <code>google.ads.datamanager.v1.AwsWrappedKeyInfo.KeyType</code>
 */
class KeyType
{
    /**
     * Unspecified key type. Should never be used.
     *
     * Generated from protobuf enum <code>KEY_TYPE_UNSPECIFIED = 0;</code>
     */
    const KEY_TYPE_UNSPECIFIED = 0;
    /**
     * Algorithm XChaCha20-Poly1305
     *
     * Generated from protobuf enum <code>XCHACHA20_POLY1305 = 1;</code>
     */
    const XCHACHA20_POLY1305 = 1;

    private static $valueToName = [
        self::KEY_TYPE_UNSPECIFIED => 'KEY_TYPE_UNSPECIFIED',
        self::XCHACHA20_POLY1305 => 'XCHACHA20_POLY1305',
    ];

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

