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

namespace Google\Shopping\Merchant\DataSources\V1\DataSource;

use UnexpectedValueException;

/**
 * Determines the type of input to the data source. Based on the input some
 * settings might not be supported.
 *
 * Protobuf type <code>google.shopping.merchant.datasources.v1.DataSource.Input</code>
 */
class Input
{
    /**
     * Input unspecified.
     *
     * Generated from protobuf enum <code>INPUT_UNSPECIFIED = 0;</code>
     */
    const INPUT_UNSPECIFIED = 0;
    /**
     * Represents data sources for which the data is primarily provided through
     * the API.
     *
     * Generated from protobuf enum <code>API = 1;</code>
     */
    const API = 1;
    /**
     * Represents data sources for which the data is primarily provided through
     * file input. Data can still be provided through the API.
     *
     * Generated from protobuf enum <code>FILE = 2;</code>
     */
    const FILE = 2;
    /**
     * The data source for products added directly in Merchant Center.
     * This type of data source can not be created or updated through this API,
     * only by Merchant Center UI.
     * This type of data source is read only.
     *
     * Generated from protobuf enum <code>UI = 3;</code>
     */
    const UI = 3;
    /**
     * This is also known as
     * [Automated feeds](https://support.google.com/merchants/answer/12158480)
     * used to automatically build your product data. This type of data source
     * can be enabled or disabled through the Accounts sub-API.
     *
     * Generated from protobuf enum <code>AUTOFEED = 4;</code>
     */
    const AUTOFEED = 4;

    private static $valueToName = [
        self::INPUT_UNSPECIFIED => 'INPUT_UNSPECIFIED',
        self::API => 'API',
        self::FILE => 'FILE',
        self::UI => 'UI',
        self::AUTOFEED => 'AUTOFEED',
    ];

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

