<?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 name of the certification.
 *
 * Protobuf type <code>google.shopping.merchant.products.v1.CertificationName</code>
 */
class CertificationName
{
    /**
     * Certification name is not specified.
     *
     * Generated from protobuf enum <code>CERTIFICATION_NAME_UNSPECIFIED = 0;</code>
     */
    const CERTIFICATION_NAME_UNSPECIFIED = 0;
    /**
     * Energy Star.
     *
     * Generated from protobuf enum <code>ENERGY_STAR = 1;</code>
     */
    const ENERGY_STAR = 1;
    /**
     * Energy Star Most Efficient.
     *
     * Generated from protobuf enum <code>ENERGY_STAR_MOST_EFFICIENT = 2;</code>
     */
    const ENERGY_STAR_MOST_EFFICIENT = 2;
    /**
     * Represents energy efficiency certifications in the EU European
     * Registry for Energy Labeling (EPREL) database.
     *
     * Generated from protobuf enum <code>EPREL = 3;</code>
     */
    const EPREL = 3;
    /**
     * EU Ecolabel.
     *
     * Generated from protobuf enum <code>EU_ECOLABEL = 4;</code>
     */
    const EU_ECOLABEL = 4;
    /**
     * The overall CO2 class of a vehicle
     *
     * Generated from protobuf enum <code>VEHICLE_ENERGY_EFFICIENCY = 5;</code>
     */
    const VEHICLE_ENERGY_EFFICIENCY = 5;
    /**
     * For the CO2 class of a vehicle with a discharged battery.
     *
     * Generated from protobuf enum <code>VEHICLE_ENERGY_EFFICIENCY_DISCHARGED_BATTERY = 6;</code>
     */
    const VEHICLE_ENERGY_EFFICIENCY_DISCHARGED_BATTERY = 6;

    private static $valueToName = [
        self::CERTIFICATION_NAME_UNSPECIFIED => 'CERTIFICATION_NAME_UNSPECIFIED',
        self::ENERGY_STAR => 'ENERGY_STAR',
        self::ENERGY_STAR_MOST_EFFICIENT => 'ENERGY_STAR_MOST_EFFICIENT',
        self::EPREL => 'EPREL',
        self::EU_ECOLABEL => 'EU_ECOLABEL',
        self::VEHICLE_ENERGY_EFFICIENCY => 'VEHICLE_ENERGY_EFFICIENCY',
        self::VEHICLE_ENERGY_EFFICIENCY_DISCHARGED_BATTERY => 'VEHICLE_ENERGY_EFFICIENCY_DISCHARGED_BATTERY',
    ];

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

