<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/identity/accesscontextmanager/type/device_resources.proto

namespace Google\Identity\AccessContextManager\Type;

use UnexpectedValueException;

/**
 * The encryption state of the device.
 *
 * Protobuf type <code>google.identity.accesscontextmanager.type.DeviceEncryptionStatus</code>
 */
class DeviceEncryptionStatus
{
    /**
     * The encryption status of the device is not specified or not known.
     *
     * Generated from protobuf enum <code>ENCRYPTION_UNSPECIFIED = 0;</code>
     */
    const ENCRYPTION_UNSPECIFIED = 0;
    /**
     * The device does not support encryption.
     *
     * Generated from protobuf enum <code>ENCRYPTION_UNSUPPORTED = 1;</code>
     */
    const ENCRYPTION_UNSUPPORTED = 1;
    /**
     * The device supports encryption, but is currently unencrypted.
     *
     * Generated from protobuf enum <code>UNENCRYPTED = 2;</code>
     */
    const UNENCRYPTED = 2;
    /**
     * The device is encrypted.
     *
     * Generated from protobuf enum <code>ENCRYPTED = 3;</code>
     */
    const ENCRYPTED = 3;

    private static $valueToName = [
        self::ENCRYPTION_UNSPECIFIED => 'ENCRYPTION_UNSPECIFIED',
        self::ENCRYPTION_UNSUPPORTED => 'ENCRYPTION_UNSUPPORTED',
        self::UNENCRYPTED => 'UNENCRYPTED',
        self::ENCRYPTED => 'ENCRYPTED',
    ];

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

