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

namespace Google\Shopping\Merchant\Products\V1beta\ProductSustainabilityIncentive;

use UnexpectedValueException;

/**
 * Types of supported sustainability incentive programs.
 *
 * Protobuf type <code>google.shopping.merchant.products.v1beta.ProductSustainabilityIncentive.Type</code>
 */
class Type
{
    /**
     * Unspecified or unknown sustainability incentive type.
     *
     * Generated from protobuf enum <code>TYPE_UNSPECIFIED = 0;</code>
     */
    const TYPE_UNSPECIFIED = 0;
    /**
     * Program offering tax liability reductions for electric vehicles and, in
     * some countries, plug-in hybrids. These reductions can be based on a
     * specific amount or a percentage of the sale price.
     *
     * Generated from protobuf enum <code>EV_TAX_CREDIT = 1;</code>
     */
    const EV_TAX_CREDIT = 1;
    /**
     * A subsidy program, often called an environmental bonus, provides a
     * purchase grant for electric vehicles and, in some countries, plug-in
     * hybrids. The grant amount may be a fixed sum or a percentage of the sale
     * price.
     *
     * Generated from protobuf enum <code>EV_PRICE_DISCOUNT = 2;</code>
     */
    const EV_PRICE_DISCOUNT = 2;

    private static $valueToName = [
        self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED',
        self::EV_TAX_CREDIT => 'EV_TAX_CREDIT',
        self::EV_PRICE_DISCOUNT => 'EV_PRICE_DISCOUNT',
    ];

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

