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

namespace Google\Cloud\Dialogflow\V2\SearchKnowledgeRequest\SearchConfig\BoostSpecs\BoostSpec\ConditionBoostSpec\BoostControlSpec;

use UnexpectedValueException;

/**
 * The interpolation type to be applied. Default will be linear
 * (Piecewise Linear).
 *
 * Protobuf type <code>google.cloud.dialogflow.v2.SearchKnowledgeRequest.SearchConfig.BoostSpecs.BoostSpec.ConditionBoostSpec.BoostControlSpec.InterpolationType</code>
 */
class InterpolationType
{
    /**
     * Interpolation type is unspecified. In this case, it defaults to
     * Linear.
     *
     * Generated from protobuf enum <code>INTERPOLATION_TYPE_UNSPECIFIED = 0;</code>
     */
    const INTERPOLATION_TYPE_UNSPECIFIED = 0;
    /**
     * Piecewise linear interpolation will be applied.
     *
     * Generated from protobuf enum <code>LINEAR = 1;</code>
     */
    const LINEAR = 1;

    private static $valueToName = [
        self::INTERPOLATION_TYPE_UNSPECIFIED => 'INTERPOLATION_TYPE_UNSPECIFIED',
        self::LINEAR => 'LINEAR',
    ];

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

