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

namespace Google\Cloud\Batch\V1\JobNotification;

use UnexpectedValueException;

/**
 * The message type.
 *
 * Protobuf type <code>google.cloud.batch.v1.JobNotification.Type</code>
 */
class Type
{
    /**
     * Unspecified.
     *
     * Generated from protobuf enum <code>TYPE_UNSPECIFIED = 0;</code>
     */
    const TYPE_UNSPECIFIED = 0;
    /**
     * Notify users that the job state has changed.
     *
     * Generated from protobuf enum <code>JOB_STATE_CHANGED = 1;</code>
     */
    const JOB_STATE_CHANGED = 1;
    /**
     * Notify users that the task state has changed.
     *
     * Generated from protobuf enum <code>TASK_STATE_CHANGED = 2;</code>
     */
    const TASK_STATE_CHANGED = 2;

    private static $valueToName = [
        self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED',
        self::JOB_STATE_CHANGED => 'JOB_STATE_CHANGED',
        self::TASK_STATE_CHANGED => 'TASK_STATE_CHANGED',
    ];

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


