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

use UnexpectedValueException;

/**
 * The type of product fee.
 *
 * Protobuf type <code>google.shopping.merchant.products.v1.ProductAttributes.ProductFee.FeeType</code>
 */
class FeeType
{
    /**
     * Unspecified fee type.
     *
     * Generated from protobuf enum <code>FEE_TYPE_UNSPECIFIED = 0;</code>
     */
    const FEE_TYPE_UNSPECIFIED = 0;
    /**
     * Admin fee.
     *
     * Generated from protobuf enum <code>ADMIN_FEE = 1;</code>
     */
    const ADMIN_FEE = 1;
    /**
     * Application fee.
     *
     * Generated from protobuf enum <code>APPLICATION_FEE = 2;</code>
     */
    const APPLICATION_FEE = 2;
    /**
     * Security deposit.
     *
     * Generated from protobuf enum <code>SECURITY_DEPOSIT = 3;</code>
     */
    const SECURITY_DEPOSIT = 3;

    private static $valueToName = [
        self::FEE_TYPE_UNSPECIFIED => 'FEE_TYPE_UNSPECIFIED',
        self::ADMIN_FEE => 'ADMIN_FEE',
        self::APPLICATION_FEE => 'APPLICATION_FEE',
        self::SECURITY_DEPOSIT => 'SECURITY_DEPOSIT',
    ];

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

