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

namespace Google\Cloud\DocumentAI\V1\Document\Provenance;

use UnexpectedValueException;

/**
 * If a processor or agent does an explicit operation on existing elements.
 *
 * Protobuf type <code>google.cloud.documentai.v1.Document.Provenance.OperationType</code>
 */
class OperationType
{
    /**
     * Operation type unspecified. If no operation is specified a provenance
     * entry is simply used to match against a `parent`.
     *
     * Generated from protobuf enum <code>OPERATION_TYPE_UNSPECIFIED = 0;</code>
     */
    const OPERATION_TYPE_UNSPECIFIED = 0;
    /**
     * Add an element.
     *
     * Generated from protobuf enum <code>ADD = 1;</code>
     */
    const ADD = 1;
    /**
     * Remove an element identified by `parent`.
     *
     * Generated from protobuf enum <code>REMOVE = 2;</code>
     */
    const REMOVE = 2;
    /**
     * Updates any fields within the given provenance scope of the message. It
     * 'overwrites'  the fields rather than replacing them.  This is
     * especially relevant when we just want to update a field value of an
     * entity without also affecting all the child properties.
     *
     * Generated from protobuf enum <code>UPDATE = 7;</code>
     */
    const UPDATE = 7;
    /**
     * Currently unused. Replace an element identified by `parent`.
     *
     * Generated from protobuf enum <code>REPLACE = 3;</code>
     */
    const REPLACE = 3;
    /**
     * Deprecated. Request human review for the element identified by
     * `parent`.
     *
     * Generated from protobuf enum <code>EVAL_REQUESTED = 4 [deprecated = true];</code>
     */
    const EVAL_REQUESTED = 4;
    /**
     * Deprecated. Element is reviewed and approved at human review,
     * confidence will be set to 1.0.
     *
     * Generated from protobuf enum <code>EVAL_APPROVED = 5 [deprecated = true];</code>
     */
    const EVAL_APPROVED = 5;
    /**
     * Deprecated. Element is skipped in the validation process.
     *
     * Generated from protobuf enum <code>EVAL_SKIPPED = 6 [deprecated = true];</code>
     */
    const EVAL_SKIPPED = 6;

    private static $valueToName = [
        self::OPERATION_TYPE_UNSPECIFIED => 'OPERATION_TYPE_UNSPECIFIED',
        self::ADD => 'ADD',
        self::REMOVE => 'REMOVE',
        self::UPDATE => 'UPDATE',
        self::REPLACE => 'REPLACE',
        self::EVAL_REQUESTED => 'EVAL_REQUESTED',
        self::EVAL_APPROVED => 'EVAL_APPROVED',
        self::EVAL_SKIPPED => 'EVAL_SKIPPED',
    ];

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


