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

namespace Google\Cloud\ModelArmor\V1;

use UnexpectedValueException;

/**
 * Option to specify filter match state.
 *
 * Protobuf type <code>google.cloud.modelarmor.v1.FilterMatchState</code>
 */
class FilterMatchState
{
    /**
     * Unused
     *
     * Generated from protobuf enum <code>FILTER_MATCH_STATE_UNSPECIFIED = 0;</code>
     */
    const FILTER_MATCH_STATE_UNSPECIFIED = 0;
    /**
     * Matching criteria is not achieved for filters.
     *
     * Generated from protobuf enum <code>NO_MATCH_FOUND = 1;</code>
     */
    const NO_MATCH_FOUND = 1;
    /**
     * Matching criteria is achieved for the filter.
     *
     * Generated from protobuf enum <code>MATCH_FOUND = 2;</code>
     */
    const MATCH_FOUND = 2;

    private static $valueToName = [
        self::FILTER_MATCH_STATE_UNSPECIFIED => 'FILTER_MATCH_STATE_UNSPECIFIED',
        self::NO_MATCH_FOUND => 'NO_MATCH_FOUND',
        self::MATCH_FOUND => 'MATCH_FOUND',
    ];

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

