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

namespace Google\Cloud\CloudDms\V1\CloudSqlSettings;

use UnexpectedValueException;

/**
 * The edition of the given Cloud SQL instance.
 * Can be ENTERPRISE or ENTERPRISE_PLUS.
 *
 * Protobuf type <code>google.cloud.clouddms.v1.CloudSqlSettings.Edition</code>
 */
class Edition
{
    /**
     * The instance did not specify the edition.
     *
     * Generated from protobuf enum <code>EDITION_UNSPECIFIED = 0;</code>
     */
    const EDITION_UNSPECIFIED = 0;
    /**
     * The instance is an enterprise edition.
     *
     * Generated from protobuf enum <code>ENTERPRISE = 2;</code>
     */
    const ENTERPRISE = 2;
    /**
     * The instance is an enterprise plus edition.
     *
     * Generated from protobuf enum <code>ENTERPRISE_PLUS = 3;</code>
     */
    const ENTERPRISE_PLUS = 3;

    private static $valueToName = [
        self::EDITION_UNSPECIFIED => 'EDITION_UNSPECIFIED',
        self::ENTERPRISE => 'ENTERPRISE',
        self::ENTERPRISE_PLUS => 'ENTERPRISE_PLUS',
    ];

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

