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

namespace Google\Cloud\ApiHub\V1\Dependency;

use UnexpectedValueException;

/**
 * Possible modes of discovering the dependency.
 *
 * Protobuf type <code>google.cloud.apihub.v1.Dependency.DiscoveryMode</code>
 */
class DiscoveryMode
{
    /**
     * Default value. This value is unused.
     *
     * Generated from protobuf enum <code>DISCOVERY_MODE_UNSPECIFIED = 0;</code>
     */
    const DISCOVERY_MODE_UNSPECIFIED = 0;
    /**
     * Manual mode of discovery when the dependency is defined by the user.
     *
     * Generated from protobuf enum <code>MANUAL = 1;</code>
     */
    const MANUAL = 1;

    private static $valueToName = [
        self::DISCOVERY_MODE_UNSPECIFIED => 'DISCOVERY_MODE_UNSPECIFIED',
        self::MANUAL => 'MANUAL',
    ];

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


