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

namespace Google\Cloud\Sql\V1;

use UnexpectedValueException;

/**
 * Protobuf type <code>google.cloud.sql.v1.BakType</code>
 */
class BakType
{
    /**
     * Default type.
     *
     * Generated from protobuf enum <code>BAK_TYPE_UNSPECIFIED = 0;</code>
     */
    const BAK_TYPE_UNSPECIFIED = 0;
    /**
     * Full backup.
     *
     * Generated from protobuf enum <code>FULL = 1;</code>
     */
    const FULL = 1;
    /**
     * Differential backup.
     *
     * Generated from protobuf enum <code>DIFF = 2;</code>
     */
    const DIFF = 2;
    /**
     * Transaction Log backup
     *
     * Generated from protobuf enum <code>TLOG = 3;</code>
     */
    const TLOG = 3;

    private static $valueToName = [
        self::BAK_TYPE_UNSPECIFIED => 'BAK_TYPE_UNSPECIFIED',
        self::FULL => 'FULL',
        self::DIFF => 'DIFF',
        self::TLOG => 'TLOG',
    ];

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

