<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/devtools/build/v1/build_events.proto

namespace Google\Cloud\Build\V1;

use UnexpectedValueException;

/**
 * The type of console output stream.
 *
 * Protobuf type <code>google.devtools.build.v1.ConsoleOutputStream</code>
 */
class ConsoleOutputStream
{
    /**
     * Unspecified or unknown.
     *
     * Generated from protobuf enum <code>UNKNOWN = 0;</code>
     */
    const UNKNOWN = 0;
    /**
     * Normal output stream.
     *
     * Generated from protobuf enum <code>STDOUT = 1;</code>
     */
    const STDOUT = 1;
    /**
     * Error output stream.
     *
     * Generated from protobuf enum <code>STDERR = 2;</code>
     */
    const STDERR = 2;

    private static $valueToName = [
        self::UNKNOWN => 'UNKNOWN',
        self::STDOUT => 'STDOUT',
        self::STDERR => 'STDERR',
    ];

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

