Gatling Pagination testing

Say, I have such json coming from my web service
https://gist.github.com/johnyUA/93eb7a1d0e7696a3e6c2

To get such response, I need to call web service by url:

/api/adminunits

I will receive paged result, with 20 elements batch,

Each resource will have uri field, which I can use to call resource by ID request

/api/adminunits/1

I want to test each of adminunits to be sure, that everything goes fine.
I suppose, I need to have double loop, one for calling /adminunits?offset=startPosition+limit
and another for calling each of 20 resources.

Where can I read documentation for this looping ?)

Maybe asLongAs function can help me - but I din’t found any example on how to use it.

Why not do something like this

`
val httpProtocol = http
.baseUrl("/api/adminunits")

//Get all the uri’s from jsonpath
exec(http (“mybaseurl”)
.get("/")
.check (jsonPath("""$…uri""").findAll.saveAs(“uris”)))

.foreach("${uris}", “uri”) {
exec(http(“get uri”)
.get("${uri}"))
}

`

Source http://gatling.io/docs/2.1.3/http/http_check.html?highlight=jsonpath.