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

namespace Google\Cloud\DataCatalog\V1;

use UnexpectedValueException;

/**
 * The different types of resources that can be returned in search.
 *
 * Protobuf type <code>google.cloud.datacatalog.v1.SearchResultType</code>
 */
class SearchResultType
{
    /**
     * Default unknown type.
     *
     * Generated from protobuf enum <code>SEARCH_RESULT_TYPE_UNSPECIFIED = 0;</code>
     */
    const SEARCH_RESULT_TYPE_UNSPECIFIED = 0;
    /**
     * An [Entry][google.cloud.datacatalog.v1.Entry].
     *
     * Generated from protobuf enum <code>ENTRY = 1;</code>
     */
    const ENTRY = 1;
    /**
     * A [TagTemplate][google.cloud.datacatalog.v1.TagTemplate].
     *
     * Generated from protobuf enum <code>TAG_TEMPLATE = 2;</code>
     */
    const TAG_TEMPLATE = 2;
    /**
     * An [EntryGroup][google.cloud.datacatalog.v1.EntryGroup].
     *
     * Generated from protobuf enum <code>ENTRY_GROUP = 3;</code>
     */
    const ENTRY_GROUP = 3;

    private static $valueToName = [
        self::SEARCH_RESULT_TYPE_UNSPECIFIED => 'SEARCH_RESULT_TYPE_UNSPECIFIED',
        self::ENTRY => 'ENTRY',
        self::TAG_TEMPLATE => 'TAG_TEMPLATE',
        self::ENTRY_GROUP => 'ENTRY_GROUP',
    ];

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

