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

namespace Google\Cloud\VMMigration\V1\CutoverJob;

use UnexpectedValueException;

/**
 * Possible states of the cutover job.
 *
 * Protobuf type <code>google.cloud.vmmigration.v1.CutoverJob.State</code>
 */
class State
{
    /**
     * The state is unknown. This is used for API compatibility only and is not
     * used by the system.
     *
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
     */
    const STATE_UNSPECIFIED = 0;
    /**
     * The cutover job has not yet started.
     *
     * Generated from protobuf enum <code>PENDING = 1;</code>
     */
    const PENDING = 1;
    /**
     * The cutover job finished with errors.
     *
     * Generated from protobuf enum <code>FAILED = 2;</code>
     */
    const FAILED = 2;
    /**
     * The cutover job finished successfully.
     *
     * Generated from protobuf enum <code>SUCCEEDED = 3;</code>
     */
    const SUCCEEDED = 3;
    /**
     * The cutover job was cancelled.
     *
     * Generated from protobuf enum <code>CANCELLED = 4;</code>
     */
    const CANCELLED = 4;
    /**
     * The cutover job is being cancelled.
     *
     * Generated from protobuf enum <code>CANCELLING = 5;</code>
     */
    const CANCELLING = 5;
    /**
     * The cutover job is active and running.
     *
     * Generated from protobuf enum <code>ACTIVE = 6;</code>
     */
    const ACTIVE = 6;
    /**
     * OS adaptation is running as part of the cutover job to generate license.
     *
     * Generated from protobuf enum <code>ADAPTING_OS = 7;</code>
     */
    const ADAPTING_OS = 7;

    private static $valueToName = [
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::PENDING => 'PENDING',
        self::FAILED => 'FAILED',
        self::SUCCEEDED => 'SUCCEEDED',
        self::CANCELLED => 'CANCELLED',
        self::CANCELLING => 'CANCELLING',
        self::ACTIVE => 'ACTIVE',
        self::ADAPTING_OS => 'ADAPTING_OS',
    ];

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


