<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: acme/weather/v1/weather.proto

namespace Acme\Weather\V1;

use UnexpectedValueException;

/**
 * Protobuf type <code>acme.weather.v1.Condition</code>
 */
class Condition
{
    /**
     * Generated from protobuf enum <code>CONDITION_UNKNOWN = 0;</code>
     */
    const CONDITION_UNKNOWN = 0;
    /**
     * Generated from protobuf enum <code>CONDITION_RAINY = 1;</code>
     */
    const CONDITION_RAINY = 1;
    /**
     * Generated from protobuf enum <code>CONDITION_SUNNY = 2;</code>
     */
    const CONDITION_SUNNY = 2;
    /**
     * Generated from protobuf enum <code>CONDITION_CLOUDY = 3;</code>
     */
    const CONDITION_CLOUDY = 3;

    private static $valueToName = [
        self::CONDITION_UNKNOWN => 'CONDITION_UNKNOWN',
        self::CONDITION_RAINY => 'CONDITION_RAINY',
        self::CONDITION_SUNNY => 'CONDITION_SUNNY',
        self::CONDITION_CLOUDY => 'CONDITION_CLOUDY',
    ];

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

