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

namespace Google\Cloud\AuditManager\V1\ResourceEnrollmentStatus;

use UnexpectedValueException;

/**
 * The different enrollment states of a resource.
 *
 * Protobuf type <code>google.cloud.auditmanager.v1.ResourceEnrollmentStatus.ResourceEnrollmentState</code>
 */
class ResourceEnrollmentState
{
    /**
     * Unspecified. Invalid state.
     *
     * Generated from protobuf enum <code>RESOURCE_ENROLLMENT_STATE_UNSPECIFIED = 0;</code>
     */
    const RESOURCE_ENROLLMENT_STATE_UNSPECIFIED = 0;
    /**
     * Not enrolled.
     *
     * Generated from protobuf enum <code>NOT_ENROLLED = 1;</code>
     */
    const NOT_ENROLLED = 1;
    /**
     * Resource is not enrolled but the parent is enrolled.
     *
     * Generated from protobuf enum <code>INHERITED = 2;</code>
     */
    const INHERITED = 2;
    /**
     * Enrolled.
     *
     * Generated from protobuf enum <code>ENROLLED = 3;</code>
     */
    const ENROLLED = 3;

    private static $valueToName = [
        self::RESOURCE_ENROLLMENT_STATE_UNSPECIFIED => 'RESOURCE_ENROLLMENT_STATE_UNSPECIFIED',
        self::NOT_ENROLLED => 'NOT_ENROLLED',
        self::INHERITED => 'INHERITED',
        self::ENROLLED => 'ENROLLED',
    ];

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

