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

namespace Google\Cloud\Compute\V1\AuditLogConfig;

use UnexpectedValueException;

/**
 * The log type that this config enables.
 *
 * Protobuf type <code>google.cloud.compute.v1.AuditLogConfig.LogType</code>
 */
class LogType
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_LOG_TYPE = 0;</code>
     */
    const UNDEFINED_LOG_TYPE = 0;
    /**
     * Generated from protobuf enum <code>ADMIN_READ = 128951462;</code>
     */
    const ADMIN_READ = 128951462;
    /**
     * Generated from protobuf enum <code>DATA_READ = 305224971;</code>
     */
    const DATA_READ = 305224971;
    /**
     * Generated from protobuf enum <code>DATA_WRITE = 340181738;</code>
     */
    const DATA_WRITE = 340181738;
    /**
     * Generated from protobuf enum <code>LOG_TYPE_UNSPECIFIED = 154527053;</code>
     */
    const LOG_TYPE_UNSPECIFIED = 154527053;

    private static $valueToName = [
        self::UNDEFINED_LOG_TYPE => 'UNDEFINED_LOG_TYPE',
        self::ADMIN_READ => 'ADMIN_READ',
        self::DATA_READ => 'DATA_READ',
        self::DATA_WRITE => 'DATA_WRITE',
        self::LOG_TYPE_UNSPECIFIED => 'LOG_TYPE_UNSPECIFIED',
    ];

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


