<?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;

use UnexpectedValueException;

/**
 * Possible compliance states for an os policy.
 *
 * Protobuf type <code>google.cloud.osconfig.v1.OSPolicyAssignmentReport.OSPolicyCompliance.ComplianceState</code>
 */
class ComplianceState
{
    /**
     * The policy is in an unknown compliance state.
     * Refer to the field `compliance_state_reason` to learn the exact reason
     * for the policy to be in this compliance state.
     *
     * Generated from protobuf enum <code>UNKNOWN = 0;</code>
     */
    const UNKNOWN = 0;
    /**
     * Policy is compliant.
     * The policy is compliant if all the underlying resources are also
     * compliant.
     *
     * Generated from protobuf enum <code>COMPLIANT = 1;</code>
     */
    const COMPLIANT = 1;
    /**
     * Policy is non-compliant.
     * The policy is non-compliant if one or more underlying resources are
     * 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);
    }
}


