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

namespace Google\Cloud\BigQuery\AnalyticsHub\V1;

use UnexpectedValueException;

/**
 * Specifies the type of discovery on the discovery page. Note that
 * this does not control the visibility of the exchange/listing which is
 * defined by IAM permission.
 *
 * Protobuf type <code>google.cloud.bigquery.analyticshub.v1.DiscoveryType</code>
 */
class DiscoveryType
{
    /**
     * Unspecified. Defaults to DISCOVERY_TYPE_PRIVATE.
     *
     * Generated from protobuf enum <code>DISCOVERY_TYPE_UNSPECIFIED = 0;</code>
     */
    const DISCOVERY_TYPE_UNSPECIFIED = 0;
    /**
     * The Data exchange/listing can be discovered in the 'Private' results
     * list.
     *
     * Generated from protobuf enum <code>DISCOVERY_TYPE_PRIVATE = 1;</code>
     */
    const DISCOVERY_TYPE_PRIVATE = 1;
    /**
     * The Data exchange/listing can be discovered in the 'Public' results
     * list.
     *
     * Generated from protobuf enum <code>DISCOVERY_TYPE_PUBLIC = 2;</code>
     */
    const DISCOVERY_TYPE_PUBLIC = 2;

    private static $valueToName = [
        self::DISCOVERY_TYPE_UNSPECIFIED => 'DISCOVERY_TYPE_UNSPECIFIED',
        self::DISCOVERY_TYPE_PRIVATE => 'DISCOVERY_TYPE_PRIVATE',
        self::DISCOVERY_TYPE_PUBLIC => 'DISCOVERY_TYPE_PUBLIC',
    ];

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

