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

namespace Google\Cloud\Dataplex\V1\MetadataJob\Status;

use UnexpectedValueException;

/**
 * State of a metadata job.
 *
 * Protobuf type <code>google.cloud.dataplex.v1.MetadataJob.Status.State</code>
 */
class State
{
    /**
     * State unspecified.
     *
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
     */
    const STATE_UNSPECIFIED = 0;
    /**
     * The job is queued.
     *
     * Generated from protobuf enum <code>QUEUED = 1;</code>
     */
    const QUEUED = 1;
    /**
     * The job is running.
     *
     * Generated from protobuf enum <code>RUNNING = 2;</code>
     */
    const RUNNING = 2;
    /**
     * The job is being canceled.
     *
     * Generated from protobuf enum <code>CANCELING = 3;</code>
     */
    const CANCELING = 3;
    /**
     * The job is canceled.
     *
     * Generated from protobuf enum <code>CANCELED = 4;</code>
     */
    const CANCELED = 4;
    /**
     * The job succeeded.
     *
     * Generated from protobuf enum <code>SUCCEEDED = 5;</code>
     */
    const SUCCEEDED = 5;
    /**
     * The job failed.
     *
     * Generated from protobuf enum <code>FAILED = 6;</code>
     */
    const FAILED = 6;
    /**
     * The job completed with some errors.
     *
     * Generated from protobuf enum <code>SUCCEEDED_WITH_ERRORS = 7;</code>
     */
    const SUCCEEDED_WITH_ERRORS = 7;

    private static $valueToName = [
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::QUEUED => 'QUEUED',
        self::RUNNING => 'RUNNING',
        self::CANCELING => 'CANCELING',
        self::CANCELED => 'CANCELED',
        self::SUCCEEDED => 'SUCCEEDED',
        self::FAILED => 'FAILED',
        self::SUCCEEDED_WITH_ERRORS => 'SUCCEEDED_WITH_ERRORS',
    ];

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


