<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/datalabeling/v1beta1/data_labeling_service.proto

namespace Google\Cloud\DataLabeling\V1beta1\LabelTextRequest;

use UnexpectedValueException;

/**
 * Text labeling task feature.
 *
 * Protobuf type <code>google.cloud.datalabeling.v1beta1.LabelTextRequest.Feature</code>
 */
class Feature
{
    /**
     * Generated from protobuf enum <code>FEATURE_UNSPECIFIED = 0;</code>
     */
    const FEATURE_UNSPECIFIED = 0;
    /**
     * Label text content to one of more labels.
     *
     * Generated from protobuf enum <code>TEXT_CLASSIFICATION = 1;</code>
     */
    const TEXT_CLASSIFICATION = 1;
    /**
     * Label entities and their span in text.
     *
     * Generated from protobuf enum <code>TEXT_ENTITY_EXTRACTION = 2;</code>
     */
    const TEXT_ENTITY_EXTRACTION = 2;

    private static $valueToName = [
        self::FEATURE_UNSPECIFIED => 'FEATURE_UNSPECIFIED',
        self::TEXT_CLASSIFICATION => 'TEXT_CLASSIFICATION',
        self::TEXT_ENTITY_EXTRACTION => 'TEXT_ENTITY_EXTRACTION',
    ];

    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(Feature::class, \Google\Cloud\DataLabeling\V1beta1\LabelTextRequest_Feature::class);

