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

namespace Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent\ContinuousValidationPodEvent;

use UnexpectedValueException;

/**
 * Audit time policy conformance verdict.
 *
 * Protobuf type <code>google.cloud.binaryauthorization.v1beta1.ContinuousValidationEvent.ContinuousValidationPodEvent.PolicyConformanceVerdict</code>
 */
class PolicyConformanceVerdict
{
    /**
     * We should always have a verdict. This is an error.
     *
     * Generated from protobuf enum <code>POLICY_CONFORMANCE_VERDICT_UNSPECIFIED = 0;</code>
     */
    const POLICY_CONFORMANCE_VERDICT_UNSPECIFIED = 0;
    /**
     * The pod violates the policy.
     *
     * Generated from protobuf enum <code>VIOLATES_POLICY = 1;</code>
     */
    const VIOLATES_POLICY = 1;

    private static $valueToName = [
        self::POLICY_CONFORMANCE_VERDICT_UNSPECIFIED => 'POLICY_CONFORMANCE_VERDICT_UNSPECIFIED',
        self::VIOLATES_POLICY => 'VIOLATES_POLICY',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(PolicyConformanceVerdict::class, \Google\Cloud\BinaryAuthorization\V1beta1\ContinuousValidationEvent_ContinuousValidationPodEvent_PolicyConformanceVerdict::class);

