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

namespace Google\Cloud\Dataform\V1beta1\CompilationResultAction\Relation;

use UnexpectedValueException;

/**
 * Supported file formats for BigQuery tables.
 *
 * Protobuf type <code>google.cloud.dataform.v1beta1.CompilationResultAction.Relation.FileFormat</code>
 */
class FileFormat
{
    /**
     * Default value.
     *
     * Generated from protobuf enum <code>FILE_FORMAT_UNSPECIFIED = 0;</code>
     */
    const FILE_FORMAT_UNSPECIFIED = 0;
    /**
     * Apache Parquet format.
     *
     * Generated from protobuf enum <code>PARQUET = 1;</code>
     */
    const PARQUET = 1;

    private static $valueToName = [
        self::FILE_FORMAT_UNSPECIFIED => 'FILE_FORMAT_UNSPECIFIED',
        self::PARQUET => 'PARQUET',
    ];

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

