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

namespace Google\Cloud\VMMigration\V1\VmwareVmDetails;

use UnexpectedValueException;

/**
 * Possible values for the power state of the VM.
 *
 * Protobuf type <code>google.cloud.vmmigration.v1.VmwareVmDetails.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;

    private static $valueToName = [
        self::POWER_STATE_UNSPECIFIED => 'POWER_STATE_UNSPECIFIED',
        self::ON => 'ON',
        self::OFF => 'OFF',
        self::SUSPENDED => 'SUSPENDED',
    ];

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


