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

namespace Google\Cloud\Dataflow\V1beta3\ListJobsRequest;

use UnexpectedValueException;

/**
 * This field filters out and returns jobs in the specified job state. The
 * order of data returned is determined by the filter used, and is subject to
 * change.
 *
 * Protobuf type <code>google.dataflow.v1beta3.ListJobsRequest.Filter</code>
 */
class Filter
{
    /**
     * The filter isn't specified, or is unknown. This returns all jobs ordered
     * on descending `JobUuid`.
     *
     * Generated from protobuf enum <code>UNKNOWN = 0;</code>
     */
    const UNKNOWN = 0;
    /**
     * Returns all running jobs first ordered on creation timestamp, then
     * returns all terminated jobs ordered on the termination timestamp.
     *
     * Generated from protobuf enum <code>ALL = 1;</code>
     */
    const ALL = 1;
    /**
     * Filters the jobs that have a terminated state, ordered on the
     * termination timestamp. Example terminated states: `JOB_STATE_STOPPED`,
     * `JOB_STATE_UPDATED`, `JOB_STATE_DRAINED`, etc.
     *
     * Generated from protobuf enum <code>TERMINATED = 2;</code>
     */
    const TERMINATED = 2;
    /**
     * Filters the jobs that are running ordered on the creation timestamp.
     *
     * Generated from protobuf enum <code>ACTIVE = 3;</code>
     */
    const ACTIVE = 3;

    private static $valueToName = [
        self::UNKNOWN => 'UNKNOWN',
        self::ALL => 'ALL',
        self::TERMINATED => 'TERMINATED',
        self::ACTIVE => 'ACTIVE',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Filter::class, \Google\Cloud\Dataflow\V1beta3\ListJobsRequest_Filter::class);

