<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/channel/v1/offers.proto

namespace Google\Cloud\Channel\V1\ParameterDefinition;

use UnexpectedValueException;

/**
 * Data type of the parameter.
 *
 * Protobuf type <code>google.cloud.channel.v1.ParameterDefinition.ParameterType</code>
 */
class ParameterType
{
    /**
     * Not used.
     *
     * Generated from protobuf enum <code>PARAMETER_TYPE_UNSPECIFIED = 0;</code>
     */
    const PARAMETER_TYPE_UNSPECIFIED = 0;
    /**
     * Int64 type.
     *
     * Generated from protobuf enum <code>INT64 = 1;</code>
     */
    const INT64 = 1;
    /**
     * String type.
     *
     * Generated from protobuf enum <code>STRING = 2;</code>
     */
    const STRING = 2;
    /**
     * Double type.
     *
     * Generated from protobuf enum <code>DOUBLE = 3;</code>
     */
    const DOUBLE = 3;

    private static $valueToName = [
        self::PARAMETER_TYPE_UNSPECIFIED => 'PARAMETER_TYPE_UNSPECIFIED',
        self::INT64 => 'INT64',
        self::STRING => 'STRING',
        self::DOUBLE => 'DOUBLE',
    ];

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


