<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/language/v1/language_service.proto

namespace Google\Cloud\Language\V1\PartOfSpeech;

use UnexpectedValueException;

/**
 * The characteristic of a verb that expresses time flow during an event.
 *
 * Protobuf type <code>google.cloud.language.v1.PartOfSpeech.Aspect</code>
 */
class Aspect
{
    /**
     * Aspect is not applicable in the analyzed language or is not predicted.
     *
     * Generated from protobuf enum <code>ASPECT_UNKNOWN = 0;</code>
     */
    const ASPECT_UNKNOWN = 0;
    /**
     * Perfective
     *
     * Generated from protobuf enum <code>PERFECTIVE = 1;</code>
     */
    const PERFECTIVE = 1;
    /**
     * Imperfective
     *
     * Generated from protobuf enum <code>IMPERFECTIVE = 2;</code>
     */
    const IMPERFECTIVE = 2;
    /**
     * Progressive
     *
     * Generated from protobuf enum <code>PROGRESSIVE = 3;</code>
     */
    const PROGRESSIVE = 3;

    private static $valueToName = [
        self::ASPECT_UNKNOWN => 'ASPECT_UNKNOWN',
        self::PERFECTIVE => 'PERFECTIVE',
        self::IMPERFECTIVE => 'IMPERFECTIVE',
        self::PROGRESSIVE => 'PROGRESSIVE',
    ];

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


