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

namespace Google\Cloud\NetworkManagement\V1\Endpoint;

use UnexpectedValueException;

/**
 * The type definition of an endpoint's network. Use one of the
 * following choices:
 *
 * Protobuf type <code>google.cloud.networkmanagement.v1.Endpoint.NetworkType</code>
 */
class NetworkType
{
    /**
     * Default type if unspecified.
     *
     * Generated from protobuf enum <code>NETWORK_TYPE_UNSPECIFIED = 0;</code>
     */
    const NETWORK_TYPE_UNSPECIFIED = 0;
    /**
     * A network hosted within Google Cloud Platform.
     * To receive more detailed output, specify the URI for the source or
     * destination network.
     *
     * Generated from protobuf enum <code>GCP_NETWORK = 1;</code>
     */
    const GCP_NETWORK = 1;
    /**
     * A network hosted outside of Google Cloud Platform.
     * This can be an on-premises network, or a network hosted by another cloud
     * provider.
     *
     * Generated from protobuf enum <code>NON_GCP_NETWORK = 2;</code>
     */
    const NON_GCP_NETWORK = 2;

    private static $valueToName = [
        self::NETWORK_TYPE_UNSPECIFIED => 'NETWORK_TYPE_UNSPECIFIED',
        self::GCP_NETWORK => 'GCP_NETWORK',
        self::NON_GCP_NETWORK => 'NON_GCP_NETWORK',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(NetworkType::class, \Google\Cloud\NetworkManagement\V1\Endpoint_NetworkType::class);

