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

namespace Google\Cloud\NetworkManagement\V1\VpcFlowLogsConfig;

use UnexpectedValueException;

/**
 * Optional states of the target resource that are used as part of the
 * diagnostic bit.
 *
 * Protobuf type <code>google.cloud.networkmanagement.v1.VpcFlowLogsConfig.TargetResourceState</code>
 */
class TargetResourceState
{
    /**
     * Unspecified target resource state.
     *
     * Generated from protobuf enum <code>TARGET_RESOURCE_STATE_UNSPECIFIED = 0;</code>
     */
    const TARGET_RESOURCE_STATE_UNSPECIFIED = 0;
    /**
     * Indicates that the target resource exists.
     *
     * Generated from protobuf enum <code>TARGET_RESOURCE_EXISTS = 1;</code>
     */
    const TARGET_RESOURCE_EXISTS = 1;
    /**
     * Indicates that the target resource does not exist.
     *
     * Generated from protobuf enum <code>TARGET_RESOURCE_DOES_NOT_EXIST = 2;</code>
     */
    const TARGET_RESOURCE_DOES_NOT_EXIST = 2;

    private static $valueToName = [
        self::TARGET_RESOURCE_STATE_UNSPECIFIED => 'TARGET_RESOURCE_STATE_UNSPECIFIED',
        self::TARGET_RESOURCE_EXISTS => 'TARGET_RESOURCE_EXISTS',
        self::TARGET_RESOURCE_DOES_NOT_EXIST => 'TARGET_RESOURCE_DOES_NOT_EXIST',
    ];

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


