<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/privacy/dlp/v2/dlp.proto

namespace Google\Cloud\Dlp\V2;

use UnexpectedValueException;

/**
 * State of a StoredInfoType version.
 *
 * Protobuf type <code>google.privacy.dlp.v2.StoredInfoTypeState</code>
 */
class StoredInfoTypeState
{
    /**
     * Unused
     *
     * Generated from protobuf enum <code>STORED_INFO_TYPE_STATE_UNSPECIFIED = 0;</code>
     */
    const STORED_INFO_TYPE_STATE_UNSPECIFIED = 0;
    /**
     * StoredInfoType version is being created.
     *
     * Generated from protobuf enum <code>PENDING = 1;</code>
     */
    const PENDING = 1;
    /**
     * StoredInfoType version is ready for use.
     *
     * Generated from protobuf enum <code>READY = 2;</code>
     */
    const READY = 2;
    /**
     * StoredInfoType creation failed. All relevant error messages are returned in
     * the `StoredInfoTypeVersion` message.
     *
     * Generated from protobuf enum <code>FAILED = 3;</code>
     */
    const FAILED = 3;
    /**
     * StoredInfoType is no longer valid because artifacts stored in
     * user-controlled storage were modified. To fix an invalid StoredInfoType,
     * use the `UpdateStoredInfoType` method to create a new version.
     *
     * Generated from protobuf enum <code>INVALID = 4;</code>
     */
    const INVALID = 4;

    private static $valueToName = [
        self::STORED_INFO_TYPE_STATE_UNSPECIFIED => 'STORED_INFO_TYPE_STATE_UNSPECIFIED',
        self::PENDING => 'PENDING',
        self::READY => 'READY',
        self::FAILED => 'FAILED',
        self::INVALID => 'INVALID',
    ];

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

