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

namespace Google\Analytics\Data\V1alpha;

use UnexpectedValueException;

/**
 * Categories of data that you may be restricted from viewing on certain
 * Google Analytics properties.
 *
 * Protobuf type <code>google.analytics.data.v1alpha.RestrictedMetricType</code>
 */
class RestrictedMetricType
{
    /**
     * Unspecified type.
     *
     * Generated from protobuf enum <code>RESTRICTED_METRIC_TYPE_UNSPECIFIED = 0;</code>
     */
    const RESTRICTED_METRIC_TYPE_UNSPECIFIED = 0;
    /**
     * Cost metrics such as `adCost`.
     *
     * Generated from protobuf enum <code>COST_DATA = 1;</code>
     */
    const COST_DATA = 1;
    /**
     * Revenue metrics such as `purchaseRevenue`.
     *
     * 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);
    }
}

