<?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;

/**
 * The status of a backup run.
 *
 * Protobuf type <code>google.cloud.sql.v1beta4.SqlBackupRunStatus</code>
 */
class SqlBackupRunStatus
{
    /**
     * The status of the run is unknown.
     *
     * Generated from protobuf enum <code>SQL_BACKUP_RUN_STATUS_UNSPECIFIED = 0;</code>
     */
    const SQL_BACKUP_RUN_STATUS_UNSPECIFIED = 0;
    /**
     * The backup operation was enqueued.
     *
     * Generated from protobuf enum <code>ENQUEUED = 1;</code>
     */
    const ENQUEUED = 1;
    /**
     * The backup is overdue across a given backup window. Indicates a
     * problem. Example: Long-running operation in progress during
     * the whole window.
     *
     * Generated from protobuf enum <code>OVERDUE = 2;</code>
     */
    const OVERDUE = 2;
    /**
     * The backup is in progress.
     *
     * Generated from protobuf enum <code>RUNNING = 3;</code>
     */
    const RUNNING = 3;
    /**
     * The backup failed.
     *
     * Generated from protobuf enum <code>FAILED = 4;</code>
     */
    const FAILED = 4;
    /**
     * The backup was successful.
     *
     * Generated from protobuf enum <code>SUCCESSFUL = 5;</code>
     */
    const SUCCESSFUL = 5;
    /**
     * The backup was skipped (without problems) for a given backup
     * window. Example: Instance was idle.
     *
     * Generated from protobuf enum <code>SKIPPED = 6;</code>
     */
    const SKIPPED = 6;
    /**
     * The backup is about to be deleted.
     *
     * Generated from protobuf enum <code>DELETION_PENDING = 7;</code>
     */
    const DELETION_PENDING = 7;
    /**
     * The backup deletion failed.
     *
     * Generated from protobuf enum <code>DELETION_FAILED = 8;</code>
     */
    const DELETION_FAILED = 8;
    /**
     * The backup has been deleted.
     *
     * Generated from protobuf enum <code>DELETED = 9;</code>
     */
    const DELETED = 9;

    private static $valueToName = [
        self::SQL_BACKUP_RUN_STATUS_UNSPECIFIED => 'SQL_BACKUP_RUN_STATUS_UNSPECIFIED',
        self::ENQUEUED => 'ENQUEUED',
        self::OVERDUE => 'OVERDUE',
        self::RUNNING => 'RUNNING',
        self::FAILED => 'FAILED',
        self::SUCCESSFUL => 'SUCCESSFUL',
        self::SKIPPED => 'SKIPPED',
        self::DELETION_PENDING => 'DELETION_PENDING',
        self::DELETION_FAILED => 'DELETION_FAILED',
        self::DELETED => 'DELETED',
    ];

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

