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

namespace Google\Cloud\VMMigration\V1\AwsVmDetails;

use UnexpectedValueException;

/**
 * Possible values for the power state of the VM.
 *
 * Protobuf type <code>google.cloud.vmmigration.v1.AwsVmDetails.PowerState</code>
 */
class PowerState
{
    /**
     * Power state is not specified.
     *
     * Generated from protobuf enum <code>POWER_STATE_UNSPECIFIED = 0;</code>
     */
    const POWER_STATE_UNSPECIFIED = 0;
    /**
     * The VM is turned on.
     *
     * Generated from protobuf enum <code>ON = 1;</code>
     */
    const ON = 1;
    /**
     * The VM is turned off.
     *
     * Generated from protobuf enum <code>OFF = 2;</code>
     */
    const OFF = 2;
    /**
     * The VM is suspended. This is similar to hibernation or sleep
     * mode.
     *
     * Generated from protobuf enum <code>SUSPENDED = 3;</code>
     */
    const SUSPENDED = 3;
    /**
     * The VM is starting.
     *
     * Generated from protobuf enum <code>PENDING = 4;</code>
     */
    const PENDING = 4;

    private static $valueToName = [
        self::POWER_STATE_UNSPECIFIED => 'POWER_STATE_UNSPECIFIED',
        self::ON => 'ON',
        self::OFF => 'OFF',
        self::SUSPENDED => 'SUSPENDED',
        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);
    }
}


