<?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 [pickup](https://support.google.com/merchants/answer/14634021) option
 * for the item.
 *
 * Protobuf type <code>google.shopping.merchant.products.v1.PickupMethod</code>
 */
class PickupMethod
{
    /**
     * Pickup method is not specified.
     *
     * Generated from protobuf enum <code>PICKUP_METHOD_UNSPECIFIED = 0;</code>
     */
    const PICKUP_METHOD_UNSPECIFIED = 0;
    /**
     * The item is not available for store pickup.
     *
     * Generated from protobuf enum <code>NOT_SUPPORTED = 1;</code>
     */
    const NOT_SUPPORTED = 1;
    /**
     * The entire transaction occurs online.
     *
     * Generated from protobuf enum <code>BUY = 2;</code>
     */
    const BUY = 2;
    /**
     * The item is reserved online and the transaction occurs in-store.
     *
     * Generated from protobuf enum <code>RESERVE = 3;</code>
     */
    const RESERVE = 3;
    /**
     * The item is purchased online and shipped to a local store for the customer
     * to pick up.
     *
     * Generated from protobuf enum <code>SHIP_TO_STORE = 4;</code>
     */
    const SHIP_TO_STORE = 4;

    private static $valueToName = [
        self::PICKUP_METHOD_UNSPECIFIED => 'PICKUP_METHOD_UNSPECIFIED',
        self::NOT_SUPPORTED => 'NOT_SUPPORTED',
        self::BUY => 'BUY',
        self::RESERVE => 'RESERVE',
        self::SHIP_TO_STORE => 'SHIP_TO_STORE',
    ];

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

