<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/maps/fleetengine/v1/vehicles.proto

namespace Google\Maps\FleetEngine\V1;

use UnexpectedValueException;

/**
 * Status of the battery, whether full or charging etc.
 *
 * Protobuf type <code>maps.fleetengine.v1.BatteryStatus</code>
 */
class BatteryStatus
{
    /**
     * Battery status unknown.
     *
     * Generated from protobuf enum <code>UNKNOWN_BATTERY_STATUS = 0;</code>
     */
    const UNKNOWN_BATTERY_STATUS = 0;
    /**
     * Battery is being charged.
     *
     * Generated from protobuf enum <code>BATTERY_STATUS_CHARGING = 1;</code>
     */
    const BATTERY_STATUS_CHARGING = 1;
    /**
     * Battery is discharging.
     *
     * Generated from protobuf enum <code>BATTERY_STATUS_DISCHARGING = 2;</code>
     */
    const BATTERY_STATUS_DISCHARGING = 2;
    /**
     * Battery is full.
     *
     * Generated from protobuf enum <code>BATTERY_STATUS_FULL = 3;</code>
     */
    const BATTERY_STATUS_FULL = 3;
    /**
     * Battery is not charging.
     *
     * Generated from protobuf enum <code>BATTERY_STATUS_NOT_CHARGING = 4;</code>
     */
    const BATTERY_STATUS_NOT_CHARGING = 4;
    /**
     * Battery is low on power.
     *
     * Generated from protobuf enum <code>BATTERY_STATUS_POWER_LOW = 5;</code>
     */
    const BATTERY_STATUS_POWER_LOW = 5;

    private static $valueToName = [
        self::UNKNOWN_BATTERY_STATUS => 'UNKNOWN_BATTERY_STATUS',
        self::BATTERY_STATUS_CHARGING => 'BATTERY_STATUS_CHARGING',
        self::BATTERY_STATUS_DISCHARGING => 'BATTERY_STATUS_DISCHARGING',
        self::BATTERY_STATUS_FULL => 'BATTERY_STATUS_FULL',
        self::BATTERY_STATUS_NOT_CHARGING => 'BATTERY_STATUS_NOT_CHARGING',
        self::BATTERY_STATUS_POWER_LOW => 'BATTERY_STATUS_POWER_LOW',
    ];

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

