<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: grafeas/v1/vex.proto

namespace Grafeas\V1\VulnerabilityAssessmentNote\Assessment\Justification;

use UnexpectedValueException;

/**
 * Provides the type of justification.
 *
 * Protobuf type <code>grafeas.v1.VulnerabilityAssessmentNote.Assessment.Justification.JustificationType</code>
 */
class JustificationType
{
    /**
     * JUSTIFICATION_TYPE_UNSPECIFIED.
     *
     * Generated from protobuf enum <code>JUSTIFICATION_TYPE_UNSPECIFIED = 0;</code>
     */
    const JUSTIFICATION_TYPE_UNSPECIFIED = 0;
    /**
     * The vulnerable component is not present in the product.
     *
     * Generated from protobuf enum <code>COMPONENT_NOT_PRESENT = 1;</code>
     */
    const COMPONENT_NOT_PRESENT = 1;
    /**
     * The vulnerable code is not present. Typically this case
     * occurs when source code is configured or built in a way that excludes
     * the vulnerable code.
     *
     * Generated from protobuf enum <code>VULNERABLE_CODE_NOT_PRESENT = 2;</code>
     */
    const VULNERABLE_CODE_NOT_PRESENT = 2;
    /**
     * The vulnerable code can not be executed.
     * Typically this case occurs when the product includes the vulnerable
     * code but does not call or use the vulnerable code.
     *
     * Generated from protobuf enum <code>VULNERABLE_CODE_NOT_IN_EXECUTE_PATH = 3;</code>
     */
    const VULNERABLE_CODE_NOT_IN_EXECUTE_PATH = 3;
    /**
     * The vulnerable code cannot be controlled by an attacker to exploit
     * the vulnerability.
     *
     * Generated from protobuf enum <code>VULNERABLE_CODE_CANNOT_BE_CONTROLLED_BY_ADVERSARY = 4;</code>
     */
    const VULNERABLE_CODE_CANNOT_BE_CONTROLLED_BY_ADVERSARY = 4;
    /**
     * The product includes built-in protections or features that prevent
     * exploitation of the vulnerability. These built-in protections cannot
     * be subverted by the attacker and cannot be configured or disabled by
     * the user. These mitigations completely prevent exploitation based on
     * known attack vectors.
     *
     * Generated from protobuf enum <code>INLINE_MITIGATIONS_ALREADY_EXIST = 5;</code>
     */
    const INLINE_MITIGATIONS_ALREADY_EXIST = 5;

    private static $valueToName = [
        self::JUSTIFICATION_TYPE_UNSPECIFIED => 'JUSTIFICATION_TYPE_UNSPECIFIED',
        self::COMPONENT_NOT_PRESENT => 'COMPONENT_NOT_PRESENT',
        self::VULNERABLE_CODE_NOT_PRESENT => 'VULNERABLE_CODE_NOT_PRESENT',
        self::VULNERABLE_CODE_NOT_IN_EXECUTE_PATH => 'VULNERABLE_CODE_NOT_IN_EXECUTE_PATH',
        self::VULNERABLE_CODE_CANNOT_BE_CONTROLLED_BY_ADVERSARY => 'VULNERABLE_CODE_CANNOT_BE_CONTROLLED_BY_ADVERSARY',
        self::INLINE_MITIGATIONS_ALREADY_EXIST => 'INLINE_MITIGATIONS_ALREADY_EXIST',
    ];

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

