<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/dialogflow/v2/generator.proto

namespace Google\Cloud\Dialogflow\V2\RaiSettings\RaiCategoryConfig;

use UnexpectedValueException;

/**
 * Enum for RAI category.
 *
 * Protobuf type <code>google.cloud.dialogflow.v2.RaiSettings.RaiCategoryConfig.RaiCategory</code>
 */
class RaiCategory
{
    /**
     * Default value.
     *
     * Generated from protobuf enum <code>RAI_CATEGORY_UNSPECIFIED = 0;</code>
     */
    const RAI_CATEGORY_UNSPECIFIED = 0;
    /**
     * Dangerous content.
     *
     * Generated from protobuf enum <code>DANGEROUS_CONTENT = 1;</code>
     */
    const DANGEROUS_CONTENT = 1;
    /**
     * Sexually explicit content.
     *
     * Generated from protobuf enum <code>SEXUALLY_EXPLICIT = 2;</code>
     */
    const SEXUALLY_EXPLICIT = 2;
    /**
     * Harassment content.
     *
     * Generated from protobuf enum <code>HARASSMENT = 3;</code>
     */
    const HARASSMENT = 3;
    /**
     * Hate speech content.
     *
     * Generated from protobuf enum <code>HATE_SPEECH = 4;</code>
     */
    const HATE_SPEECH = 4;

    private static $valueToName = [
        self::RAI_CATEGORY_UNSPECIFIED => 'RAI_CATEGORY_UNSPECIFIED',
        self::DANGEROUS_CONTENT => 'DANGEROUS_CONTENT',
        self::SEXUALLY_EXPLICIT => 'SEXUALLY_EXPLICIT',
        self::HARASSMENT => 'HARASSMENT',
        self::HATE_SPEECH => 'HATE_SPEECH',
    ];

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

