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

namespace Google\Analytics\Admin\V1alpha\ReportingIdentitySettings;

use UnexpectedValueException;

/**
 * Various strategies for identifying user identities in reports.
 *
 * Protobuf type <code>google.analytics.admin.v1alpha.ReportingIdentitySettings.ReportingIdentity</code>
 */
class ReportingIdentity
{
    /**
     * Unspecified blending strategy.
     *
     * Generated from protobuf enum <code>IDENTITY_BLENDING_STRATEGY_UNSPECIFIED = 0;</code>
     */
    const IDENTITY_BLENDING_STRATEGY_UNSPECIFIED = 0;
    /**
     * Blended reporting identity strategy.
     *
     * Generated from protobuf enum <code>BLENDED = 1;</code>
     */
    const BLENDED = 1;
    /**
     * Observed reporting identity strategy.
     *
     * Generated from protobuf enum <code>OBSERVED = 2;</code>
     */
    const OBSERVED = 2;
    /**
     * Device-based reporting identity strategy.
     *
     * Generated from protobuf enum <code>DEVICE_BASED = 3;</code>
     */
    const DEVICE_BASED = 3;

    private static $valueToName = [
        self::IDENTITY_BLENDING_STRATEGY_UNSPECIFIED => 'IDENTITY_BLENDING_STRATEGY_UNSPECIFIED',
        self::BLENDED => 'BLENDED',
        self::OBSERVED => 'OBSERVED',
        self::DEVICE_BASED => 'DEVICE_BASED',
    ];

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


