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

namespace Google\Cloud\Dialogflow\V2\AutomatedAgentReply;

use UnexpectedValueException;

/**
 * Represents different automated agent reply types.
 *
 * Protobuf type <code>google.cloud.dialogflow.v2.AutomatedAgentReply.AutomatedAgentReplyType</code>
 */
class AutomatedAgentReplyType
{
    /**
     * Not specified. This should never happen.
     *
     * Generated from protobuf enum <code>AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED = 0;</code>
     */
    const AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED = 0;
    /**
     * Partial reply. e.g. Aggregated responses in a `Fulfillment` that enables
     * `return_partial_response` can be returned as partial reply.
     * WARNING: partial reply is not eligible for barge-in.
     *
     * Generated from protobuf enum <code>PARTIAL = 1;</code>
     */
    const PARTIAL = 1;
    /**
     * Final reply.
     *
     * Generated from protobuf enum <code>FINAL = 2;</code>
     */
    const PBFINAL = 2;

    private static $valueToName = [
        self::AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED => 'AUTOMATED_AGENT_REPLY_TYPE_UNSPECIFIED',
        self::PARTIAL => 'PARTIAL',
        self::PBFINAL => 'FINAL',
    ];

    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)) {
            $pbconst =  __CLASS__. '::PB' . strtoupper($name);
            if (!defined($pbconst)) {
                throw new UnexpectedValueException(sprintf(
                        'Enum %s has no value defined for name %s', __CLASS__, $name));
            }
            return constant($pbconst);
        }
        return constant($const);
    }
}


