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

namespace Google\Cloud\ApiHub\V1\DiscoveredApiOperation;

use UnexpectedValueException;

/**
 * The classification of the discovered API operation.
 *
 * Protobuf type <code>google.cloud.apihub.v1.DiscoveredApiOperation.Classification</code>
 */
class Classification
{
    /**
     * Operation is not classified as known or unknown.
     *
     * Generated from protobuf enum <code>CLASSIFICATION_UNSPECIFIED = 0;</code>
     */
    const CLASSIFICATION_UNSPECIFIED = 0;
    /**
     * Operation has a matched catalog operation.
     *
     * Generated from protobuf enum <code>KNOWN = 1;</code>
     */
    const KNOWN = 1;
    /**
     * Operation does not have a matched catalog operation.
     *
     * Generated from protobuf enum <code>UNKNOWN = 2;</code>
     */
    const UNKNOWN = 2;

    private static $valueToName = [
        self::CLASSIFICATION_UNSPECIFIED => 'CLASSIFICATION_UNSPECIFIED',
        self::KNOWN => 'KNOWN',
        self::UNKNOWN => 'UNKNOWN',
    ];

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

