<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/shopping/merchant/products/v1/products_common.proto

namespace Google\Shopping\Merchant\Products\V1\ProductAttributes;

use UnexpectedValueException;

/**
 * The engine type of the vehicle.
 *
 * Protobuf type <code>google.shopping.merchant.products.v1.ProductAttributes.EngineType</code>
 */
class EngineType
{
    /**
     * Unspecified engine type.
     *
     * Generated from protobuf enum <code>ENGINE_TYPE_UNSPECIFIED = 0;</code>
     */
    const ENGINE_TYPE_UNSPECIFIED = 0;
    /**
     * Gasoline.
     *
     * Generated from protobuf enum <code>GASOLINE = 1;</code>
     */
    const GASOLINE = 1;
    /**
     * Diesel.
     *
     * Generated from protobuf enum <code>DIESEL = 2;</code>
     */
    const DIESEL = 2;
    /**
     * Electric.
     *
     * Generated from protobuf enum <code>ELECTRIC = 3;</code>
     */
    const ELECTRIC = 3;
    /**
     * Hybrid.
     *
     * Generated from protobuf enum <code>HYBRID = 4;</code>
     */
    const HYBRID = 4;
    /**
     * Plug-in hybrid.
     *
     * Generated from protobuf enum <code>PLUG_IN_HYBRID = 5;</code>
     */
    const PLUG_IN_HYBRID = 5;
    /**
     * Natural gas.
     *
     * Generated from protobuf enum <code>NATURAL_GAS = 6;</code>
     */
    const NATURAL_GAS = 6;
    /**
     * LPG.
     *
     * Generated from protobuf enum <code>LPG = 7;</code>
     */
    const LPG = 7;
    /**
     * Methane.
     *
     * Generated from protobuf enum <code>METHANE = 8;</code>
     */
    const METHANE = 8;
    /**
     * Other.
     *
     * Generated from protobuf enum <code>OTHER = 9;</code>
     */
    const OTHER = 9;

    private static $valueToName = [
        self::ENGINE_TYPE_UNSPECIFIED => 'ENGINE_TYPE_UNSPECIFIED',
        self::GASOLINE => 'GASOLINE',
        self::DIESEL => 'DIESEL',
        self::ELECTRIC => 'ELECTRIC',
        self::HYBRID => 'HYBRID',
        self::PLUG_IN_HYBRID => 'PLUG_IN_HYBRID',
        self::NATURAL_GAS => 'NATURAL_GAS',
        self::LPG => 'LPG',
        self::METHANE => 'METHANE',
        self::OTHER => 'OTHER',
    ];

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

