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

namespace Google\Cloud\Datastore\V1\QueryResultBatch;

use UnexpectedValueException;

/**
 * The possible values for the `more_results` field.
 *
 * Protobuf type <code>google.datastore.v1.QueryResultBatch.MoreResultsType</code>
 */
class MoreResultsType
{
    /**
     * Unspecified. This value is never used.
     *
     * Generated from protobuf enum <code>MORE_RESULTS_TYPE_UNSPECIFIED = 0;</code>
     */
    const MORE_RESULTS_TYPE_UNSPECIFIED = 0;
    /**
     * There may be additional batches to fetch from this query.
     *
     * Generated from protobuf enum <code>NOT_FINISHED = 1;</code>
     */
    const NOT_FINISHED = 1;
    /**
     * The query is finished, but there may be more results after the limit.
     *
     * Generated from protobuf enum <code>MORE_RESULTS_AFTER_LIMIT = 2;</code>
     */
    const MORE_RESULTS_AFTER_LIMIT = 2;
    /**
     * The query is finished, but there may be more results after the end
     * cursor.
     *
     * Generated from protobuf enum <code>MORE_RESULTS_AFTER_CURSOR = 4;</code>
     */
    const MORE_RESULTS_AFTER_CURSOR = 4;
    /**
     * The query is finished, and there are no more results.
     *
     * Generated from protobuf enum <code>NO_MORE_RESULTS = 3;</code>
     */
    const NO_MORE_RESULTS = 3;

    private static $valueToName = [
        self::MORE_RESULTS_TYPE_UNSPECIFIED => 'MORE_RESULTS_TYPE_UNSPECIFIED',
        self::NOT_FINISHED => 'NOT_FINISHED',
        self::MORE_RESULTS_AFTER_LIMIT => 'MORE_RESULTS_AFTER_LIMIT',
        self::MORE_RESULTS_AFTER_CURSOR => 'MORE_RESULTS_AFTER_CURSOR',
        self::NO_MORE_RESULTS => 'NO_MORE_RESULTS',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(MoreResultsType::class, \Google\Cloud\Datastore\V1\QueryResultBatch_MoreResultsType::class);

