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

namespace Google\Cloud\ModelArmor\V1\ByteDataItem;

use UnexpectedValueException;

/**
 * Option to specify the type of byte data.
 *
 * Protobuf type <code>google.cloud.modelarmor.v1.ByteDataItem.ByteItemType</code>
 */
class ByteItemType
{
    /**
     * Unused
     *
     * Generated from protobuf enum <code>BYTE_ITEM_TYPE_UNSPECIFIED = 0;</code>
     */
    const BYTE_ITEM_TYPE_UNSPECIFIED = 0;
    /**
     * plain text
     *
     * Generated from protobuf enum <code>PLAINTEXT_UTF8 = 1;</code>
     */
    const PLAINTEXT_UTF8 = 1;
    /**
     * PDF
     *
     * Generated from protobuf enum <code>PDF = 2;</code>
     */
    const PDF = 2;
    /**
     * DOCX, DOCM, DOTX, DOTM
     *
     * Generated from protobuf enum <code>WORD_DOCUMENT = 3;</code>
     */
    const WORD_DOCUMENT = 3;
    /**
     * XLSX, XLSM, XLTX, XLYM
     *
     * Generated from protobuf enum <code>EXCEL_DOCUMENT = 4;</code>
     */
    const EXCEL_DOCUMENT = 4;
    /**
     * PPTX, PPTM, POTX, POTM, POT
     *
     * Generated from protobuf enum <code>POWERPOINT_DOCUMENT = 5;</code>
     */
    const POWERPOINT_DOCUMENT = 5;
    /**
     * TXT
     *
     * Generated from protobuf enum <code>TXT = 6;</code>
     */
    const TXT = 6;
    /**
     * CSV
     *
     * Generated from protobuf enum <code>CSV = 7;</code>
     */
    const CSV = 7;

    private static $valueToName = [
        self::BYTE_ITEM_TYPE_UNSPECIFIED => 'BYTE_ITEM_TYPE_UNSPECIFIED',
        self::PLAINTEXT_UTF8 => 'PLAINTEXT_UTF8',
        self::PDF => 'PDF',
        self::WORD_DOCUMENT => 'WORD_DOCUMENT',
        self::EXCEL_DOCUMENT => 'EXCEL_DOCUMENT',
        self::POWERPOINT_DOCUMENT => 'POWERPOINT_DOCUMENT',
        self::TXT => 'TXT',
        self::CSV => 'CSV',
    ];

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


