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

namespace Google\Cloud\Asset\V1\TemporalAsset;

use UnexpectedValueException;

/**
 * State of prior asset.
 *
 * Protobuf type <code>google.cloud.asset.v1.TemporalAsset.PriorAssetState</code>
 */
class PriorAssetState
{
    /**
     * prior_asset is not applicable for the current asset.
     *
     * Generated from protobuf enum <code>PRIOR_ASSET_STATE_UNSPECIFIED = 0;</code>
     */
    const PRIOR_ASSET_STATE_UNSPECIFIED = 0;
    /**
     * prior_asset is populated correctly.
     *
     * Generated from protobuf enum <code>PRESENT = 1;</code>
     */
    const PRESENT = 1;
    /**
     * Failed to set prior_asset.
     *
     * Generated from protobuf enum <code>INVALID = 2;</code>
     */
    const INVALID = 2;
    /**
     * Current asset is the first known state.
     *
     * Generated from protobuf enum <code>DOES_NOT_EXIST = 3;</code>
     */
    const DOES_NOT_EXIST = 3;
    /**
     * prior_asset is a deletion.
     *
     * Generated from protobuf enum <code>DELETED = 4;</code>
     */
    const DELETED = 4;

    private static $valueToName = [
        self::PRIOR_ASSET_STATE_UNSPECIFIED => 'PRIOR_ASSET_STATE_UNSPECIFIED',
        self::PRESENT => 'PRESENT',
        self::INVALID => 'INVALID',
        self::DOES_NOT_EXIST => 'DOES_NOT_EXIST',
        self::DELETED => 'DELETED',
    ];

    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(PriorAssetState::class, \Google\Cloud\Asset\V1\TemporalAsset_PriorAssetState::class);

