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

namespace Google\Cloud\CloudControlsPartner\V1beta\Violation;

use UnexpectedValueException;

/**
 * Violation State Values
 *
 * Protobuf type <code>google.cloud.cloudcontrolspartner.v1beta.Violation.State</code>
 */
class State
{
    /**
     * Unspecified state.
     *
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
     */
    const STATE_UNSPECIFIED = 0;
    /**
     * Violation is resolved.
     *
     * Generated from protobuf enum <code>RESOLVED = 1;</code>
     */
    const RESOLVED = 1;
    /**
     * Violation is Unresolved
     *
     * Generated from protobuf enum <code>UNRESOLVED = 2;</code>
     */
    const UNRESOLVED = 2;
    /**
     * Violation is Exception
     *
     * Generated from protobuf enum <code>EXCEPTION = 3;</code>
     */
    const EXCEPTION = 3;

    private static $valueToName = [
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::RESOLVED => 'RESOLVED',
        self::UNRESOLVED => 'UNRESOLVED',
        self::EXCEPTION => 'EXCEPTION',
    ];

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

