<?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;

/**
 * The underlying shared asset type shared in a listing by a publisher.
 *
 * Protobuf type <code>google.cloud.bigquery.analyticshub.v1.SharedResourceType</code>
 */
class SharedResourceType
{
    /**
     * Not specified.
     *
     * Generated from protobuf enum <code>SHARED_RESOURCE_TYPE_UNSPECIFIED = 0;</code>
     */
    const SHARED_RESOURCE_TYPE_UNSPECIFIED = 0;
    /**
     * BigQuery Dataset Asset.
     *
     * Generated from protobuf enum <code>BIGQUERY_DATASET = 1;</code>
     */
    const BIGQUERY_DATASET = 1;
    /**
     * Pub/Sub Topic Asset.
     *
     * Generated from protobuf enum <code>PUBSUB_TOPIC = 2;</code>
     */
    const PUBSUB_TOPIC = 2;

    private static $valueToName = [
        self::SHARED_RESOURCE_TYPE_UNSPECIFIED => 'SHARED_RESOURCE_TYPE_UNSPECIFIED',
        self::BIGQUERY_DATASET => 'BIGQUERY_DATASET',
        self::PUBSUB_TOPIC => 'PUBSUB_TOPIC',
    ];

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

