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

namespace Google\Cloud\NetworkServices\V1;

use UnexpectedValueException;

/**
 * EnvoyHeader configuration for Mesh and Gateway
 *
 * Protobuf type <code>google.cloud.networkservices.v1.EnvoyHeaders</code>
 */
class EnvoyHeaders
{
    /**
     * Defaults to NONE.
     *
     * Generated from protobuf enum <code>ENVOY_HEADERS_UNSPECIFIED = 0;</code>
     */
    const ENVOY_HEADERS_UNSPECIFIED = 0;
    /**
     * Suppress envoy debug headers.
     *
     * Generated from protobuf enum <code>NONE = 1;</code>
     */
    const NONE = 1;
    /**
     * Envoy will insert default internal debug headers into upstream requests:
     * x-envoy-attempt-count
     * x-envoy-is-timeout-retry
     * x-envoy-expected-rq-timeout-ms
     * x-envoy-original-path
     * x-envoy-upstream-stream-duration-ms
     *
     * Generated from protobuf enum <code>DEBUG_HEADERS = 2;</code>
     */
    const DEBUG_HEADERS = 2;

    private static $valueToName = [
        self::ENVOY_HEADERS_UNSPECIFIED => 'ENVOY_HEADERS_UNSPECIFIED',
        self::NONE => 'NONE',
        self::DEBUG_HEADERS => 'DEBUG_HEADERS',
    ];

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

