Environment Builder
class EnvironmentBuilder(baseEnvironment: BaseEnvironment) : IResourceBuilder<Environment>
Content copied to clipboard
Environment 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 workspace = Workspace()
val baseEnvironment = BaseEnvironment(workspace)
Environment.build(baseEnvironment) {
// setting up resource name
// next function call will rewrite previous value
name("Environment name")
name { "Environment name" }
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
// setting up environment color
// next function call will rewrite previous value
color("#FF00FF")
color { "#00FF00" }
// setting private value
// next function call will rewrite previous value
private(true)
private { true }
// setting environment resource position
// next function call will rewrite previous value
metaSortKey(10)
metaSortKey { 10 }
}
//sampleEnd
}