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

namespace Google\Cloud\Dialogflow\V2\NotificationConfig;

use UnexpectedValueException;

/**
 * Format of cloud pub/sub message.
 *
 * Protobuf type <code>google.cloud.dialogflow.v2.NotificationConfig.MessageFormat</code>
 */
class MessageFormat
{
    /**
     * If it is unspecified, PROTO will be used.
     *
     * Generated from protobuf enum <code>MESSAGE_FORMAT_UNSPECIFIED = 0;</code>
     */
    const MESSAGE_FORMAT_UNSPECIFIED = 0;
    /**
     * Pub/Sub message will be serialized proto.
     *
     * Generated from protobuf enum <code>PROTO = 1;</code>
     */
    const PROTO = 1;
    /**
     * Pub/Sub message will be json.
     *
     * Generated from protobuf enum <code>JSON = 2;</code>
     */
    const JSON = 2;

    private static $valueToName = [
        self::MESSAGE_FORMAT_UNSPECIFIED => 'MESSAGE_FORMAT_UNSPECIFIED',
        self::PROTO => 'PROTO',
        self::JSON => 'JSON',
    ];

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


