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

namespace Google\Cloud\OracleDatabase\V1;

use UnexpectedValueException;

/**
 * The type of wallet generation.
 *
 * Protobuf type <code>google.cloud.oracledatabase.v1.GenerateType</code>
 */
class GenerateType
{
    /**
     * Default unspecified value.
     *
     * Generated from protobuf enum <code>GENERATE_TYPE_UNSPECIFIED = 0;</code>
     */
    const GENERATE_TYPE_UNSPECIFIED = 0;
    /**
     * Used to generate wallet for all databases in the region.
     *
     * Generated from protobuf enum <code>ALL = 1;</code>
     */
    const ALL = 1;
    /**
     * Used to generate wallet for a single database.
     *
     * Generated from protobuf enum <code>SINGLE = 2;</code>
     */
    const SINGLE = 2;

    private static $valueToName = [
        self::GENERATE_TYPE_UNSPECIFIED => 'GENERATE_TYPE_UNSPECIFIED',
        self::ALL => 'ALL',
        self::SINGLE => 'SINGLE',
    ];

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

