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

namespace Google\Cloud\Sql\V1beta4;

use UnexpectedValueException;

/**
 * Protobuf type <code>google.cloud.sql.v1beta4.SqlFileType</code>
 */
class SqlFileType
{
    /**
     * Unknown file type.
     *
     * Generated from protobuf enum <code>SQL_FILE_TYPE_UNSPECIFIED = 0;</code>
     */
    const SQL_FILE_TYPE_UNSPECIFIED = 0;
    /**
     * File containing SQL statements.
     *
     * Generated from protobuf enum <code>SQL = 1;</code>
     */
    const SQL = 1;
    /**
     * File in CSV format.
     *
     * Generated from protobuf enum <code>CSV = 2;</code>
     */
    const CSV = 2;
    /**
     * Generated from protobuf enum <code>BAK = 4;</code>
     */
    const BAK = 4;

    private static $valueToName = [
        self::SQL_FILE_TYPE_UNSPECIFIED => 'SQL_FILE_TYPE_UNSPECIFIED',
        self::SQL => 'SQL',
        self::CSV => 'CSV',
        self::BAK => 'BAK',
    ];

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

