<?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;

use UnexpectedValueException;

/**
 * The [energy efficiency
 * class](https://support.google.com/merchants/answer/7562785) as defined in EU
 * directive 2010/30/EU.
 *
 * Protobuf type <code>google.shopping.merchant.products.v1.EnergyEfficiencyClass</code>
 */
class EnergyEfficiencyClass
{
    /**
     * The energy efficiency class is unspecified.
     *
     * Generated from protobuf enum <code>ENERGY_EFFICIENCY_CLASS_UNSPECIFIED = 0;</code>
     */
    const ENERGY_EFFICIENCY_CLASS_UNSPECIFIED = 0;
    /**
     * A+++.
     *
     * Generated from protobuf enum <code>APPP = 1;</code>
     */
    const APPP = 1;
    /**
     * A++.
     *
     * Generated from protobuf enum <code>APP = 2;</code>
     */
    const APP = 2;
    /**
     * A+.
     *
     * Generated from protobuf enum <code>AP = 3;</code>
     */
    const AP = 3;
    /**
     * A.
     *
     * Generated from protobuf enum <code>A = 4;</code>
     */
    const A = 4;
    /**
     * B.
     *
     * Generated from protobuf enum <code>B = 5;</code>
     */
    const B = 5;
    /**
     * C.
     *
     * Generated from protobuf enum <code>C = 6;</code>
     */
    const C = 6;
    /**
     * D.
     *
     * Generated from protobuf enum <code>D = 7;</code>
     */
    const D = 7;
    /**
     * E.
     *
     * Generated from protobuf enum <code>E = 8;</code>
     */
    const E = 8;
    /**
     * F.
     *
     * Generated from protobuf enum <code>F = 9;</code>
     */
    const F = 9;
    /**
     * G.
     *
     * Generated from protobuf enum <code>G = 10;</code>
     */
    const G = 10;

    private static $valueToName = [
        self::ENERGY_EFFICIENCY_CLASS_UNSPECIFIED => 'ENERGY_EFFICIENCY_CLASS_UNSPECIFIED',
        self::APPP => 'APPP',
        self::APP => 'APP',
        self::AP => 'AP',
        self::A => 'A',
        self::B => 'B',
        self::C => 'C',
        self::D => 'D',
        self::E => 'E',
        self::F => 'F',
        self::G => 'G',
    ];

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

