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

namespace Google\Analytics\Admin\V1alpha\CustomDimension;

use UnexpectedValueException;

/**
 * Valid values for the scope of this dimension.
 *
 * Protobuf type <code>google.analytics.admin.v1alpha.CustomDimension.DimensionScope</code>
 */
class DimensionScope
{
    /**
     * Scope unknown or not specified.
     *
     * Generated from protobuf enum <code>DIMENSION_SCOPE_UNSPECIFIED = 0;</code>
     */
    const DIMENSION_SCOPE_UNSPECIFIED = 0;
    /**
     * Dimension scoped to an event.
     *
     * Generated from protobuf enum <code>EVENT = 1;</code>
     */
    const EVENT = 1;
    /**
     * Dimension scoped to a user.
     *
     * Generated from protobuf enum <code>USER = 2;</code>
     */
    const USER = 2;

    private static $valueToName = [
        self::DIMENSION_SCOPE_UNSPECIFIED => 'DIMENSION_SCOPE_UNSPECIFIED',
        self::EVENT => 'EVENT',
        self::USER => 'USER',
    ];

    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(DimensionScope::class, \Google\Analytics\Admin\V1alpha\CustomDimension_DimensionScope::class);

