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

namespace Google\Cloud\Dialogflow\V2\Agent;

use UnexpectedValueException;

/**
 * API version for the agent.
 *
 * Protobuf type <code>google.cloud.dialogflow.v2.Agent.ApiVersion</code>
 */
class ApiVersion
{
    /**
     * Not specified.
     *
     * Generated from protobuf enum <code>API_VERSION_UNSPECIFIED = 0;</code>
     */
    const API_VERSION_UNSPECIFIED = 0;
    /**
     * Legacy V1 API.
     *
     * Generated from protobuf enum <code>API_VERSION_V1 = 1;</code>
     */
    const API_VERSION_V1 = 1;
    /**
     * V2 API.
     *
     * Generated from protobuf enum <code>API_VERSION_V2 = 2;</code>
     */
    const API_VERSION_V2 = 2;
    /**
     * V2beta1 API.
     *
     * Generated from protobuf enum <code>API_VERSION_V2_BETA_1 = 3;</code>
     */
    const API_VERSION_V2_BETA_1 = 3;

    private static $valueToName = [
        self::API_VERSION_UNSPECIFIED => 'API_VERSION_UNSPECIFIED',
        self::API_VERSION_V1 => 'API_VERSION_V1',
        self::API_VERSION_V2 => 'API_VERSION_V2',
        self::API_VERSION_V2_BETA_1 => 'API_VERSION_V2_BETA_1',
    ];

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


