<?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 certification authority.
 *
 * Protobuf type <code>google.shopping.merchant.products.v1.CertificationAuthority</code>
 */
class CertificationAuthority
{
    /**
     * Certification authority is not specified.
     *
     * Generated from protobuf enum <code>CERTIFICATION_AUTHORITY_UNSPECIFIED = 0;</code>
     */
    const CERTIFICATION_AUTHORITY_UNSPECIFIED = 0;
    /**
     * For the French CO2 emissions class for vehicles.
     *
     * Generated from protobuf enum <code>ADEME = 1;</code>
     */
    const ADEME = 1;
    /**
     * For the German CO2 emissions classes for vehicles.
     *
     * Generated from protobuf enum <code>BMWK = 2;</code>
     */
    const BMWK = 2;
    /**
     * Environment Protection Agency.
     *
     * Generated from protobuf enum <code>EPA = 3;</code>
     */
    const EPA = 3;
    /**
     * European Commission for energy labels in the EU.
     *
     * Generated from protobuf enum <code>EC = 4;</code>
     */
    const EC = 4;

    private static $valueToName = [
        self::CERTIFICATION_AUTHORITY_UNSPECIFIED => 'CERTIFICATION_AUTHORITY_UNSPECIFIED',
        self::ADEME => 'ADEME',
        self::BMWK => 'BMWK',
        self::EPA => 'EPA',
        self::EC => 'EC',
    ];

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

