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

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

use UnexpectedValueException;

/**
 * The processing state of the data source.
 *
 * Protobuf type <code>google.shopping.merchant.datasources.v1.FileUpload.ProcessingState</code>
 */
class ProcessingState
{
    /**
     * Processing state unspecified.
     *
     * Generated from protobuf enum <code>PROCESSING_STATE_UNSPECIFIED = 0;</code>
     */
    const PROCESSING_STATE_UNSPECIFIED = 0;
    /**
     * The data source could not be processed or all the items had errors.
     *
     * Generated from protobuf enum <code>FAILED = 1;</code>
     */
    const FAILED = 1;
    /**
     * The data source is being processed.
     *
     * Generated from protobuf enum <code>IN_PROGRESS = 2;</code>
     */
    const IN_PROGRESS = 2;
    /**
     * The data source was processed successfully, though some items might have
     * had errors.
     *
     * Generated from protobuf enum <code>SUCCEEDED = 3;</code>
     */
    const SUCCEEDED = 3;

    private static $valueToName = [
        self::PROCESSING_STATE_UNSPECIFIED => 'PROCESSING_STATE_UNSPECIFIED',
        self::FAILED => 'FAILED',
        self::IN_PROGRESS => 'IN_PROGRESS',
        self::SUCCEEDED => 'SUCCEEDED',
    ];

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

