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

namespace Google\Cloud\ModelArmor\V1\VirusDetail;

use UnexpectedValueException;

/**
 * Defines all the threat types of a virus
 *
 * Protobuf type <code>google.cloud.modelarmor.v1.VirusDetail.ThreatType</code>
 */
class ThreatType
{
    /**
     * Unused
     *
     * Generated from protobuf enum <code>THREAT_TYPE_UNSPECIFIED = 0;</code>
     */
    const THREAT_TYPE_UNSPECIFIED = 0;
    /**
     * Unable to categorize threat
     *
     * Generated from protobuf enum <code>UNKNOWN = 1;</code>
     */
    const UNKNOWN = 1;
    /**
     * Virus or Worm threat.
     *
     * Generated from protobuf enum <code>VIRUS_OR_WORM = 2;</code>
     */
    const VIRUS_OR_WORM = 2;
    /**
     * Malicious program. E.g. Spyware, Trojan.
     *
     * Generated from protobuf enum <code>MALICIOUS_PROGRAM = 3;</code>
     */
    const MALICIOUS_PROGRAM = 3;
    /**
     * Potentially harmful content. E.g. Injected code, Macro
     *
     * Generated from protobuf enum <code>POTENTIALLY_HARMFUL_CONTENT = 4;</code>
     */
    const POTENTIALLY_HARMFUL_CONTENT = 4;
    /**
     * Potentially unwanted content. E.g. Adware.
     *
     * Generated from protobuf enum <code>POTENTIALLY_UNWANTED_CONTENT = 5;</code>
     */
    const POTENTIALLY_UNWANTED_CONTENT = 5;

    private static $valueToName = [
        self::THREAT_TYPE_UNSPECIFIED => 'THREAT_TYPE_UNSPECIFIED',
        self::UNKNOWN => 'UNKNOWN',
        self::VIRUS_OR_WORM => 'VIRUS_OR_WORM',
        self::MALICIOUS_PROGRAM => 'MALICIOUS_PROGRAM',
        self::POTENTIALLY_HARMFUL_CONTENT => 'POTENTIALLY_HARMFUL_CONTENT',
        self::POTENTIALLY_UNWANTED_CONTENT => 'POTENTIALLY_UNWANTED_CONTENT',
    ];

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


