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

use UnexpectedValueException;

/**
 * The surface values to which the minimum order value applies.
 *
 * Protobuf type <code>google.shopping.merchant.products.v1.ProductMinimumOrderValue.Surface</code>
 */
class Surface
{
    /**
     * Surface is unspecified.
     *
     * Generated from protobuf enum <code>SURFACE_UNSPECIFIED = 0;</code>
     */
    const SURFACE_UNSPECIFIED = 0;
    /**
     * Surface value to indicate online purchases.
     *
     * Generated from protobuf enum <code>ONLINE = 1;</code>
     */
    const ONLINE = 1;
    /**
     * Surface value to indicate local purchases.
     *
     * Generated from protobuf enum <code>LOCAL = 2;</code>
     */
    const LOCAL = 2;
    /**
     * Surface value to indicate online and local purchases.
     *
     * Generated from protobuf enum <code>ONLINE_LOCAL = 3;</code>
     */
    const ONLINE_LOCAL = 3;

    private static $valueToName = [
        self::SURFACE_UNSPECIFIED => 'SURFACE_UNSPECIFIED',
        self::ONLINE => 'ONLINE',
        self::LOCAL => 'LOCAL',
        self::ONLINE_LOCAL => 'ONLINE_LOCAL',
    ];

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

