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

namespace Google\Cloud\BigQuery\DataTransfer\V1\ImportedDataInfo;

use UnexpectedValueException;

/**
 * Data format.
 *
 * Protobuf type <code>google.cloud.bigquery.datatransfer.v1.ImportedDataInfo.Format</code>
 */
class Format
{
    /**
     * Unspecified format. In this case, we have to infer the format from the
     * data source.
     *
     * Generated from protobuf enum <code>FORMAT_UNSPECIFIED = 0;</code>
     */
    const FORMAT_UNSPECIFIED = 0;
    /**
     * CSV format.
     *
     * Generated from protobuf enum <code>CSV = 1;</code>
     */
    const CSV = 1;
    /**
     * Newline-delimited JSON.
     *
     * Generated from protobuf enum <code>JSON = 2;</code>
     */
    const JSON = 2;
    /**
     * Avro format. See http://avro.apache.org .
     *
     * Generated from protobuf enum <code>AVRO = 3;</code>
     */
    const AVRO = 3;
    /**
     * RecordIO.
     *
     * Generated from protobuf enum <code>RECORDIO = 4;</code>
     */
    const RECORDIO = 4;
    /**
     * ColumnIO.
     *
     * Generated from protobuf enum <code>COLUMNIO = 5;</code>
     */
    const COLUMNIO = 5;
    /**
     * Capacitor.
     *
     * Generated from protobuf enum <code>CAPACITOR = 6;</code>
     */
    const CAPACITOR = 6;
    /**
     * Parquet format. See https://parquet.apache.org .
     *
     * Generated from protobuf enum <code>PARQUET = 7;</code>
     */
    const PARQUET = 7;
    /**
     * ORC format. See https://orc.apache.org .
     *
     * Generated from protobuf enum <code>ORC = 8;</code>
     */
    const ORC = 8;

    private static $valueToName = [
        self::FORMAT_UNSPECIFIED => 'FORMAT_UNSPECIFIED',
        self::CSV => 'CSV',
        self::JSON => 'JSON',
        self::AVRO => 'AVRO',
        self::RECORDIO => 'RECORDIO',
        self::COLUMNIO => 'COLUMNIO',
        self::CAPACITOR => 'CAPACITOR',
        self::PARQUET => 'PARQUET',
        self::ORC => 'ORC',
    ];

    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(Format::class, \Google\Cloud\BigQuery\DataTransfer\V1\ImportedDataInfo_Format::class);

