Request Group Builder
class RequestGroupBuilder(builder: CollectionBuilder, parent: IRequestGroupParent) : IResourceBuilder<RequestGroup>
Content copied to clipboard
RequestGroup 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()
RequestGroup.build(collectionBuilder, workspace) {
// setting up group name
// next function call will rewrite previous value
name("My group name")
name { "My group name" }
// setting up workspace description
// next function call will rewrite previous value
description("About group")
description { "About group" }
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 group resource position
// next function call will rewrite previous value
metaSortKey(10)
metaSortKey { 10 }
// added new nested request group
requestGroup {
// RequestGroup resource DSL is available here
}
// added new request
request {
// Request resource DSL is available here
}
}
//sampleEnd
}
Constructors
Link copied to clipboard
fun RequestGroupBuilder(builder: CollectionBuilder, parent: IRequestGroupParent)
Content copied to clipboard
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun requestGroup(init: RequestGroupBuilder.() -> Unit): RequestGroupBuilder
Content copied to clipboard