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

namespace Google\Cloud\CloudDms\V1\MigrationJob;

use UnexpectedValueException;

/**
 * The current migration job states.
 *
 * Protobuf type <code>google.cloud.clouddms.v1.MigrationJob.State</code>
 */
class State
{
    /**
     * The state of the migration job is unknown.
     *
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
     */
    const STATE_UNSPECIFIED = 0;
    /**
     * The migration job is down for maintenance.
     *
     * Generated from protobuf enum <code>MAINTENANCE = 1;</code>
     */
    const MAINTENANCE = 1;
    /**
     * The migration job is in draft mode and no resources are created.
     *
     * Generated from protobuf enum <code>DRAFT = 2;</code>
     */
    const DRAFT = 2;
    /**
     * The migration job is being created.
     *
     * Generated from protobuf enum <code>CREATING = 3;</code>
     */
    const CREATING = 3;
    /**
     * The migration job is created and not started.
     *
     * Generated from protobuf enum <code>NOT_STARTED = 4;</code>
     */
    const NOT_STARTED = 4;
    /**
     * The migration job is running.
     *
     * Generated from protobuf enum <code>RUNNING = 5;</code>
     */
    const RUNNING = 5;
    /**
     * The migration job failed.
     *
     * Generated from protobuf enum <code>FAILED = 6;</code>
     */
    const FAILED = 6;
    /**
     * The migration job has been completed.
     *
     * Generated from protobuf enum <code>COMPLETED = 7;</code>
     */
    const COMPLETED = 7;
    /**
     * The migration job is being deleted.
     *
     * Generated from protobuf enum <code>DELETING = 8;</code>
     */
    const DELETING = 8;
    /**
     * The migration job is being stopped.
     *
     * Generated from protobuf enum <code>STOPPING = 9;</code>
     */
    const STOPPING = 9;
    /**
     * The migration job is currently stopped.
     *
     * Generated from protobuf enum <code>STOPPED = 10;</code>
     */
    const STOPPED = 10;
    /**
     * The migration job has been deleted.
     *
     * Generated from protobuf enum <code>DELETED = 11;</code>
     */
    const DELETED = 11;
    /**
     * The migration job is being updated.
     *
     * Generated from protobuf enum <code>UPDATING = 12;</code>
     */
    const UPDATING = 12;
    /**
     * The migration job is starting.
     *
     * Generated from protobuf enum <code>STARTING = 13;</code>
     */
    const STARTING = 13;
    /**
     * The migration job is restarting.
     *
     * Generated from protobuf enum <code>RESTARTING = 14;</code>
     */
    const RESTARTING = 14;
    /**
     * The migration job is resuming.
     *
     * Generated from protobuf enum <code>RESUMING = 15;</code>
     */
    const RESUMING = 15;

    private static $valueToName = [
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::MAINTENANCE => 'MAINTENANCE',
        self::DRAFT => 'DRAFT',
        self::CREATING => 'CREATING',
        self::NOT_STARTED => 'NOT_STARTED',
        self::RUNNING => 'RUNNING',
        self::FAILED => 'FAILED',
        self::COMPLETED => 'COMPLETED',
        self::DELETING => 'DELETING',
        self::STOPPING => 'STOPPING',
        self::STOPPED => 'STOPPED',
        self::DELETED => 'DELETED',
        self::UPDATING => 'UPDATING',
        self::STARTING => 'STARTING',
        self::RESTARTING => 'RESTARTING',
        self::RESUMING => 'RESUMING',
    ];

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


