<?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 shuffle mode used by a
 * [google.dataflow.v1beta3.Job], which determines the approach data is shuffled
 * during processing. More details in:
 * https://cloud.google.com/dataflow/docs/guides/deploying-a-pipeline#dataflow-shuffle
 *
 * Protobuf type <code>google.dataflow.v1beta3.ShuffleMode</code>
 */
class ShuffleMode
{
    /**
     * Shuffle mode information is not available.
     *
     * Generated from protobuf enum <code>SHUFFLE_MODE_UNSPECIFIED = 0;</code>
     */
    const SHUFFLE_MODE_UNSPECIFIED = 0;
    /**
     * Shuffle is done on the worker VMs.
     *
     * Generated from protobuf enum <code>VM_BASED = 1;</code>
     */
    const VM_BASED = 1;
    /**
     * Shuffle is done on the service side.
     *
     * Generated from protobuf enum <code>SERVICE_BASED = 2;</code>
     */
    const SERVICE_BASED = 2;

    private static $valueToName = [
        self::SHUFFLE_MODE_UNSPECIFIED => 'SHUFFLE_MODE_UNSPECIFIED',
        self::VM_BASED => 'VM_BASED',
        self::SERVICE_BASED => 'SERVICE_BASED',
    ];

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

