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

namespace Google\Cloud\AIPlatform\V1\SafetyRating;

use UnexpectedValueException;

/**
 * Harm severity levels.
 *
 * Protobuf type <code>google.cloud.aiplatform.v1.SafetyRating.HarmSeverity</code>
 */
class HarmSeverity
{
    /**
     * Harm severity unspecified.
     *
     * Generated from protobuf enum <code>HARM_SEVERITY_UNSPECIFIED = 0;</code>
     */
    const HARM_SEVERITY_UNSPECIFIED = 0;
    /**
     * Negligible level of harm severity.
     *
     * Generated from protobuf enum <code>HARM_SEVERITY_NEGLIGIBLE = 1;</code>
     */
    const HARM_SEVERITY_NEGLIGIBLE = 1;
    /**
     * Low level of harm severity.
     *
     * Generated from protobuf enum <code>HARM_SEVERITY_LOW = 2;</code>
     */
    const HARM_SEVERITY_LOW = 2;
    /**
     * Medium level of harm severity.
     *
     * Generated from protobuf enum <code>HARM_SEVERITY_MEDIUM = 3;</code>
     */
    const HARM_SEVERITY_MEDIUM = 3;
    /**
     * High level of harm severity.
     *
     * Generated from protobuf enum <code>HARM_SEVERITY_HIGH = 4;</code>
     */
    const HARM_SEVERITY_HIGH = 4;

    private static $valueToName = [
        self::HARM_SEVERITY_UNSPECIFIED => 'HARM_SEVERITY_UNSPECIFIED',
        self::HARM_SEVERITY_NEGLIGIBLE => 'HARM_SEVERITY_NEGLIGIBLE',
        self::HARM_SEVERITY_LOW => 'HARM_SEVERITY_LOW',
        self::HARM_SEVERITY_MEDIUM => 'HARM_SEVERITY_MEDIUM',
        self::HARM_SEVERITY_HIGH => 'HARM_SEVERITY_HIGH',
    ];

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


