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

namespace Google\Cloud\Dataplex\V1\Asset\DiscoveryStatus;

use UnexpectedValueException;

/**
 * Current state of discovery.
 *
 * Protobuf type <code>google.cloud.dataplex.v1.Asset.DiscoveryStatus.State</code>
 */
class State
{
    /**
     * State is unspecified.
     *
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
     */
    const STATE_UNSPECIFIED = 0;
    /**
     * Discovery for the asset is scheduled.
     *
     * Generated from protobuf enum <code>SCHEDULED = 1;</code>
     */
    const SCHEDULED = 1;
    /**
     * Discovery for the asset is running.
     *
     * Generated from protobuf enum <code>IN_PROGRESS = 2;</code>
     */
    const IN_PROGRESS = 2;
    /**
     * Discovery for the asset is currently paused (e.g. due to a lack
     * of available resources). It will be automatically resumed.
     *
     * Generated from protobuf enum <code>PAUSED = 3;</code>
     */
    const PAUSED = 3;
    /**
     * Discovery for the asset is disabled.
     *
     * Generated from protobuf enum <code>DISABLED = 5;</code>
     */
    const DISABLED = 5;

    private static $valueToName = [
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::SCHEDULED => 'SCHEDULED',
        self::IN_PROGRESS => 'IN_PROGRESS',
        self::PAUSED => 'PAUSED',
        self::DISABLED => 'DISABLED',
    ];

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


