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

namespace Google\Cloud\OracleDatabase\V1\AutonomousDatabaseBackupProperties;

use UnexpectedValueException;

/**
 * // The various lifecycle states of the Autonomous Database Backup.
 *
 * Protobuf type <code>google.cloud.oracledatabase.v1.AutonomousDatabaseBackupProperties.State</code>
 */
class State
{
    /**
     * Default unspecified value.
     *
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
     */
    const STATE_UNSPECIFIED = 0;
    /**
     * Indicates that the resource is in creating state.
     *
     * Generated from protobuf enum <code>CREATING = 1;</code>
     */
    const CREATING = 1;
    /**
     * Indicates that the resource is in active state.
     *
     * Generated from protobuf enum <code>ACTIVE = 2;</code>
     */
    const ACTIVE = 2;
    /**
     * Indicates that the resource is in deleting state.
     *
     * Generated from protobuf enum <code>DELETING = 3;</code>
     */
    const DELETING = 3;
    /**
     * Indicates that the resource is in deleted state.
     *
     * Generated from protobuf enum <code>DELETED = 4;</code>
     */
    const DELETED = 4;
    /**
     * Indicates that the resource is in failed state.
     *
     * Generated from protobuf enum <code>FAILED = 6;</code>
     */
    const FAILED = 6;
    /**
     * Indicates that the resource is in updating state.
     *
     * Generated from protobuf enum <code>UPDATING = 7;</code>
     */
    const UPDATING = 7;

    private static $valueToName = [
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::CREATING => 'CREATING',
        self::ACTIVE => 'ACTIVE',
        self::DELETING => 'DELETING',
        self::DELETED => 'DELETED',
        self::FAILED => 'FAILED',
        self::UPDATING => 'UPDATING',
    ];

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


