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

namespace Grafeas\V1;

use UnexpectedValueException;

/**
 * Instruction set architectures supported by various package managers.
 *
 * Protobuf type <code>grafeas.v1.Architecture</code>
 */
class Architecture
{
    /**
     * Unknown architecture.
     *
     * Generated from protobuf enum <code>ARCHITECTURE_UNSPECIFIED = 0;</code>
     */
    const ARCHITECTURE_UNSPECIFIED = 0;
    /**
     * X86 architecture.
     *
     * Generated from protobuf enum <code>X86 = 1;</code>
     */
    const X86 = 1;
    /**
     * X64 architecture.
     *
     * Generated from protobuf enum <code>X64 = 2;</code>
     */
    const X64 = 2;

    private static $valueToName = [
        self::ARCHITECTURE_UNSPECIFIED => 'ARCHITECTURE_UNSPECIFIED',
        self::X86 => 'X86',
        self::X64 => 'X64',
    ];

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

