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

namespace Google\Cloud\StorageTransfer\V1\MetadataOptions;

use UnexpectedValueException;

/**
 * Options for handling the KmsKey setting for Google Cloud Storage objects.
 *
 * Protobuf type <code>google.storagetransfer.v1.MetadataOptions.KmsKey</code>
 */
class KmsKey
{
    /**
     * KmsKey behavior is unspecified.
     *
     * Generated from protobuf enum <code>KMS_KEY_UNSPECIFIED = 0;</code>
     */
    const KMS_KEY_UNSPECIFIED = 0;
    /**
     * Use the destination bucket's default encryption settings.
     *
     * Generated from protobuf enum <code>KMS_KEY_DESTINATION_BUCKET_DEFAULT = 1;</code>
     */
    const KMS_KEY_DESTINATION_BUCKET_DEFAULT = 1;
    /**
     * Preserve the object's original Cloud KMS customer-managed encryption key
     * (CMEK) if present. Objects that do not use a Cloud KMS encryption key
     * will be encrypted using the destination bucket's encryption settings.
     *
     * Generated from protobuf enum <code>KMS_KEY_PRESERVE = 2;</code>
     */
    const KMS_KEY_PRESERVE = 2;

    private static $valueToName = [
        self::KMS_KEY_UNSPECIFIED => 'KMS_KEY_UNSPECIFIED',
        self::KMS_KEY_DESTINATION_BUCKET_DEFAULT => 'KMS_KEY_DESTINATION_BUCKET_DEFAULT',
        self::KMS_KEY_PRESERVE => 'KMS_KEY_PRESERVE',
    ];

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


