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

namespace Google\Cloud\Dataform\V1beta1\MoveFolderMetadata;

use UnexpectedValueException;

/**
 * Different states of the move.
 *
 * Protobuf type <code>google.cloud.dataform.v1beta1.MoveFolderMetadata.State</code>
 */
class State
{
    /**
     * The state is unspecified.
     *
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
     */
    const STATE_UNSPECIFIED = 0;
    /**
     * The move was initialized and recorded by the server, but not yet started.
     *
     * Generated from protobuf enum <code>INITIALIZED = 1;</code>
     */
    const INITIALIZED = 1;
    /**
     * The move is in progress.
     *
     * Generated from protobuf enum <code>IN_PROGRESS = 2;</code>
     */
    const IN_PROGRESS = 2;
    /**
     * The move has completed successfully.
     *
     * Generated from protobuf enum <code>SUCCESS = 3;</code>
     */
    const SUCCESS = 3;
    /**
     * The move has failed.
     *
     * Generated from protobuf enum <code>FAILED = 4;</code>
     */
    const FAILED = 4;

    private static $valueToName = [
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::INITIALIZED => 'INITIALIZED',
        self::IN_PROGRESS => 'IN_PROGRESS',
        self::SUCCESS => 'SUCCESS',
        self::FAILED => 'FAILED',
    ];

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

