<?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 vehicle price type.
 *
 * Protobuf type <code>google.shopping.merchant.products.v1.ProductAttributes.VehiclePriceType</code>
 */
class VehiclePriceType
{
    /**
     * Unspecified vehicle price type.
     *
     * Generated from protobuf enum <code>VEHICLE_PRICE_TYPE_UNSPECIFIED = 0;</code>
     */
    const VEHICLE_PRICE_TYPE_UNSPECIFIED = 0;
    /**
     * All in price.
     *
     * Generated from protobuf enum <code>ALL_IN_PRICE = 1;</code>
     */
    const ALL_IN_PRICE = 1;
    /**
     * Drive away price.
     *
     * Generated from protobuf enum <code>DRIVE_AWAY_PRICE = 2;</code>
     */
    const DRIVE_AWAY_PRICE = 2;
    /**
     * Estimated drive away price.
     *
     * Generated from protobuf enum <code>ESTIMATED_DRIVE_AWAY_PRICE = 3;</code>
     */
    const ESTIMATED_DRIVE_AWAY_PRICE = 3;
    /**
     * Excluding government charges price.
     *
     * Generated from protobuf enum <code>EXCLUDING_GOVERNMENT_CHARGES_PRICE = 4;</code>
     */
    const EXCLUDING_GOVERNMENT_CHARGES_PRICE = 4;
    /**
     * Vehicle base price.
     *
     * Generated from protobuf enum <code>VEHICLE_BASE_PRICE = 5;</code>
     */
    const VEHICLE_BASE_PRICE = 5;

    private static $valueToName = [
        self::VEHICLE_PRICE_TYPE_UNSPECIFIED => 'VEHICLE_PRICE_TYPE_UNSPECIFIED',
        self::ALL_IN_PRICE => 'ALL_IN_PRICE',
        self::DRIVE_AWAY_PRICE => 'DRIVE_AWAY_PRICE',
        self::ESTIMATED_DRIVE_AWAY_PRICE => 'ESTIMATED_DRIVE_AWAY_PRICE',
        self::EXCLUDING_GOVERNMENT_CHARGES_PRICE => 'EXCLUDING_GOVERNMENT_CHARGES_PRICE',
        self::VEHICLE_BASE_PRICE => 'VEHICLE_BASE_PRICE',
    ];

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

