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

namespace Google\Cloud\Dataplex\V1\Asset\SecurityStatus;

use UnexpectedValueException;

/**
 * The state of the security policy.
 *
 * Protobuf type <code>google.cloud.dataplex.v1.Asset.SecurityStatus.State</code>
 */
class State
{
    /**
     * State unspecified.
     *
     * Generated from protobuf enum <code>STATE_UNSPECIFIED = 0;</code>
     */
    const STATE_UNSPECIFIED = 0;
    /**
     * Security policy has been successfully applied to the attached resource.
     *
     * Generated from protobuf enum <code>READY = 1;</code>
     */
    const READY = 1;
    /**
     * Security policy is in the process of being applied to the attached
     * resource.
     *
     * Generated from protobuf enum <code>APPLYING = 2;</code>
     */
    const APPLYING = 2;
    /**
     * Security policy could not be applied to the attached resource due to
     * errors.
     *
     * Generated from protobuf enum <code>ERROR = 3;</code>
     */
    const ERROR = 3;

    private static $valueToName = [
        self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED',
        self::READY => 'READY',
        self::APPLYING => 'APPLYING',
        self::ERROR => 'ERROR',
    ];

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


