<?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 agent network protocol to access the storage service.
 *
 * Protobuf type <code>google.storagetransfer.v1.S3CompatibleMetadata.NetworkProtocol</code>
 */
class NetworkProtocol
{
    /**
     * NetworkProtocol is not specified.
     *
     * Generated from protobuf enum <code>NETWORK_PROTOCOL_UNSPECIFIED = 0;</code>
     */
    const NETWORK_PROTOCOL_UNSPECIFIED = 0;
    /**
     * Perform requests using HTTPS.
     *
     * Generated from protobuf enum <code>NETWORK_PROTOCOL_HTTPS = 1;</code>
     */
    const NETWORK_PROTOCOL_HTTPS = 1;
    /**
     * Not recommended: This sends data in clear-text. This is only
     * appropriate within a closed network or for publicly available data.
     * Perform requests using HTTP.
     *
     * Generated from protobuf enum <code>NETWORK_PROTOCOL_HTTP = 2;</code>
     */
    const NETWORK_PROTOCOL_HTTP = 2;

    private static $valueToName = [
        self::NETWORK_PROTOCOL_UNSPECIFIED => 'NETWORK_PROTOCOL_UNSPECIFIED',
        self::NETWORK_PROTOCOL_HTTPS => 'NETWORK_PROTOCOL_HTTPS',
        self::NETWORK_PROTOCOL_HTTP => 'NETWORK_PROTOCOL_HTTP',
    ];

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


