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

namespace Google\Cloud\StorageTransfer\V1\S3CompatibleMetadata;

use UnexpectedValueException;

/**
 * The authentication and authorization method used by the storage service.
 *
 * Protobuf type <code>google.storagetransfer.v1.S3CompatibleMetadata.AuthMethod</code>
 */
class AuthMethod
{
    /**
     * AuthMethod is not specified.
     *
     * Generated from protobuf enum <code>AUTH_METHOD_UNSPECIFIED = 0;</code>
     */
    const AUTH_METHOD_UNSPECIFIED = 0;
    /**
     * Auth requests with AWS SigV4.
     *
     * Generated from protobuf enum <code>AUTH_METHOD_AWS_SIGNATURE_V4 = 1;</code>
     */
    const AUTH_METHOD_AWS_SIGNATURE_V4 = 1;
    /**
     * Auth requests with AWS SigV2.
     *
     * Generated from protobuf enum <code>AUTH_METHOD_AWS_SIGNATURE_V2 = 2;</code>
     */
    const AUTH_METHOD_AWS_SIGNATURE_V2 = 2;

    private static $valueToName = [
        self::AUTH_METHOD_UNSPECIFIED => 'AUTH_METHOD_UNSPECIFIED',
        self::AUTH_METHOD_AWS_SIGNATURE_V4 => 'AUTH_METHOD_AWS_SIGNATURE_V4',
        self::AUTH_METHOD_AWS_SIGNATURE_V2 => 'AUTH_METHOD_AWS_SIGNATURE_V2',
    ];

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


