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

namespace Google\Cloud\AlloyDb\V1beta\MigrationSource;

use UnexpectedValueException;

/**
 * Denote the type of migration source that created this cluster.
 *
 * Protobuf type <code>google.cloud.alloydb.v1beta.MigrationSource.MigrationSourceType</code>
 */
class MigrationSourceType
{
    /**
     * Migration source is unknown.
     *
     * Generated from protobuf enum <code>MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0;</code>
     */
    const MIGRATION_SOURCE_TYPE_UNSPECIFIED = 0;
    /**
     * DMS source means the cluster was created via DMS migration job.
     *
     * Generated from protobuf enum <code>DMS = 1;</code>
     */
    const DMS = 1;

    private static $valueToName = [
        self::MIGRATION_SOURCE_TYPE_UNSPECIFIED => 'MIGRATION_SOURCE_TYPE_UNSPECIFIED',
        self::DMS => 'DMS',
    ];

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


