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

namespace Google\Cloud\AuditManager\V1;

use UnexpectedValueException;

/**
 * The compliance state after evaluation.
 *
 * Protobuf type <code>google.cloud.auditmanager.v1.ComplianceState</code>
 */
class ComplianceState
{
    /**
     * Unspecified. Invalid state.
     *
     * Generated from protobuf enum <code>COMPLIANCE_STATE_UNSPECIFIED = 0;</code>
     */
    const COMPLIANCE_STATE_UNSPECIFIED = 0;
    /**
     * Compliant.
     *
     * Generated from protobuf enum <code>COMPLIANT = 1;</code>
     */
    const COMPLIANT = 1;
    /**
     * Violation.
     *
     * Generated from protobuf enum <code>VIOLATION = 2;</code>
     */
    const VIOLATION = 2;
    /**
     * MANUAL_REVIEW_NEEDED, requires manual review
     *
     * Generated from protobuf enum <code>MANUAL_REVIEW_NEEDED = 3;</code>
     */
    const MANUAL_REVIEW_NEEDED = 3;
    /**
     * Error while computing status.
     *
     * Generated from protobuf enum <code>ERROR = 4;</code>
     */
    const ERROR = 4;
    /**
     * Cannot be audited
     *
     * Generated from protobuf enum <code>AUDIT_NOT_SUPPORTED = 5;</code>
     */
    const AUDIT_NOT_SUPPORTED = 5;

    private static $valueToName = [
        self::COMPLIANCE_STATE_UNSPECIFIED => 'COMPLIANCE_STATE_UNSPECIFIED',
        self::COMPLIANT => 'COMPLIANT',
        self::VIOLATION => 'VIOLATION',
        self::MANUAL_REVIEW_NEEDED => 'MANUAL_REVIEW_NEEDED',
        self::ERROR => 'ERROR',
        self::AUDIT_NOT_SUPPORTED => 'AUDIT_NOT_SUPPORTED',
    ];

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

