All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cc.unitmesh.processor.api.postman.PostmanEnvironment.kt Maven / Gradle / Ivy

package cc.unitmesh.processor.api.postman

class PostmanEnvironment {
    var id: String? = null
    var name: String? = null
    var values: List? = null
    var timestamp: Long? = null
    var synced: Boolean? = null
    var lookup: MutableMap = HashMap()
    fun init() {
        for (`val` in values!!) {
            lookup[`val`.key] = `val`
        }
    }

    fun setEnvironmentVariable(key: String, value: String?) {
        val existingVar = lookup[key]
        if (existingVar != null) {
            // Update existing value if any
            existingVar.value = value
        } else {
            val newVar = PostmanEnvValue()
            newVar.key = key
            newVar.name = "RUNTIME-$key"
            newVar.type = "text"
            newVar.value = value
            lookup[key] = newVar
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy