<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/analytics/admin/v1alpha/resources.proto

namespace Google\Analytics\Admin\V1alpha\CustomMetric;

use UnexpectedValueException;

/**
 * Labels that mark the data in this custom metric as data that should be
 * restricted to specific users.
 *
 * Protobuf type <code>google.analytics.admin.v1alpha.CustomMetric.RestrictedMetricType</code>
 */
class RestrictedMetricType
{
    /**
     * Type unknown or unspecified.
     *
     * Generated from protobuf enum <code>RESTRICTED_METRIC_TYPE_UNSPECIFIED = 0;</code>
     */
    const RESTRICTED_METRIC_TYPE_UNSPECIFIED = 0;
    /**
     * Metric reports cost data.
     *
     * Generated from protobuf enum <code>COST_DATA = 1;</code>
     */
    const COST_DATA = 1;
    /**
     * Metric reports revenue data.
     *
     * Generated from protobuf enum <code>REVENUE_DATA = 2;</code>
     */
    const REVENUE_DATA = 2;

    private static $valueToName = [
        self::RESTRICTED_METRIC_TYPE_UNSPECIFIED => 'RESTRICTED_METRIC_TYPE_UNSPECIFIED',
        self::COST_DATA => 'COST_DATA',
        self::REVENUE_DATA => 'REVENUE_DATA',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(RestrictedMetricType::class, \Google\Analytics\Admin\V1alpha\CustomMetric_RestrictedMetricType::class);

