RequestGroupBuilder

class RequestGroupBuilder(builder: CollectionBuilder, parent: IRequestGroupParent) : IResourceBuilder<RequestGroup>

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)

Functions

Link copied to clipboard
open override fun build(): RequestGroup
Link copied to clipboard
fun description(init: () -> String): RequestGroupBuilder
fun description(description: String): RequestGroupBuilder
Link copied to clipboard
fun env(init: () -> Pair<String, Any>): RequestGroupBuilder
fun env(key: String, value: Any): RequestGroupBuilder
Link copied to clipboard
fun metaSortKey(init: () -> Long): RequestGroupBuilder
fun metaSortKey(metaSortKey: Long): RequestGroupBuilder
Link copied to clipboard
fun name(init: () -> String): RequestGroupBuilder
fun name(name: String): RequestGroupBuilder
Link copied to clipboard
fun request(configure: RequestBuilder.() -> Unit): RequestGroupBuilder
Link copied to clipboard
fun requestGroup(init: RequestGroupBuilder.() -> Unit): RequestGroupBuilder
Link copied to clipboard
operator fun Pair<String, Any>.unaryPlus(): RequestGroupBuilder