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

namespace Google\Cloud\Dataplex\V1\StorageAccess;

use UnexpectedValueException;

/**
 * Access Mode determines how data stored within the Entity is read.
 *
 * Protobuf type <code>google.cloud.dataplex.v1.StorageAccess.AccessMode</code>
 */
class AccessMode
{
    /**
     * Access mode unspecified.
     *
     * Generated from protobuf enum <code>ACCESS_MODE_UNSPECIFIED = 0;</code>
     */
    const ACCESS_MODE_UNSPECIFIED = 0;
    /**
     * Default. Data is accessed directly using storage APIs.
     *
     * Generated from protobuf enum <code>DIRECT = 1;</code>
     */
    const DIRECT = 1;
    /**
     * Data is accessed through a managed interface using BigQuery APIs.
     *
     * Generated from protobuf enum <code>MANAGED = 2;</code>
     */
    const MANAGED = 2;

    private static $valueToName = [
        self::ACCESS_MODE_UNSPECIFIED => 'ACCESS_MODE_UNSPECIFIED',
        self::DIRECT => 'DIRECT',
        self::MANAGED => 'MANAGED',
    ];

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


