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

namespace Google\Cloud\Language\V1beta2\ClassificationModelOptions\V2Model;

use UnexpectedValueException;

/**
 * The content categories used for classification.
 *
 * Protobuf type <code>google.cloud.language.v1beta2.ClassificationModelOptions.V2Model.ContentCategoriesVersion</code>
 */
class ContentCategoriesVersion
{
    /**
     * If `ContentCategoriesVersion` is not specified, this option will
     * default to `V1`.
     *
     * Generated from protobuf enum <code>CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0;</code>
     */
    const CONTENT_CATEGORIES_VERSION_UNSPECIFIED = 0;
    /**
     * Legacy content categories of our initial launch in 2017.
     *
     * Generated from protobuf enum <code>V1 = 1;</code>
     */
    const V1 = 1;
    /**
     * Updated content categories in 2022.
     *
     * Generated from protobuf enum <code>V2 = 2;</code>
     */
    const V2 = 2;

    private static $valueToName = [
        self::CONTENT_CATEGORIES_VERSION_UNSPECIFIED => 'CONTENT_CATEGORIES_VERSION_UNSPECIFIED',
        self::V1 => 'V1',
        self::V2 => 'V2',
    ];

    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(ContentCategoriesVersion::class, \Google\Cloud\Language\V1beta2\ClassificationModelOptions_V2Model_ContentCategoriesVersion::class);

