BaseEnvironmentBuilder

class BaseEnvironmentBuilder(builder: CollectionBuilder, workspace: Workspace) : IResourceBuilder<BaseEnvironment>

BaseEnvironment resource builder

Samples

import com.yamilovs.insomnia.exporter.model.*
import com.yamilovs.insomnia.exporter.model.Collection
import com.yamilovs.insomnia.exporter.model.request.FollowRedirect
import com.yamilovs.insomnia.exporter.model.request.Method
import com.yamilovs.insomnia.exporter.model.request.authentication.EmptyAuthentication
import com.yamilovs.insomnia.exporter.model.request.body.EmptyBody
import com.yamilovs.insomnia.exporter.model.request.header.Header
import com.yamilovs.insomnia.exporter.model.request.parameter.Parameter
import java.net.URL
fun main() { 
   //sampleStart 
   val collectionBuilder = CollectionBuilder()
val workspace = Workspace()

BaseEnvironment.build(collectionBuilder, workspace) {

    env("BASE_URL", "https://yamilovs.com") // added first env value
    env { "USERNAME" to "yamilovs" } // added second env value
    +("PASSWORD" to "qwerty") // added third env value

    // added nested environment
    environment {
        // Environment resource DSL is available here
    }
} 
   //sampleEnd
}

Constructors

Link copied to clipboard
fun BaseEnvironmentBuilder(builder: CollectionBuilder, workspace: Workspace)

Functions

Link copied to clipboard
open override fun build(): BaseEnvironment
Link copied to clipboard
fun env(init: () -> Pair<String, Any>): BaseEnvironmentBuilder
fun env(key: String, value: Any): BaseEnvironmentBuilder
Link copied to clipboard
fun environment(configure: EnvironmentBuilder.() -> Unit = {}): BaseEnvironmentBuilder
Link copied to clipboard
operator fun Pair<String, Any>.unaryPlus(): BaseEnvironmentBuilder