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

namespace Google\Cloud\AutoMl\V1;

use UnexpectedValueException;

/**
 * Type of the classification problem.
 *
 * Protobuf type <code>google.cloud.automl.v1.ClassificationType</code>
 */
class ClassificationType
{
    /**
     * An un-set value of this enum.
     *
     * Generated from protobuf enum <code>CLASSIFICATION_TYPE_UNSPECIFIED = 0;</code>
     */
    const CLASSIFICATION_TYPE_UNSPECIFIED = 0;
    /**
     * At most one label is allowed per example.
     *
     * Generated from protobuf enum <code>MULTICLASS = 1;</code>
     */
    const MULTICLASS = 1;
    /**
     * Multiple labels are allowed for one example.
     *
     * Generated from protobuf enum <code>MULTILABEL = 2;</code>
     */
    const MULTILABEL = 2;

    private static $valueToName = [
        self::CLASSIFICATION_TYPE_UNSPECIFIED => 'CLASSIFICATION_TYPE_UNSPECIFIED',
        self::MULTICLASS => 'MULTICLASS',
        self::MULTILABEL => 'MULTILABEL',
    ];

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

