<?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 resource to optimize for in Flexible Resource Scheduling.
 *
 * Protobuf type <code>google.dataflow.v1beta3.FlexResourceSchedulingGoal</code>
 */
class FlexResourceSchedulingGoal
{
    /**
     * Run in the default mode.
     *
     * Generated from protobuf enum <code>FLEXRS_UNSPECIFIED = 0;</code>
     */
    const FLEXRS_UNSPECIFIED = 0;
    /**
     * Optimize for lower execution time.
     *
     * Generated from protobuf enum <code>FLEXRS_SPEED_OPTIMIZED = 1;</code>
     */
    const FLEXRS_SPEED_OPTIMIZED = 1;
    /**
     * Optimize for lower cost.
     *
     * Generated from protobuf enum <code>FLEXRS_COST_OPTIMIZED = 2;</code>
     */
    const FLEXRS_COST_OPTIMIZED = 2;

    private static $valueToName = [
        self::FLEXRS_UNSPECIFIED => 'FLEXRS_UNSPECIFIED',
        self::FLEXRS_SPEED_OPTIMIZED => 'FLEXRS_SPEED_OPTIMIZED',
        self::FLEXRS_COST_OPTIMIZED => 'FLEXRS_COST_OPTIMIZED',
    ];

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

