<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/talent/v4beta1/tenant.proto

namespace Google\Cloud\Talent\V4beta1\Tenant;

use UnexpectedValueException;

/**
 * Enum that represents how user data owned by the tenant is used.
 *
 * Protobuf type <code>google.cloud.talent.v4beta1.Tenant.DataUsageType</code>
 */
class DataUsageType
{
    /**
     * Default value.
     *
     * Generated from protobuf enum <code>DATA_USAGE_TYPE_UNSPECIFIED = 0;</code>
     */
    const DATA_USAGE_TYPE_UNSPECIFIED = 0;
    /**
     * Data owned by this tenant is used to improve search/recommendation
     * quality across tenants.
     *
     * Generated from protobuf enum <code>AGGREGATED = 1;</code>
     */
    const AGGREGATED = 1;
    /**
     * Data owned by this tenant is used to improve search/recommendation
     * quality for this tenant only.
     *
     * Generated from protobuf enum <code>ISOLATED = 2;</code>
     */
    const ISOLATED = 2;

    private static $valueToName = [
        self::DATA_USAGE_TYPE_UNSPECIFIED => 'DATA_USAGE_TYPE_UNSPECIFIED',
        self::AGGREGATED => 'AGGREGATED',
        self::ISOLATED => 'ISOLATED',
    ];

    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(DataUsageType::class, \Google\Cloud\Talent\V4beta1\Tenant_DataUsageType::class);

