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

namespace Google\Cloud\Compute\V1\AuthorizationLoggingOptions;

use UnexpectedValueException;

/**
 * This is deprecated and has no effect. Do not use.
 *
 * Protobuf type <code>google.cloud.compute.v1.AuthorizationLoggingOptions.PermissionType</code>
 */
class PermissionType
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_PERMISSION_TYPE = 0;</code>
     */
    const UNDEFINED_PERMISSION_TYPE = 0;
    /**
     * This is deprecated and has no effect. Do not use.
     *
     * Generated from protobuf enum <code>ADMIN_READ = 128951462;</code>
     */
    const ADMIN_READ = 128951462;
    /**
     * This is deprecated and has no effect. Do not use.
     *
     * Generated from protobuf enum <code>ADMIN_WRITE = 244412079;</code>
     */
    const ADMIN_WRITE = 244412079;
    /**
     * This is deprecated and has no effect. Do not use.
     *
     * Generated from protobuf enum <code>DATA_READ = 305224971;</code>
     */
    const DATA_READ = 305224971;
    /**
     * This is deprecated and has no effect. Do not use.
     *
     * Generated from protobuf enum <code>DATA_WRITE = 340181738;</code>
     */
    const DATA_WRITE = 340181738;
    /**
     * This is deprecated and has no effect. Do not use.
     *
     * Generated from protobuf enum <code>PERMISSION_TYPE_UNSPECIFIED = 440313346;</code>
     */
    const PERMISSION_TYPE_UNSPECIFIED = 440313346;

    private static $valueToName = [
        self::UNDEFINED_PERMISSION_TYPE => 'UNDEFINED_PERMISSION_TYPE',
        self::ADMIN_READ => 'ADMIN_READ',
        self::ADMIN_WRITE => 'ADMIN_WRITE',
        self::DATA_READ => 'DATA_READ',
        self::DATA_WRITE => 'DATA_WRITE',
        self::PERMISSION_TYPE_UNSPECIFIED => 'PERMISSION_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);
    }
}


