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

namespace Google\Cloud\OracleDatabase\V1\AutonomousDatabaseProperties;

use UnexpectedValueException;

/**
 * This field indicates the modes of an Autonomous Database.
 *
 * Protobuf type <code>google.cloud.oracledatabase.v1.AutonomousDatabaseProperties.OpenMode</code>
 */
class OpenMode
{
    /**
     * Default unspecified value.
     *
     * Generated from protobuf enum <code>OPEN_MODE_UNSPECIFIED = 0;</code>
     */
    const OPEN_MODE_UNSPECIFIED = 0;
    /**
     * Read Only Mode
     *
     * Generated from protobuf enum <code>READ_ONLY = 1;</code>
     */
    const READ_ONLY = 1;
    /**
     * Read Write Mode
     *
     * Generated from protobuf enum <code>READ_WRITE = 2;</code>
     */
    const READ_WRITE = 2;

    private static $valueToName = [
        self::OPEN_MODE_UNSPECIFIED => 'OPEN_MODE_UNSPECIFIED',
        self::READ_ONLY => 'READ_ONLY',
        self::READ_WRITE => 'READ_WRITE',
    ];

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


