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

namespace Google\Cloud\AIPlatform\V1;

use UnexpectedValueException;

/**
 * Type contains the list of OpenAPI data types as defined by
 * https://swagger.io/docs/specification/data-models/data-types/
 *
 * Protobuf type <code>google.cloud.aiplatform.v1.Type</code>
 */
class Type
{
    /**
     * Not specified, should not be used.
     *
     * Generated from protobuf enum <code>TYPE_UNSPECIFIED = 0;</code>
     */
    const TYPE_UNSPECIFIED = 0;
    /**
     * OpenAPI string type
     *
     * Generated from protobuf enum <code>STRING = 1;</code>
     */
    const STRING = 1;
    /**
     * OpenAPI number type
     *
     * Generated from protobuf enum <code>NUMBER = 2;</code>
     */
    const NUMBER = 2;
    /**
     * OpenAPI integer type
     *
     * Generated from protobuf enum <code>INTEGER = 3;</code>
     */
    const INTEGER = 3;
    /**
     * OpenAPI boolean type
     *
     * Generated from protobuf enum <code>BOOLEAN = 4;</code>
     */
    const BOOLEAN = 4;
    /**
     * OpenAPI array type
     *
     * Generated from protobuf enum <code>ARRAY = 5;</code>
     */
    const PBARRAY = 5;
    /**
     * OpenAPI object type
     *
     * Generated from protobuf enum <code>OBJECT = 6;</code>
     */
    const OBJECT = 6;

    private static $valueToName = [
        self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED',
        self::STRING => 'STRING',
        self::NUMBER => 'NUMBER',
        self::INTEGER => 'INTEGER',
        self::BOOLEAN => 'BOOLEAN',
        self::PBARRAY => 'ARRAY',
        self::OBJECT => 'OBJECT',
    ];

    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)) {
            $pbconst =  __CLASS__. '::PB' . strtoupper($name);
            if (!defined($pbconst)) {
                throw new UnexpectedValueException(sprintf(
                        'Enum %s has no value defined for name %s', __CLASS__, $name));
            }
            return constant($pbconst);
        }
        return constant($const);
    }
}

