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

namespace Google\Cloud\Compute\V1\Autoscaler;

use UnexpectedValueException;

/**
 * [Output Only] The status of the autoscaler configuration. Current set of
 * possible values:
 *    - PENDING:
 *      Autoscaler backend hasn't read new/updated configuration.
 *    - DELETING:
 *      Configuration is being deleted.
 *    - ACTIVE:
 *      Configuration is acknowledged to be effective. Some warnings might
 *      be present in the statusDetails field.
 *    - ERROR:
 *      Configuration has errors. Actionable for users. Details are present in
 *      the statusDetails field.
 * New values might be added in the future.
 *
 * Protobuf type <code>google.cloud.compute.v1.Autoscaler.Status</code>
 */
class Status
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_STATUS = 0;</code>
     */
    const UNDEFINED_STATUS = 0;
    /**
     * Configuration is acknowledged to be effective
     *
     * Generated from protobuf enum <code>ACTIVE = 314733318;</code>
     */
    const ACTIVE = 314733318;
    /**
     * Configuration is being deleted
     *
     * Generated from protobuf enum <code>DELETING = 528602024;</code>
     */
    const DELETING = 528602024;
    /**
     * Configuration has errors. Actionable for users.
     *
     * Generated from protobuf enum <code>ERROR = 66247144;</code>
     */
    const ERROR = 66247144;
    /**
     * Autoscaler backend hasn't read new/updated configuration
     *
     * Generated from protobuf enum <code>PENDING = 35394935;</code>
     */
    const PENDING = 35394935;

    private static $valueToName = [
        self::UNDEFINED_STATUS => 'UNDEFINED_STATUS',
        self::ACTIVE => 'ACTIVE',
        self::DELETING => 'DELETING',
        self::ERROR => 'ERROR',
        self::PENDING => 'PENDING',
    ];

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

