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

namespace Google\Cloud\OsConfig\V1\Inventory\Item;

use UnexpectedValueException;

/**
 * The different types of inventory that are tracked on a VM.
 *
 * Protobuf type <code>google.cloud.osconfig.v1.Inventory.Item.Type</code>
 */
class Type
{
    /**
     * Invalid. An type must be specified.
     *
     * Generated from protobuf enum <code>TYPE_UNSPECIFIED = 0;</code>
     */
    const TYPE_UNSPECIFIED = 0;
    /**
     * This represents a package that is installed on the VM.
     *
     * Generated from protobuf enum <code>INSTALLED_PACKAGE = 1;</code>
     */
    const INSTALLED_PACKAGE = 1;
    /**
     * This represents an update that is available for a package.
     *
     * Generated from protobuf enum <code>AVAILABLE_PACKAGE = 2;</code>
     */
    const AVAILABLE_PACKAGE = 2;

    private static $valueToName = [
        self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED',
        self::INSTALLED_PACKAGE => 'INSTALLED_PACKAGE',
        self::AVAILABLE_PACKAGE => 'AVAILABLE_PACKAGE',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Type::class, \Google\Cloud\OsConfig\V1\Inventory_Item_Type::class);

