<?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 relationship between the action that a verb expresses and the
 * participants identified by its arguments.
 *
 * Protobuf type <code>google.cloud.language.v1.PartOfSpeech.Voice</code>
 */
class Voice
{
    /**
     * Voice is not applicable in the analyzed language or is not predicted.
     *
     * Generated from protobuf enum <code>VOICE_UNKNOWN = 0;</code>
     */
    const VOICE_UNKNOWN = 0;
    /**
     * Active
     *
     * Generated from protobuf enum <code>ACTIVE = 1;</code>
     */
    const ACTIVE = 1;
    /**
     * Causative
     *
     * Generated from protobuf enum <code>CAUSATIVE = 2;</code>
     */
    const CAUSATIVE = 2;
    /**
     * Passive
     *
     * Generated from protobuf enum <code>PASSIVE = 3;</code>
     */
    const PASSIVE = 3;

    private static $valueToName = [
        self::VOICE_UNKNOWN => 'VOICE_UNKNOWN',
        self::ACTIVE => 'ACTIVE',
        self::CAUSATIVE => 'CAUSATIVE',
        self::PASSIVE => 'PASSIVE',
    ];

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


