<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/privacy/dlp/v2/dlp.proto

namespace Google\Cloud\Dlp\V2;

use UnexpectedValueException;

/**
 * Type of the match which can be applied to different ways of matching, like
 * Dictionary, regular expression and intersecting with findings of another
 * info type.
 *
 * Protobuf type <code>google.privacy.dlp.v2.MatchingType</code>
 */
class MatchingType
{
    /**
     * Invalid.
     *
     * Generated from protobuf enum <code>MATCHING_TYPE_UNSPECIFIED = 0;</code>
     */
    const MATCHING_TYPE_UNSPECIFIED = 0;
    /**
     * Full match.
     * - Dictionary: join of Dictionary results matched complete finding quote
     * - Regex: all regex matches fill a finding quote start to end
     * - Exclude info type: completely inside affecting info types findings
     *
     * Generated from protobuf enum <code>MATCHING_TYPE_FULL_MATCH = 1;</code>
     */
    const MATCHING_TYPE_FULL_MATCH = 1;
    /**
     * Partial match.
     * - Dictionary: at least one of the tokens in the finding matches
     * - Regex: substring of the finding matches
     * - Exclude info type: intersects with affecting info types findings
     *
     * Generated from protobuf enum <code>MATCHING_TYPE_PARTIAL_MATCH = 2;</code>
     */
    const MATCHING_TYPE_PARTIAL_MATCH = 2;
    /**
     * Inverse match.
     * - Dictionary: no tokens in the finding match the dictionary
     * - Regex: finding doesn't match the regex
     * - Exclude info type: no intersection with affecting info types findings
     *
     * Generated from protobuf enum <code>MATCHING_TYPE_INVERSE_MATCH = 3;</code>
     */
    const MATCHING_TYPE_INVERSE_MATCH = 3;

    private static $valueToName = [
        self::MATCHING_TYPE_UNSPECIFIED => 'MATCHING_TYPE_UNSPECIFIED',
        self::MATCHING_TYPE_FULL_MATCH => 'MATCHING_TYPE_FULL_MATCH',
        self::MATCHING_TYPE_PARTIAL_MATCH => 'MATCHING_TYPE_PARTIAL_MATCH',
        self::MATCHING_TYPE_INVERSE_MATCH => 'MATCHING_TYPE_INVERSE_MATCH',
    ];

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

