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

namespace Google\Cloud\Dialogflow\V2\Intent;

use UnexpectedValueException;

/**
 * Represents the different states that webhooks can be in.
 *
 * Protobuf type <code>google.cloud.dialogflow.v2.Intent.WebhookState</code>
 */
class WebhookState
{
    /**
     * Webhook is disabled in the agent and in the intent.
     *
     * Generated from protobuf enum <code>WEBHOOK_STATE_UNSPECIFIED = 0;</code>
     */
    const WEBHOOK_STATE_UNSPECIFIED = 0;
    /**
     * Webhook is enabled in the agent and in the intent.
     *
     * Generated from protobuf enum <code>WEBHOOK_STATE_ENABLED = 1;</code>
     */
    const WEBHOOK_STATE_ENABLED = 1;
    /**
     * Webhook is enabled in the agent and in the intent. Also, each slot
     * filling prompt is forwarded to the webhook.
     *
     * Generated from protobuf enum <code>WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING = 2;</code>
     */
    const WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING = 2;

    private static $valueToName = [
        self::WEBHOOK_STATE_UNSPECIFIED => 'WEBHOOK_STATE_UNSPECIFIED',
        self::WEBHOOK_STATE_ENABLED => 'WEBHOOK_STATE_ENABLED',
        self::WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING => 'WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING',
    ];

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


