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

namespace Google\Cloud\NetworkServices\V1;

use UnexpectedValueException;

/**
 * The format of communication supported by the extension.
 *
 * Protobuf type <code>google.cloud.networkservices.v1.WireFormat</code>
 */
class WireFormat
{
    /**
     * Not specified.
     *
     * Generated from protobuf enum <code>WIRE_FORMAT_UNSPECIFIED = 0;</code>
     */
    const WIRE_FORMAT_UNSPECIFIED = 0;
    /**
     * The extension service uses ext_proc gRPC API over a gRPC stream. This is
     * the default value if the wire format is not specified. The backend service
     * for the extension must use HTTP2 or H2C as the protocol. All
     * `supported_events` for a client request are sent as part of the same
     * gRPC stream.
     *
     * Generated from protobuf enum <code>EXT_PROC_GRPC = 1;</code>
     */
    const EXT_PROC_GRPC = 1;

    private static $valueToName = [
        self::WIRE_FORMAT_UNSPECIFIED => 'WIRE_FORMAT_UNSPECIFIED',
        self::EXT_PROC_GRPC => 'EXT_PROC_GRPC',
    ];

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

