<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/logging/v2/logging_config.proto

namespace Google\Cloud\Logging\V2;

use UnexpectedValueException;

/**
 * LogBucket lifecycle states.
 *
 * Protobuf type <code>google.logging.v2.LifecycleState</code>
 */
class LifecycleState
{
    /**
     * Unspecified state. This is only used/useful for distinguishing unset
     * values.
     *
     * Generated from protobuf enum <code>LIFECYCLE_STATE_UNSPECIFIED = 0;</code>
     */
    const LIFECYCLE_STATE_UNSPECIFIED = 0;
    /**
     * The normal and active state.
     *
     * Generated from protobuf enum <code>ACTIVE = 1;</code>
     */
    const ACTIVE = 1;
    /**
     * The resource has been marked for deletion by the user. For some resources
     * (e.g. buckets), this can be reversed by an un-delete operation.
     *
     * Generated from protobuf enum <code>DELETE_REQUESTED = 2;</code>
     */
    const DELETE_REQUESTED = 2;

    private static $valueToName = [
        self::LIFECYCLE_STATE_UNSPECIFIED => 'LIFECYCLE_STATE_UNSPECIFIED',
        self::ACTIVE => 'ACTIVE',
        self::DELETE_REQUESTED => 'DELETE_REQUESTED',
    ];

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

