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

namespace Google\Cloud\DatabaseCenter\V1beta;

use UnexpectedValueException;

/**
 * Represents the edition of a database resource.
 *
 * Protobuf type <code>google.cloud.databasecenter.v1beta.Edition</code>
 */
class Edition
{
    /**
     * Default, to make it consistent with instance edition enum.
     *
     * Generated from protobuf enum <code>EDITION_UNSPECIFIED = 0;</code>
     */
    const EDITION_UNSPECIFIED = 0;
    /**
     * Represents the enterprise edition.
     *
     * Generated from protobuf enum <code>EDITION_ENTERPRISE = 1;</code>
     */
    const EDITION_ENTERPRISE = 1;
    /**
     * Represents the enterprise plus edition.
     *
     * Generated from protobuf enum <code>EDITION_ENTERPRISE_PLUS = 2;</code>
     */
    const EDITION_ENTERPRISE_PLUS = 2;
    /**
     * Represents the standard edition.
     *
     * Generated from protobuf enum <code>EDITION_STANDARD = 3;</code>
     */
    const EDITION_STANDARD = 3;

    private static $valueToName = [
        self::EDITION_UNSPECIFIED => 'EDITION_UNSPECIFIED',
        self::EDITION_ENTERPRISE => 'EDITION_ENTERPRISE',
        self::EDITION_ENTERPRISE_PLUS => 'EDITION_ENTERPRISE_PLUS',
        self::EDITION_STANDARD => 'EDITION_STANDARD',
    ];

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

