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

namespace Google\Cloud\Dlp\V2\CharsToIgnore;

use UnexpectedValueException;

/**
 * Convenience enum for indication common characters to not transform.
 *
 * Protobuf type <code>google.privacy.dlp.v2.CharsToIgnore.CommonCharsToIgnore</code>
 */
class CommonCharsToIgnore
{
    /**
     * Unused.
     *
     * Generated from protobuf enum <code>COMMON_CHARS_TO_IGNORE_UNSPECIFIED = 0;</code>
     */
    const COMMON_CHARS_TO_IGNORE_UNSPECIFIED = 0;
    /**
     * 0-9
     *
     * Generated from protobuf enum <code>NUMERIC = 1;</code>
     */
    const NUMERIC = 1;
    /**
     * A-Z
     *
     * Generated from protobuf enum <code>ALPHA_UPPER_CASE = 2;</code>
     */
    const ALPHA_UPPER_CASE = 2;
    /**
     * a-z
     *
     * Generated from protobuf enum <code>ALPHA_LOWER_CASE = 3;</code>
     */
    const ALPHA_LOWER_CASE = 3;
    /**
     * US Punctuation, one of !"#$%&'()*+,-./:;<=>?&#64;[\]^_`{|}~
     *
     * Generated from protobuf enum <code>PUNCTUATION = 4;</code>
     */
    const PUNCTUATION = 4;
    /**
     * Whitespace character, one of [ \t\n\x0B\f\r]
     *
     * Generated from protobuf enum <code>WHITESPACE = 5;</code>
     */
    const WHITESPACE = 5;

    private static $valueToName = [
        self::COMMON_CHARS_TO_IGNORE_UNSPECIFIED => 'COMMON_CHARS_TO_IGNORE_UNSPECIFIED',
        self::NUMERIC => 'NUMERIC',
        self::ALPHA_UPPER_CASE => 'ALPHA_UPPER_CASE',
        self::ALPHA_LOWER_CASE => 'ALPHA_LOWER_CASE',
        self::PUNCTUATION => 'PUNCTUATION',
        self::WHITESPACE => 'WHITESPACE',
    ];

    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(CommonCharsToIgnore::class, \Google\Cloud\Dlp\V2\CharsToIgnore_CommonCharsToIgnore::class);

