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

namespace Google\Shopping\Merchant\DataSources\V1beta\FileInput;

use UnexpectedValueException;

/**
 * The method of file delivery.
 *
 * Protobuf type <code>google.shopping.merchant.datasources.v1beta.FileInput.FileInputType</code>
 */
class FileInputType
{
    /**
     * File input type unspecified.
     *
     * Generated from protobuf enum <code>FILE_INPUT_TYPE_UNSPECIFIED = 0;</code>
     */
    const FILE_INPUT_TYPE_UNSPECIFIED = 0;
    /**
     * The file is uploaded through SFTP, Google Cloud Storage or manually in
     * the Merchant Center.
     *
     * Generated from protobuf enum <code>UPLOAD = 1;</code>
     */
    const UPLOAD = 1;
    /**
     * The file is fetched from the configured
     * [fetch_uri][google.shopping.merchant.datasources.v1beta.FileInput.FetchSettings.fetch_uri].
     *
     * Generated from protobuf enum <code>FETCH = 2;</code>
     */
    const FETCH = 2;
    /**
     * The file is fetched from Google Sheets specified in the
     * [fetch_uri][google.shopping.merchant.datasources.v1beta.FileInput.FetchSettings.fetch_uri].
     *
     * Generated from protobuf enum <code>GOOGLE_SHEETS = 3;</code>
     */
    const GOOGLE_SHEETS = 3;

    private static $valueToName = [
        self::FILE_INPUT_TYPE_UNSPECIFIED => 'FILE_INPUT_TYPE_UNSPECIFIED',
        self::UPLOAD => 'UPLOAD',
        self::FETCH => 'FETCH',
        self::GOOGLE_SHEETS => 'GOOGLE_SHEETS',
    ];

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

