<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/dataflow/v1beta3/environment.proto

namespace Google\Cloud\Dataflow\V1beta3;

use UnexpectedValueException;

/**
 * Specifies the processing model used by a
 * [google.dataflow.v1beta3.Job], which determines the way the Job is
 * managed by the Cloud Dataflow service (how workers are scheduled, how
 * inputs are sharded, etc).
 *
 * Protobuf type <code>google.dataflow.v1beta3.JobType</code>
 */
class JobType
{
    /**
     * The type of the job is unspecified, or unknown.
     *
     * Generated from protobuf enum <code>JOB_TYPE_UNKNOWN = 0;</code>
     */
    const JOB_TYPE_UNKNOWN = 0;
    /**
     * A batch job with a well-defined end point: data is read, data is
     * processed, data is written, and the job is done.
     *
     * Generated from protobuf enum <code>JOB_TYPE_BATCH = 1;</code>
     */
    const JOB_TYPE_BATCH = 1;
    /**
     * A continuously streaming job with no end: data is read,
     * processed, and written continuously.
     *
     * Generated from protobuf enum <code>JOB_TYPE_STREAMING = 2;</code>
     */
    const JOB_TYPE_STREAMING = 2;

    private static $valueToName = [
        self::JOB_TYPE_UNKNOWN => 'JOB_TYPE_UNKNOWN',
        self::JOB_TYPE_BATCH => 'JOB_TYPE_BATCH',
        self::JOB_TYPE_STREAMING => 'JOB_TYPE_STREAMING',
    ];

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

