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

namespace Grafeas\V1;

use UnexpectedValueException;

/**
 * Kind represents the kinds of notes supported.
 *
 * Protobuf type <code>grafeas.v1.NoteKind</code>
 */
class NoteKind
{
    /**
     * Default value. This value is unused.
     *
     * Generated from protobuf enum <code>NOTE_KIND_UNSPECIFIED = 0;</code>
     */
    const NOTE_KIND_UNSPECIFIED = 0;
    /**
     * The note and occurrence represent a package vulnerability.
     *
     * Generated from protobuf enum <code>VULNERABILITY = 1;</code>
     */
    const VULNERABILITY = 1;
    /**
     * The note and occurrence assert build provenance.
     *
     * Generated from protobuf enum <code>BUILD = 2;</code>
     */
    const BUILD = 2;
    /**
     * This represents an image basis relationship.
     *
     * Generated from protobuf enum <code>IMAGE = 3;</code>
     */
    const IMAGE = 3;
    /**
     * This represents a package installed via a package manager.
     *
     * Generated from protobuf enum <code>PACKAGE = 4;</code>
     */
    const PACKAGE = 4;
    /**
     * The note and occurrence track deployment events.
     *
     * Generated from protobuf enum <code>DEPLOYMENT = 5;</code>
     */
    const DEPLOYMENT = 5;
    /**
     * The note and occurrence track the initial discovery status of a resource.
     *
     * Generated from protobuf enum <code>DISCOVERY = 6;</code>
     */
    const DISCOVERY = 6;
    /**
     * This represents a logical "role" that can attest to artifacts.
     *
     * Generated from protobuf enum <code>ATTESTATION = 7;</code>
     */
    const ATTESTATION = 7;
    /**
     * This represents an available package upgrade.
     *
     * Generated from protobuf enum <code>UPGRADE = 8;</code>
     */
    const UPGRADE = 8;
    /**
     * This represents a Compliance Note
     *
     * Generated from protobuf enum <code>COMPLIANCE = 9;</code>
     */
    const COMPLIANCE = 9;
    /**
     * This represents a DSSE attestation Note
     *
     * Generated from protobuf enum <code>DSSE_ATTESTATION = 10;</code>
     */
    const DSSE_ATTESTATION = 10;

    private static $valueToName = [
        self::NOTE_KIND_UNSPECIFIED => 'NOTE_KIND_UNSPECIFIED',
        self::VULNERABILITY => 'VULNERABILITY',
        self::BUILD => 'BUILD',
        self::IMAGE => 'IMAGE',
        self::PACKAGE => 'PACKAGE',
        self::DEPLOYMENT => 'DEPLOYMENT',
        self::DISCOVERY => 'DISCOVERY',
        self::ATTESTATION => 'ATTESTATION',
        self::UPGRADE => 'UPGRADE',
        self::COMPLIANCE => 'COMPLIANCE',
        self::DSSE_ATTESTATION => 'DSSE_ATTESTATION',
    ];

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

