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

namespace Google\Cloud\AIPlatform\V1\NearestNeighborSearchOperationMetadata\RecordError;

use UnexpectedValueException;

/**
 * Protobuf type <code>google.cloud.aiplatform.v1.NearestNeighborSearchOperationMetadata.RecordError.RecordErrorType</code>
 */
class RecordErrorType
{
    /**
     * Default, shall not be used.
     *
     * Generated from protobuf enum <code>ERROR_TYPE_UNSPECIFIED = 0;</code>
     */
    const ERROR_TYPE_UNSPECIFIED = 0;
    /**
     * The record is empty.
     *
     * Generated from protobuf enum <code>EMPTY_LINE = 1;</code>
     */
    const EMPTY_LINE = 1;
    /**
     * Invalid json format.
     *
     * Generated from protobuf enum <code>INVALID_JSON_SYNTAX = 2;</code>
     */
    const INVALID_JSON_SYNTAX = 2;
    /**
     * Invalid csv format.
     *
     * Generated from protobuf enum <code>INVALID_CSV_SYNTAX = 3;</code>
     */
    const INVALID_CSV_SYNTAX = 3;
    /**
     * Invalid avro format.
     *
     * Generated from protobuf enum <code>INVALID_AVRO_SYNTAX = 4;</code>
     */
    const INVALID_AVRO_SYNTAX = 4;
    /**
     * The embedding id is not valid.
     *
     * Generated from protobuf enum <code>INVALID_EMBEDDING_ID = 5;</code>
     */
    const INVALID_EMBEDDING_ID = 5;
    /**
     * The size of the embedding vectors does not match with the specified
     * dimension.
     *
     * Generated from protobuf enum <code>EMBEDDING_SIZE_MISMATCH = 6;</code>
     */
    const EMBEDDING_SIZE_MISMATCH = 6;
    /**
     * The `namespace` field is missing.
     *
     * Generated from protobuf enum <code>NAMESPACE_MISSING = 7;</code>
     */
    const NAMESPACE_MISSING = 7;

    private static $valueToName = [
        self::ERROR_TYPE_UNSPECIFIED => 'ERROR_TYPE_UNSPECIFIED',
        self::EMPTY_LINE => 'EMPTY_LINE',
        self::INVALID_JSON_SYNTAX => 'INVALID_JSON_SYNTAX',
        self::INVALID_CSV_SYNTAX => 'INVALID_CSV_SYNTAX',
        self::INVALID_AVRO_SYNTAX => 'INVALID_AVRO_SYNTAX',
        self::INVALID_EMBEDDING_ID => 'INVALID_EMBEDDING_ID',
        self::EMBEDDING_SIZE_MISMATCH => 'EMBEDDING_SIZE_MISMATCH',
        self::NAMESPACE_MISSING => 'NAMESPACE_MISSING',
    ];

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


