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

namespace Google\Cloud\Dialogflow\V2;

use UnexpectedValueException;

/**
 * Represents the options for views of an intent.
 * An intent can be a sizable object. Therefore, we provide a resource view that
 * does not return training phrases in the response by default.
 *
 * Protobuf type <code>google.cloud.dialogflow.v2.IntentView</code>
 */
class IntentView
{
    /**
     * Training phrases field is not populated in the response.
     *
     * Generated from protobuf enum <code>INTENT_VIEW_UNSPECIFIED = 0;</code>
     */
    const INTENT_VIEW_UNSPECIFIED = 0;
    /**
     * All fields are populated.
     *
     * Generated from protobuf enum <code>INTENT_VIEW_FULL = 1;</code>
     */
    const INTENT_VIEW_FULL = 1;

    private static $valueToName = [
        self::INTENT_VIEW_UNSPECIFIED => 'INTENT_VIEW_UNSPECIFIED',
        self::INTENT_VIEW_FULL => 'INTENT_VIEW_FULL',
    ];

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

