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

namespace Google\Cloud\OsConfig\V1\OSPolicyAssignmentReport\OSPolicyCompliance\OSPolicyResourceCompliance;

use UnexpectedValueException;

/**
 * Possible compliance states for a resource.
 *
 * Protobuf type <code>google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.OSPolicyResourceCompliance.ComplianceState</code>
 */
class ComplianceState
{
    /**
     * The resource is in an unknown compliance state.
     * To get more details about why the policy is in this state, review
     * the output of the `compliance_state_reason` field.
     *
     * Generated from protobuf enum <code>UNKNOWN = 0;</code>
     */
    const UNKNOWN = 0;
    /**
     * Resource is compliant.
     *
     * Generated from protobuf enum <code>COMPLIANT = 1;</code>
     */
    const COMPLIANT = 1;
    /**
     * Resource is non-compliant.
     *
     * Generated from protobuf enum <code>NON_COMPLIANT = 2;</code>
     */
    const NON_COMPLIANT = 2;

    private static $valueToName = [
        self::UNKNOWN => 'UNKNOWN',
        self::COMPLIANT => 'COMPLIANT',
        self::NON_COMPLIANT => 'NON_COMPLIANT',
    ];

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


