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

namespace Google\Cloud\DataCatalog\V1\ColumnSchema;

use UnexpectedValueException;

/**
 * Specifies inclusion of the column in an index
 *
 * Protobuf type <code>google.cloud.datacatalog.v1.ColumnSchema.IndexingType</code>
 */
class IndexingType
{
    /**
     * Unspecified.
     *
     * Generated from protobuf enum <code>INDEXING_TYPE_UNSPECIFIED = 0;</code>
     */
    const INDEXING_TYPE_UNSPECIFIED = 0;
    /**
     * Column not a part of an index.
     *
     * Generated from protobuf enum <code>INDEXING_TYPE_NONE = 1;</code>
     */
    const INDEXING_TYPE_NONE = 1;
    /**
     * Column Part of non unique index.
     *
     * Generated from protobuf enum <code>INDEXING_TYPE_NON_UNIQUE = 2;</code>
     */
    const INDEXING_TYPE_NON_UNIQUE = 2;
    /**
     * Column part of unique index.
     *
     * Generated from protobuf enum <code>INDEXING_TYPE_UNIQUE = 3;</code>
     */
    const INDEXING_TYPE_UNIQUE = 3;
    /**
     * Column part of the primary key.
     *
     * Generated from protobuf enum <code>INDEXING_TYPE_PRIMARY_KEY = 4;</code>
     */
    const INDEXING_TYPE_PRIMARY_KEY = 4;

    private static $valueToName = [
        self::INDEXING_TYPE_UNSPECIFIED => 'INDEXING_TYPE_UNSPECIFIED',
        self::INDEXING_TYPE_NONE => 'INDEXING_TYPE_NONE',
        self::INDEXING_TYPE_NON_UNIQUE => 'INDEXING_TYPE_NON_UNIQUE',
        self::INDEXING_TYPE_UNIQUE => 'INDEXING_TYPE_UNIQUE',
        self::INDEXING_TYPE_PRIMARY_KEY => 'INDEXING_TYPE_PRIMARY_KEY',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(IndexingType::class, \Google\Cloud\DataCatalog\V1\ColumnSchema_IndexingType::class);

