<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/talent/v4beta1/common.proto

namespace Google\Cloud\Talent\V4beta1;

use UnexpectedValueException;

/**
 * Option for HTML content sanitization on user input fields, for example, job
 * description. By setting this option, user can determine whether and how
 * sanitization is performed on these fields.
 *
 * Protobuf type <code>google.cloud.talent.v4beta1.HtmlSanitization</code>
 */
class HtmlSanitization
{
    /**
     * Default value.
     *
     * Generated from protobuf enum <code>HTML_SANITIZATION_UNSPECIFIED = 0;</code>
     */
    const HTML_SANITIZATION_UNSPECIFIED = 0;
    /**
     * Disables sanitization on HTML input.
     *
     * Generated from protobuf enum <code>HTML_SANITIZATION_DISABLED = 1;</code>
     */
    const HTML_SANITIZATION_DISABLED = 1;
    /**
     * Sanitizes HTML input, only accepts bold, italic, ordered list, and
     * unordered list markup tags.
     *
     * Generated from protobuf enum <code>SIMPLE_FORMATTING_ONLY = 2;</code>
     */
    const SIMPLE_FORMATTING_ONLY = 2;

    private static $valueToName = [
        self::HTML_SANITIZATION_UNSPECIFIED => 'HTML_SANITIZATION_UNSPECIFIED',
        self::HTML_SANITIZATION_DISABLED => 'HTML_SANITIZATION_DISABLED',
        self::SIMPLE_FORMATTING_ONLY => 'SIMPLE_FORMATTING_ONLY',
    ];

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

