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

namespace Google\Cloud\Dialogflow\V2\Conversation\ContextReference\ContextContent;

use UnexpectedValueException;

/**
 * Represents the format of the ingested string.
 *
 * Protobuf type <code>google.cloud.dialogflow.v2.Conversation.ContextReference.ContextContent.ContentFormat</code>
 */
class ContentFormat
{
    /**
     * Unspecified content format.
     *
     * Generated from protobuf enum <code>CONTENT_FORMAT_UNSPECIFIED = 0;</code>
     */
    const CONTENT_FORMAT_UNSPECIFIED = 0;
    /**
     * Content was provided in JSON format.
     *
     * Generated from protobuf enum <code>JSON = 1;</code>
     */
    const JSON = 1;
    /**
     * Content was provided as plain text.
     *
     * Generated from protobuf enum <code>PLAIN_TEXT = 2;</code>
     */
    const PLAIN_TEXT = 2;

    private static $valueToName = [
        self::CONTENT_FORMAT_UNSPECIFIED => 'CONTENT_FORMAT_UNSPECIFIED',
        self::JSON => 'JSON',
        self::PLAIN_TEXT => 'PLAIN_TEXT',
    ];

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


