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

namespace Google\Cloud\NetworkManagement\V1\DeliverInfo;

use UnexpectedValueException;

/**
 * Deliver target types:
 *
 * Protobuf type <code>google.cloud.networkmanagement.v1.DeliverInfo.Target</code>
 */
class Target
{
    /**
     * Target not specified.
     *
     * Generated from protobuf enum <code>TARGET_UNSPECIFIED = 0;</code>
     */
    const TARGET_UNSPECIFIED = 0;
    /**
     * Target is a Compute Engine instance.
     *
     * Generated from protobuf enum <code>INSTANCE = 1;</code>
     */
    const INSTANCE = 1;
    /**
     * Target is the internet.
     *
     * Generated from protobuf enum <code>INTERNET = 2;</code>
     */
    const INTERNET = 2;
    /**
     * Target is a Google API.
     *
     * Generated from protobuf enum <code>GOOGLE_API = 3;</code>
     */
    const GOOGLE_API = 3;
    /**
     * Target is a Google Kubernetes Engine cluster master.
     *
     * Generated from protobuf enum <code>GKE_MASTER = 4;</code>
     */
    const GKE_MASTER = 4;
    /**
     * Target is a Cloud SQL instance.
     *
     * Generated from protobuf enum <code>CLOUD_SQL_INSTANCE = 5;</code>
     */
    const CLOUD_SQL_INSTANCE = 5;

    private static $valueToName = [
        self::TARGET_UNSPECIFIED => 'TARGET_UNSPECIFIED',
        self::INSTANCE => 'INSTANCE',
        self::INTERNET => 'INTERNET',
        self::GOOGLE_API => 'GOOGLE_API',
        self::GKE_MASTER => 'GKE_MASTER',
        self::CLOUD_SQL_INSTANCE => 'CLOUD_SQL_INSTANCE',
    ];

    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(Target::class, \Google\Cloud\NetworkManagement\V1\DeliverInfo_Target::class);

