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

namespace Google\Cloud\Dataplex\V1\EntryLink\EntryReference;

use UnexpectedValueException;

/**
 * Reference type of the Entry.
 *
 * Protobuf type <code>google.cloud.dataplex.v1.EntryLink.EntryReference.Type</code>
 */
class Type
{
    /**
     * Unspecified reference type. Implies that the Entry is referenced
     * in a non-directional Entry Link.
     *
     * Generated from protobuf enum <code>UNSPECIFIED = 0;</code>
     */
    const UNSPECIFIED = 0;
    /**
     * The Entry is referenced as the source of the directional Entry Link.
     *
     * Generated from protobuf enum <code>SOURCE = 2;</code>
     */
    const SOURCE = 2;
    /**
     * The Entry is referenced as the target of the directional Entry Link.
     *
     * Generated from protobuf enum <code>TARGET = 3;</code>
     */
    const TARGET = 3;

    private static $valueToName = [
        self::UNSPECIFIED => 'UNSPECIFIED',
        self::SOURCE => 'SOURCE',
        self::TARGET => 'TARGET',
    ];

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


