diff --git a/lib/src/test/resources/example-union-types-ning-client.txt b/lib/src/test/resources/example-union-types-ning-client.txt index f6fa69815..5525b6853 100644 --- a/lib/src/test/resources/example-union-types-ning-client.txt +++ b/lib/src/test/resources/example-union-types-ning-client.txt @@ -373,9 +373,10 @@ package io.apibuilder.example.union.types.v0 { object Users extends Users { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.example.union.types.v0.models.User]] = { - _executeRequest("GET", s"/users", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/users", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.io.apibuilder.example.union.types.v0.Client.parseJson("Seq[io.apibuilder.example.union.types.v0.models.User]", r, _.validate[Seq[io.apibuilder.example.union.types.v0.models.User]]) case r => throw io.apibuilder.example.union.types.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri)) } @@ -383,9 +384,10 @@ package io.apibuilder.example.union.types.v0 { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.example.union.types.v0.models.User] = { - _executeRequest("GET", s"/users/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/users/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.io.apibuilder.example.union.types.v0.Client.parseJson("io.apibuilder.example.union.types.v0.models.User", r, _.validate[io.apibuilder.example.union.types.v0.models.User]) case r if r.getStatusCode == 404 => throw io.apibuilder.example.union.types.v0.errors.UnitResponse(r.getStatusCode) case r => throw io.apibuilder.example.union.types.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200, 404", requestUri = Some(r.getUri)) @@ -394,11 +396,12 @@ package io.apibuilder.example.union.types.v0 { override def post( user: io.apibuilder.example.union.types.v0.models.User, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.example.union.types.v0.models.User] = { val payload = play.api.libs.json.Json.toJson(user) - _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 201 => _root_.io.apibuilder.example.union.types.v0.Client.parseJson("io.apibuilder.example.union.types.v0.models.User", r, _.validate[io.apibuilder.example.union.types.v0.models.User]) case r => throw io.apibuilder.example.union.types.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 201", requestUri = Some(r.getUri)) } @@ -417,8 +420,8 @@ package io.apibuilder.example.union.types.v0 { } } - def _requestBuilder(method: String, path: String, requestHeaders: Seq[(String, String)]): RequestBuilder = { - val builder = new RequestBuilder(method) + def _requestBuilder(method: String, path: String, requestHeaders: Seq[(String, String)]): _root_.com.ning.http.client.RequestBuilder = { + val builder = new _root_.com.ning.http.client.RequestBuilder(method) .setUrl(baseUrl + path) .addHeader("User-Agent", Constants.UserAgent) .addHeader("X-Apidoc-Version", Constants.Version) @@ -447,7 +450,8 @@ package io.apibuilder.example.union.types.v0 { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.ning.http.client.Response] = { val allHeaders = body match { case None => requestHeaders @@ -465,7 +469,7 @@ package io.apibuilder.example.union.types.v0 { request.setBody(serialized) } - val finalRequest = requestWithParamsAndBody.build() + val finalRequest = requestModifier(requestWithParamsAndBody).build() _logRequest(finalRequest) val result = scala.concurrent.Promise[com.ning.http.client.Response]() @@ -535,17 +539,20 @@ package io.apibuilder.example.union.types.v0 { trait Users { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.example.union.types.v0.models.User]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.example.union.types.v0.models.User] def post( user: io.apibuilder.example.union.types.v0.models.User, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.example.union.types.v0.models.User] } diff --git a/lib/src/test/resources/example-union-types-play-23.txt b/lib/src/test/resources/example-union-types-play-23.txt index ec6899c1f..48b8cfd99 100644 --- a/lib/src/test/resources/example-union-types-play-23.txt +++ b/lib/src/test/resources/example-union-types-play-23.txt @@ -488,9 +488,10 @@ package io.apibuilder.example.union.types.v0 { object Users extends Users { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.example.union.types.v0.models.User]] = { - _executeRequest("GET", s"/users", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/users", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.example.union.types.v0.Client.parseJson("Seq[io.apibuilder.example.union.types.v0.models.User]", r, _.validate[Seq[io.apibuilder.example.union.types.v0.models.User]]) case r => throw io.apibuilder.example.union.types.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -498,9 +499,10 @@ package io.apibuilder.example.union.types.v0 { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.example.union.types.v0.models.User] = { - _executeRequest("GET", s"/users/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/users/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.example.union.types.v0.Client.parseJson("io.apibuilder.example.union.types.v0.models.User", r, _.validate[io.apibuilder.example.union.types.v0.models.User]) case r if r.status == 404 => throw io.apibuilder.example.union.types.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.example.union.types.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -509,11 +511,12 @@ package io.apibuilder.example.union.types.v0 { override def post( user: io.apibuilder.example.union.types.v0.models.User, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.example.union.types.v0.models.User] = { val payload = play.api.libs.json.Json.toJson(user) - _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 201 => _root_.io.apibuilder.example.union.types.v0.Client.parseJson("io.apibuilder.example.union.types.v0.models.User", r, _.validate[io.apibuilder.example.union.types.v0.models.User]) case r => throw io.apibuilder.example.union.types.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 201") } @@ -553,32 +556,41 @@ package io.apibuilder.example.union.types.v0 { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity ): scala.concurrent.Future[play.api.libs.ws.WSResponse] = { method.toUpperCase match { case "GET" => { - _logRequest("GET", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).get() + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("GET", request).get() } case "POST" => { - _logRequest("POST", _requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)).post(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)) + _logRequest("POST", request).post(body.getOrElse(play.api.libs.json.Json.obj())) } case "PUT" => { - _logRequest("PUT", _requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)).put(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)) + _logRequest("PUT", request).put(body.getOrElse(play.api.libs.json.Json.obj())) } case "PATCH" => { - _logRequest("PATCH", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).patch(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("PATCH", request).patch(body.getOrElse(play.api.libs.json.Json.obj())) } case "DELETE" => { - _logRequest("DELETE", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).delete() + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("DELETE", request).delete() } - case "HEAD" => { - _logRequest("HEAD", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).head() + case "HEAD" => { + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("HEAD", request).head() } - case "OPTIONS" => { - _logRequest("OPTIONS", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).options() + case "OPTIONS" => { + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("OPTIONS", request).options() } case _ => { - _logRequest(method, _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest(method, request) sys.error("Unsupported method[%s]".format(method)) } } @@ -630,17 +642,20 @@ package io.apibuilder.example.union.types.v0 { trait Users { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.example.union.types.v0.models.User]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.example.union.types.v0.models.User] def post( user: io.apibuilder.example.union.types.v0.models.User, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.example.union.types.v0.models.User] } diff --git a/lib/src/test/resources/generators/collection-json-defaults-ahc-client.txt b/lib/src/test/resources/generators/collection-json-defaults-ahc-client.txt index d8db6f841..ee84dfd87 100644 --- a/lib/src/test/resources/generators/collection-json-defaults-ahc-client.txt +++ b/lib/src/test/resources/generators/collection-json-defaults-ahc-client.txt @@ -146,11 +146,12 @@ package com.gilt.test.v0 { object Users extends Users { override def post( user: com.gilt.test.v0.models.User, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.gilt.test.v0.models.User] = { val payload = play.api.libs.json.Json.toJson(user) - _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 201 => _root_.com.gilt.test.v0.Client.parseJson("com.gilt.test.v0.models.User", r, _.validate[com.gilt.test.v0.models.User]) case r => throw com.gilt.test.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 201", requestUri = Some(r.getUri.toJavaNetURI)) } @@ -159,9 +160,10 @@ package com.gilt.test.v0 { @deprecated("to be removed") override def getByEmail( @deprecated email: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.gilt.test.v0.models.User] = { - _executeRequest("GET", s"/users/${_root_.com.gilt.test.v0.PathSegment.encode(email, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/users/${_root_.com.gilt.test.v0.PathSegment.encode(email, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.com.gilt.test.v0.Client.parseJson("com.gilt.test.v0.models.User", r, _.validate[com.gilt.test.v0.models.User]) case r => throw com.gilt.test.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri.toJavaNetURI)) } @@ -169,11 +171,12 @@ package com.gilt.test.v0 { override def patch( userPatch: com.gilt.test.v0.models.UserPatch, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.gilt.test.v0.models.User] = { val payload = play.api.libs.json.Json.toJson(userPatch) - _executeRequest("PATCH", s"/users", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("PATCH", s"/users", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.com.gilt.test.v0.Client.parseJson("com.gilt.test.v0.models.User", r, _.validate[com.gilt.test.v0.models.User]) case r => throw com.gilt.test.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri.toJavaNetURI)) } @@ -192,8 +195,8 @@ package com.gilt.test.v0 { } } - def _requestBuilder(method: String, path: String, requestHeaders: Seq[(String, String)]): RequestBuilder = { - val builder = new RequestBuilder(method) + def _requestBuilder(method: String, path: String, requestHeaders: Seq[(String, String)]): _root_.com.ning.http.client.RequestBuilder = { + val builder = new _root_.com.ning.http.client.RequestBuilder(method) .setUrl(baseUrl + path) .addHeader("User-Agent", Constants.UserAgent) .addHeader("X-Apidoc-Version", Constants.Version) @@ -220,7 +223,8 @@ package com.gilt.test.v0 { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[org.asynchttpclient.Response] = { val allHeaders = body match { case None => requestHeaders @@ -238,7 +242,7 @@ package com.gilt.test.v0 { request.setBody(serialized) } - val finalRequest = requestWithParamsAndBody.build() + val finalRequest = requestModifier(requestWithParamsAndBody).build() _logRequest(finalRequest) val result = scala.concurrent.Promise[org.asynchttpclient.Response]() @@ -307,18 +311,21 @@ package com.gilt.test.v0 { trait Users { def post( user: com.gilt.test.v0.models.User, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.gilt.test.v0.models.User] @deprecated("to be removed") def getByEmail( @deprecated email: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.gilt.test.v0.models.User] def patch( userPatch: com.gilt.test.v0.models.UserPatch, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.gilt.test.v0.models.User] } diff --git a/lib/src/test/resources/generators/collection-json-defaults-ning-client.txt b/lib/src/test/resources/generators/collection-json-defaults-ning-client.txt index a374b8f8b..d4a6b2705 100644 --- a/lib/src/test/resources/generators/collection-json-defaults-ning-client.txt +++ b/lib/src/test/resources/generators/collection-json-defaults-ning-client.txt @@ -146,11 +146,12 @@ package com.gilt.test.v0 { object Users extends Users { override def post( user: com.gilt.test.v0.models.User, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.gilt.test.v0.models.User] = { val payload = play.api.libs.json.Json.toJson(user) - _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 201 => _root_.com.gilt.test.v0.Client.parseJson("com.gilt.test.v0.models.User", r, _.validate[com.gilt.test.v0.models.User]) case r => throw com.gilt.test.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 201", requestUri = Some(r.getUri)) } @@ -159,9 +160,10 @@ package com.gilt.test.v0 { @deprecated("to be removed") override def getByEmail( @deprecated email: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.gilt.test.v0.models.User] = { - _executeRequest("GET", s"/users/${_root_.com.gilt.test.v0.PathSegment.encode(email, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/users/${_root_.com.gilt.test.v0.PathSegment.encode(email, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.com.gilt.test.v0.Client.parseJson("com.gilt.test.v0.models.User", r, _.validate[com.gilt.test.v0.models.User]) case r => throw com.gilt.test.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri)) } @@ -169,11 +171,12 @@ package com.gilt.test.v0 { override def patch( userPatch: com.gilt.test.v0.models.UserPatch, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.gilt.test.v0.models.User] = { val payload = play.api.libs.json.Json.toJson(userPatch) - _executeRequest("PATCH", s"/users", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("PATCH", s"/users", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.com.gilt.test.v0.Client.parseJson("com.gilt.test.v0.models.User", r, _.validate[com.gilt.test.v0.models.User]) case r => throw com.gilt.test.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri)) } @@ -192,8 +195,8 @@ package com.gilt.test.v0 { } } - def _requestBuilder(method: String, path: String, requestHeaders: Seq[(String, String)]): RequestBuilder = { - val builder = new RequestBuilder(method) + def _requestBuilder(method: String, path: String, requestHeaders: Seq[(String, String)]): _root_.com.ning.http.client.RequestBuilder = { + val builder = new _root_.com.ning.http.client.RequestBuilder(method) .setUrl(baseUrl + path) .addHeader("User-Agent", Constants.UserAgent) .addHeader("X-Apidoc-Version", Constants.Version) @@ -222,7 +225,8 @@ package com.gilt.test.v0 { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.ning.http.client.Response] = { val allHeaders = body match { case None => requestHeaders @@ -240,7 +244,7 @@ package com.gilt.test.v0 { request.setBody(serialized) } - val finalRequest = requestWithParamsAndBody.build() + val finalRequest = requestModifier(requestWithParamsAndBody).build() _logRequest(finalRequest) val result = scala.concurrent.Promise[com.ning.http.client.Response]() @@ -311,18 +315,21 @@ package com.gilt.test.v0 { trait Users { def post( user: com.gilt.test.v0.models.User, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.gilt.test.v0.models.User] @deprecated("to be removed") def getByEmail( @deprecated email: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.gilt.test.v0.models.User] def patch( userPatch: com.gilt.test.v0.models.UserPatch, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.gilt.test.v0.models.User] } diff --git a/lib/src/test/resources/generators/collection-json-defaults-play-23.txt b/lib/src/test/resources/generators/collection-json-defaults-play-23.txt index 8eb574516..bf5a6a15e 100644 --- a/lib/src/test/resources/generators/collection-json-defaults-play-23.txt +++ b/lib/src/test/resources/generators/collection-json-defaults-play-23.txt @@ -238,11 +238,12 @@ package com.gilt.test.v0 { object Users extends Users { override def post( user: com.gilt.test.v0.models.User, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.gilt.test.v0.models.User] = { val payload = play.api.libs.json.Json.toJson(user) - _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 201 => _root_.com.gilt.test.v0.Client.parseJson("com.gilt.test.v0.models.User", r, _.validate[com.gilt.test.v0.models.User]) case r => throw com.gilt.test.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 201") } @@ -251,9 +252,10 @@ package com.gilt.test.v0 { @deprecated("to be removed") override def getByEmail( @deprecated email: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.gilt.test.v0.models.User] = { - _executeRequest("GET", s"/users/${play.utils.UriEncoding.encodePathSegment(email, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/users/${play.utils.UriEncoding.encodePathSegment(email, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.com.gilt.test.v0.Client.parseJson("com.gilt.test.v0.models.User", r, _.validate[com.gilt.test.v0.models.User]) case r => throw com.gilt.test.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -261,11 +263,12 @@ package com.gilt.test.v0 { override def patch( userPatch: com.gilt.test.v0.models.UserPatch, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.gilt.test.v0.models.User] = { val payload = play.api.libs.json.Json.toJson(userPatch) - _executeRequest("PATCH", s"/users", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("PATCH", s"/users", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.com.gilt.test.v0.Client.parseJson("com.gilt.test.v0.models.User", r, _.validate[com.gilt.test.v0.models.User]) case r => throw com.gilt.test.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -305,32 +308,41 @@ package com.gilt.test.v0 { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity ): scala.concurrent.Future[play.api.libs.ws.WSResponse] = { method.toUpperCase match { case "GET" => { - _logRequest("GET", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).get() + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("GET", request).get() } case "POST" => { - _logRequest("POST", _requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)).post(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)) + _logRequest("POST", request).post(body.getOrElse(play.api.libs.json.Json.obj())) } case "PUT" => { - _logRequest("PUT", _requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)).put(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)) + _logRequest("PUT", request).put(body.getOrElse(play.api.libs.json.Json.obj())) } case "PATCH" => { - _logRequest("PATCH", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).patch(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("PATCH", request).patch(body.getOrElse(play.api.libs.json.Json.obj())) } case "DELETE" => { - _logRequest("DELETE", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).delete() + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("DELETE", request).delete() } - case "HEAD" => { - _logRequest("HEAD", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).head() + case "HEAD" => { + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("HEAD", request).head() } - case "OPTIONS" => { - _logRequest("OPTIONS", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).options() + case "OPTIONS" => { + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("OPTIONS", request).options() } case _ => { - _logRequest(method, _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest(method, request) sys.error("Unsupported method[%s]".format(method)) } } @@ -383,18 +395,21 @@ package com.gilt.test.v0 { trait Users { def post( user: com.gilt.test.v0.models.User, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.gilt.test.v0.models.User] @deprecated("to be removed") def getByEmail( @deprecated email: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.gilt.test.v0.models.User] def patch( userPatch: com.gilt.test.v0.models.UserPatch, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.gilt.test.v0.models.User] } diff --git a/lib/src/test/resources/generators/play-22-built-in-types.txt b/lib/src/test/resources/generators/play-22-built-in-types.txt index fe7f4f017..cfe65069e 100644 --- a/lib/src/test/resources/generators/play-22-built-in-types.txt +++ b/lib/src/test/resources/generators/play-22-built-in-types.txt @@ -454,9 +454,10 @@ package apibuilder { object Arrays extends Arrays { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WS.WSRequestHolder => play.api.libs.ws.WS.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Array] = { - _executeRequest("GET", s"/arrays", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/arrays", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Array", r, _.validate[apibuilder.models.Array]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200", requestUri = Some(r.ahcResponse.getUri)) } @@ -465,9 +466,10 @@ package apibuilder { object Optarrays extends Optarrays { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WS.WSRequestHolder => play.api.libs.ws.WS.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optarray] = { - _executeRequest("GET", s"/optarrays", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/optarrays", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Optarray", r, _.validate[apibuilder.models.Optarray]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200", requestUri = Some(r.ahcResponse.getUri)) } @@ -476,9 +478,10 @@ package apibuilder { object Optionals extends Optionals { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WS.WSRequestHolder => play.api.libs.ws.WS.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optional] = { - _executeRequest("GET", s"/optionals", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/optionals", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Optional", r, _.validate[apibuilder.models.Optional]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200", requestUri = Some(r.ahcResponse.getUri)) } @@ -487,9 +490,10 @@ package apibuilder { object Requireds extends Requireds { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WS.WSRequestHolder => play.api.libs.ws.WS.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Required] = { - _executeRequest("GET", s"/requireds", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/requireds", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Required", r, _.validate[apibuilder.models.Required]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200", requestUri = Some(r.ahcResponse.getUri)) } @@ -529,32 +533,40 @@ package apibuilder { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: play.api.libs.ws.WS.WSRequestHolder => play.api.libs.ws.WS.WSRequestHolder = identity ): scala.concurrent.Future[play.api.libs.ws.Response] = { method.toUpperCase match { case "GET" => { - _logRequest("GET", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).get() + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("GET", request).get() } case "POST" => { - _logRequest("POST", _requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)).post(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)) + _logRequest("POST", request).post(body.getOrElse(play.api.libs.json.Json.obj())) } case "PUT" => { - _logRequest("PUT", _requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)).put(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)) + _logRequest("PUT", request).put(body.getOrElse(play.api.libs.json.Json.obj())) } case "PATCH" => { sys.error("PATCH method is not supported in Play Framework Version 2.2.x") } case "DELETE" => { - _logRequest("DELETE", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).delete() + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("DELETE", request).delete() } - case "HEAD" => { - _logRequest("HEAD", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).head() + case "HEAD" => { + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("HEAD", request).head() } - case "OPTIONS" => { - _logRequest("OPTIONS", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).options() + case "OPTIONS" => { + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("OPTIONS", request).options() } case _ => { - _logRequest(method, _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest(method, request) sys.error("Unsupported method[%s]".format(method)) } } @@ -609,25 +621,29 @@ package apibuilder { trait Arrays { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WS.WSRequestHolder => play.api.libs.ws.WS.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Array] } trait Optarrays { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WS.WSRequestHolder => play.api.libs.ws.WS.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optarray] } trait Optionals { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WS.WSRequestHolder => play.api.libs.ws.WS.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optional] } trait Requireds { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WS.WSRequestHolder => play.api.libs.ws.WS.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Required] } diff --git a/lib/src/test/resources/generators/play-23-built-in-types.txt b/lib/src/test/resources/generators/play-23-built-in-types.txt index 90d9d852a..1d0b1a961 100644 --- a/lib/src/test/resources/generators/play-23-built-in-types.txt +++ b/lib/src/test/resources/generators/play-23-built-in-types.txt @@ -454,9 +454,10 @@ package apibuilder { object Arrays extends Arrays { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Array] = { - _executeRequest("GET", s"/arrays", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/arrays", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Array", r, _.validate[apibuilder.models.Array]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -465,9 +466,10 @@ package apibuilder { object Optarrays extends Optarrays { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optarray] = { - _executeRequest("GET", s"/optarrays", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/optarrays", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Optarray", r, _.validate[apibuilder.models.Optarray]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -476,9 +478,10 @@ package apibuilder { object Optionals extends Optionals { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optional] = { - _executeRequest("GET", s"/optionals", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/optionals", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Optional", r, _.validate[apibuilder.models.Optional]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -487,9 +490,10 @@ package apibuilder { object Requireds extends Requireds { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Required] = { - _executeRequest("GET", s"/requireds", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/requireds", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Required", r, _.validate[apibuilder.models.Required]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -529,32 +533,41 @@ package apibuilder { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity ): scala.concurrent.Future[play.api.libs.ws.WSResponse] = { method.toUpperCase match { case "GET" => { - _logRequest("GET", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).get() + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("GET", request).get() } case "POST" => { - _logRequest("POST", _requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)).post(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)) + _logRequest("POST", request).post(body.getOrElse(play.api.libs.json.Json.obj())) } case "PUT" => { - _logRequest("PUT", _requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)).put(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)) + _logRequest("PUT", request).put(body.getOrElse(play.api.libs.json.Json.obj())) } case "PATCH" => { - _logRequest("PATCH", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).patch(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("PATCH", request).patch(body.getOrElse(play.api.libs.json.Json.obj())) } case "DELETE" => { - _logRequest("DELETE", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).delete() + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("DELETE", request).delete() } - case "HEAD" => { - _logRequest("HEAD", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).head() + case "HEAD" => { + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("HEAD", request).head() } - case "OPTIONS" => { - _logRequest("OPTIONS", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).options() + case "OPTIONS" => { + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("OPTIONS", request).options() } case _ => { - _logRequest(method, _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest(method, request) sys.error("Unsupported method[%s]".format(method)) } } @@ -609,25 +622,29 @@ package apibuilder { trait Arrays { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Array] } trait Optarrays { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optarray] } trait Optionals { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optional] } trait Requireds { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Required] } diff --git a/lib/src/test/resources/generators/play-24-built-in-types.txt b/lib/src/test/resources/generators/play-24-built-in-types.txt index fa12cd8f1..8ef8392e6 100644 --- a/lib/src/test/resources/generators/play-24-built-in-types.txt +++ b/lib/src/test/resources/generators/play-24-built-in-types.txt @@ -454,9 +454,10 @@ package apibuilder { object Arrays extends Arrays { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Array] = { - _executeRequest("GET", s"/arrays", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/arrays", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Array", r, _.validate[apibuilder.models.Array]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -465,9 +466,10 @@ package apibuilder { object Optarrays extends Optarrays { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optarray] = { - _executeRequest("GET", s"/optarrays", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/optarrays", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Optarray", r, _.validate[apibuilder.models.Optarray]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -476,9 +478,10 @@ package apibuilder { object Optionals extends Optionals { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optional] = { - _executeRequest("GET", s"/optionals", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/optionals", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Optional", r, _.validate[apibuilder.models.Optional]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -487,9 +490,10 @@ package apibuilder { object Requireds extends Requireds { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Required] = { - _executeRequest("GET", s"/requireds", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/requireds", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Required", r, _.validate[apibuilder.models.Required]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -529,32 +533,41 @@ package apibuilder { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity ): scala.concurrent.Future[play.api.libs.ws.WSResponse] = { method.toUpperCase match { case "GET" => { - _logRequest("GET", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).get() + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("GET", request).get() } case "POST" => { - _logRequest("POST", _requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)).post(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)) + _logRequest("POST", request).post(body.getOrElse(play.api.libs.json.Json.obj())) } case "PUT" => { - _logRequest("PUT", _requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)).put(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)) + _logRequest("PUT", request).put(body.getOrElse(play.api.libs.json.Json.obj())) } case "PATCH" => { - _logRequest("PATCH", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).patch(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("PATCH", request).patch(body.getOrElse(play.api.libs.json.Json.obj())) } case "DELETE" => { - _logRequest("DELETE", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).delete() + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("DELETE", request).delete() } - case "HEAD" => { - _logRequest("HEAD", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).head() + case "HEAD" => { + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("HEAD", request).head() } - case "OPTIONS" => { - _logRequest("OPTIONS", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).options() + case "OPTIONS" => { + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("OPTIONS", request).options() } case _ => { - _logRequest(method, _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest(method, request) sys.error("Unsupported method[%s]".format(method)) } } @@ -609,25 +622,29 @@ package apibuilder { trait Arrays { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Array] } trait Optarrays { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optarray] } trait Optionals { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optional] } trait Requireds { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Required] } diff --git a/lib/src/test/resources/generators/play-25-built-in-types.txt b/lib/src/test/resources/generators/play-25-built-in-types.txt index bb7fbe37e..68bc44953 100644 --- a/lib/src/test/resources/generators/play-25-built-in-types.txt +++ b/lib/src/test/resources/generators/play-25-built-in-types.txt @@ -455,9 +455,10 @@ package apibuilder { object Arrays extends Arrays { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Array] = { - _executeRequest("GET", s"/arrays", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/arrays", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Array", r, _.validate[apibuilder.models.Array]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -466,9 +467,10 @@ package apibuilder { object Optarrays extends Optarrays { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optarray] = { - _executeRequest("GET", s"/optarrays", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/optarrays", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Optarray", r, _.validate[apibuilder.models.Optarray]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -477,9 +479,10 @@ package apibuilder { object Optionals extends Optionals { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optional] = { - _executeRequest("GET", s"/optionals", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/optionals", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Optional", r, _.validate[apibuilder.models.Optional]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -488,9 +491,10 @@ package apibuilder { object Requireds extends Requireds { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Required] = { - _executeRequest("GET", s"/requireds", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/requireds", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Required", r, _.validate[apibuilder.models.Required]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -529,32 +533,41 @@ package apibuilder { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity ): scala.concurrent.Future[play.api.libs.ws.WSResponse] = { method.toUpperCase match { case "GET" => { - _logRequest("GET", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).get() + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("GET", request).get() } case "POST" => { - _logRequest("POST", _requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)).post(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)) + _logRequest("POST", request).post(body.getOrElse(play.api.libs.json.Json.obj())) } case "PUT" => { - _logRequest("PUT", _requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)).put(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)) + _logRequest("PUT", request).put(body.getOrElse(play.api.libs.json.Json.obj())) } case "PATCH" => { - _logRequest("PATCH", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).patch(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("PATCH", request).patch(body.getOrElse(play.api.libs.json.Json.obj())) } case "DELETE" => { - _logRequest("DELETE", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).delete() + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("DELETE", request).delete() } - case "HEAD" => { - _logRequest("HEAD", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).head() + case "HEAD" => { + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("HEAD", request).head() } - case "OPTIONS" => { - _logRequest("OPTIONS", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).options() + case "OPTIONS" => { + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("OPTIONS", request).options() } case _ => { - _logRequest(method, _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest(method, request) sys.error("Unsupported method[%s]".format(method)) } } @@ -609,25 +622,29 @@ package apibuilder { trait Arrays { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Array] } trait Optarrays { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optarray] } trait Optionals { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optional] } trait Requireds { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Required] } diff --git a/lib/src/test/resources/generators/play-26-apidoc-api.txt b/lib/src/test/resources/generators/play-26-apidoc-api.txt index 402f379e5..c837bc10f 100644 --- a/lib/src/test/resources/generators/play-26-apidoc-api.txt +++ b/lib/src/test/resources/generators/play-26-apidoc-api.txt @@ -2195,7 +2195,8 @@ package io.apibuilder.api.v0 { hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Application]] = { val queryParameters = Seq( name.map("name" -> _), @@ -2206,7 +2207,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.Application]", r, _.validate[Seq[io.apibuilder.api.v0.models.Application]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2215,11 +2216,12 @@ package io.apibuilder.api.v0 { override def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Application] = { val payload = play.api.libs.json.Json.toJson(applicationForm) - _executeRequest("POST", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Application", r, _.validate[io.apibuilder.api.v0.models.Application]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -2230,11 +2232,12 @@ package io.apibuilder.api.v0 { orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Application] = { val payload = play.api.libs.json.Json.toJson(applicationForm) - _executeRequest("PUT", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("PUT", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Application", r, _.validate[io.apibuilder.api.v0.models.Application]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -2244,9 +2247,10 @@ package io.apibuilder.api.v0 { override def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204") } @@ -2256,11 +2260,12 @@ package io.apibuilder.api.v0 { orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Application] = { val payload = play.api.libs.json.Json.toJson(moveForm) - _executeRequest("POST", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}/move", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}/move", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Application", r, _.validate[io.apibuilder.api.v0.models.Application]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -2274,7 +2279,8 @@ package io.apibuilder.api.v0 { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Attribute]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -2283,7 +2289,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/attributes", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/attributes", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.Attribute]", r, _.validate[Seq[io.apibuilder.api.v0.models.Attribute]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2291,9 +2297,10 @@ package io.apibuilder.api.v0 { override def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Attribute] = { - _executeRequest("GET", s"/attributes/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/attributes/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Attribute", r, _.validate[io.apibuilder.api.v0.models.Attribute]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -2302,11 +2309,12 @@ package io.apibuilder.api.v0 { override def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Attribute] = { val payload = play.api.libs.json.Json.toJson(attributeForm) - _executeRequest("POST", s"/attributes", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/attributes", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 201 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Attribute", r, _.validate[io.apibuilder.api.v0.models.Attribute]) case r if r.status == 401 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) @@ -2316,9 +2324,10 @@ package io.apibuilder.api.v0 { override def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/attributes/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/attributes/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r if r.status == 401 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) @@ -2333,7 +2342,8 @@ package io.apibuilder.api.v0 { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Change]] = { val queryParameters = Seq( orgKey.map("org_key" -> _), @@ -2342,7 +2352,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/changes", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/changes", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.Change]", r, _.validate[Seq[io.apibuilder.api.v0.models.Change]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2355,9 +2365,10 @@ package io.apibuilder.api.v0 { applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Code] = { - _executeRequest("GET", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(version, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(generatorKey, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(version, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(generatorKey, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Code", r, _.validate[io.apibuilder.api.v0.models.Code]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) @@ -2370,11 +2381,12 @@ package io.apibuilder.api.v0 { override def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Domain] = { val payload = play.api.libs.json.Json.toJson(domain) - _executeRequest("POST", s"/domains/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/domains/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Domain", r, _.validate[io.apibuilder.api.v0.models.Domain]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -2384,9 +2396,10 @@ package io.apibuilder.api.v0 { override def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/domains/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/domains/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204") } @@ -2396,11 +2409,12 @@ package io.apibuilder.api.v0 { object EmailVerificationConfirmationForms extends EmailVerificationConfirmationForms { override def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { val payload = play.api.libs.json.Json.toJson(emailVerificationConfirmationForm) - _executeRequest("POST", s"/email_verification_confirmations", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/email_verification_confirmations", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204, 409") @@ -2415,7 +2429,8 @@ package io.apibuilder.api.v0 { generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.GeneratorService]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -2425,7 +2440,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/generator_services", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/generator_services", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.GeneratorService]", r, _.validate[Seq[io.apibuilder.api.v0.models.GeneratorService]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2433,9 +2448,10 @@ package io.apibuilder.api.v0 { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.GeneratorService] = { - _executeRequest("GET", s"/generator_services/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/generator_services/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.GeneratorService", r, _.validate[io.apibuilder.api.v0.models.GeneratorService]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -2444,11 +2460,12 @@ package io.apibuilder.api.v0 { override def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.GeneratorService] = { val payload = play.api.libs.json.Json.toJson(generatorServiceForm) - _executeRequest("POST", s"/generator_services", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/generator_services", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.GeneratorService", r, _.validate[io.apibuilder.api.v0.models.GeneratorService]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -2457,9 +2474,10 @@ package io.apibuilder.api.v0 { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/generator_services/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/generator_services/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r if r.status == 403 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) @@ -2477,7 +2495,8 @@ package io.apibuilder.api.v0 { key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -2489,7 +2508,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/generators", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/generators", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.GeneratorWithService]", r, _.validate[Seq[io.apibuilder.api.v0.models.GeneratorWithService]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2497,9 +2516,10 @@ package io.apibuilder.api.v0 { override def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.GeneratorWithService] = { - _executeRequest("GET", s"/generators/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/generators/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.GeneratorWithService", r, _.validate[io.apibuilder.api.v0.models.GeneratorWithService]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -2509,18 +2529,20 @@ package io.apibuilder.api.v0 { object Healthchecks extends Healthchecks { override def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.generator.v0.models.Healthcheck] = { - _executeRequest("GET", s"/_internal_/healthcheck", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/_internal_/healthcheck", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.generator.v0.models.Healthcheck", r, _.validate[io.apibuilder.generator.v0.models.Healthcheck]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } } override def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Map[String, String]] = { - _executeRequest("GET", s"/_internal_/migrate", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/_internal_/migrate", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Map[String, String]", r, _.validate[Map[String, String]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2532,7 +2554,8 @@ package io.apibuilder.api.v0 { q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Item]] = { val queryParameters = Seq( q.map("q" -> _), @@ -2540,7 +2563,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/items", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/items", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.Item]", r, _.validate[Seq[io.apibuilder.api.v0.models.Item]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2548,9 +2571,10 @@ package io.apibuilder.api.v0 { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Item] = { - _executeRequest("GET", s"/items/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/items/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Item", r, _.validate[io.apibuilder.api.v0.models.Item]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -2566,7 +2590,8 @@ package io.apibuilder.api.v0 { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.MembershipRequest]] = { val queryParameters = Seq( orgGuid.map("org_guid" -> _.toString), @@ -2577,7 +2602,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/membership_requests", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/membership_requests", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.MembershipRequest]", r, _.validate[Seq[io.apibuilder.api.v0.models.MembershipRequest]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2587,7 +2612,8 @@ package io.apibuilder.api.v0 { orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.MembershipRequest] = { val payload = play.api.libs.json.Json.obj( "org_guid" -> play.api.libs.json.Json.toJson(orgGuid), @@ -2595,7 +2621,7 @@ package io.apibuilder.api.v0 { "role" -> play.api.libs.json.Json.toJson(role) ) - _executeRequest("POST", s"/membership_requests", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/membership_requests", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.MembershipRequest", r, _.validate[io.apibuilder.api.v0.models.MembershipRequest]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -2604,9 +2630,10 @@ package io.apibuilder.api.v0 { override def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("POST", s"/membership_requests/${guid}/accept", requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/membership_requests/${guid}/accept", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204, 409") @@ -2615,9 +2642,10 @@ package io.apibuilder.api.v0 { override def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("POST", s"/membership_requests/${guid}/decline", requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/membership_requests/${guid}/decline", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204, 409") @@ -2633,7 +2661,8 @@ package io.apibuilder.api.v0 { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Membership]] = { val queryParameters = Seq( orgGuid.map("org_guid" -> _.toString), @@ -2644,7 +2673,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/memberships", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/memberships", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.Membership]", r, _.validate[Seq[io.apibuilder.api.v0.models.Membership]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2652,9 +2681,10 @@ package io.apibuilder.api.v0 { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Membership] = { - _executeRequest("GET", s"/memberships/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/memberships/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Membership", r, _.validate[io.apibuilder.api.v0.models.Membership]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -2663,9 +2693,10 @@ package io.apibuilder.api.v0 { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/memberships/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/memberships/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204") } @@ -2681,7 +2712,8 @@ package io.apibuilder.api.v0 { namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Organization]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -2693,7 +2725,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/organizations", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/organizations", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.Organization]", r, _.validate[Seq[io.apibuilder.api.v0.models.Organization]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2701,9 +2733,10 @@ package io.apibuilder.api.v0 { override def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Organization] = { - _executeRequest("GET", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Organization", r, _.validate[io.apibuilder.api.v0.models.Organization]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -2712,11 +2745,12 @@ package io.apibuilder.api.v0 { override def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Organization] = { val payload = play.api.libs.json.Json.toJson(organizationForm) - _executeRequest("POST", s"/organizations", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/organizations", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Organization", r, _.validate[io.apibuilder.api.v0.models.Organization]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -2726,11 +2760,12 @@ package io.apibuilder.api.v0 { override def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Organization] = { val payload = play.api.libs.json.Json.toJson(organizationForm) - _executeRequest("PUT", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("PUT", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Organization", r, _.validate[io.apibuilder.api.v0.models.Organization]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -2739,9 +2774,10 @@ package io.apibuilder.api.v0 { override def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204") } @@ -2752,7 +2788,8 @@ package io.apibuilder.api.v0 { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.AttributeValue]] = { val queryParameters = Seq( name.map("name" -> _), @@ -2760,7 +2797,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}/attributes", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}/attributes", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.AttributeValue]", r, _.validate[Seq[io.apibuilder.api.v0.models.AttributeValue]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2769,9 +2806,10 @@ package io.apibuilder.api.v0 { override def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.AttributeValue] = { - _executeRequest("GET", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}/attributes/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}/attributes/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.AttributeValue", r, _.validate[io.apibuilder.api.v0.models.AttributeValue]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -2782,11 +2820,12 @@ package io.apibuilder.api.v0 { key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.AttributeValue] = { val payload = play.api.libs.json.Json.toJson(attributeValueForm) - _executeRequest("PUT", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}/attributes/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("PUT", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}/attributes/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.AttributeValue", r, _.validate[io.apibuilder.api.v0.models.AttributeValue]) case r if r.status == 201 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.AttributeValue", r, _.validate[io.apibuilder.api.v0.models.AttributeValue]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) @@ -2798,9 +2837,10 @@ package io.apibuilder.api.v0 { override def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}/attributes/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}/attributes/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r if r.status == 401 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) @@ -2812,11 +2852,12 @@ package io.apibuilder.api.v0 { object PasswordResetRequests extends PasswordResetRequests { override def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { val payload = play.api.libs.json.Json.toJson(passwordResetRequest) - _executeRequest("POST", s"/password_reset_requests", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/password_reset_requests", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204, 409") @@ -2827,11 +2868,12 @@ package io.apibuilder.api.v0 { object PasswordResets extends PasswordResets { override def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.PasswordResetSuccess] = { val payload = play.api.libs.json.Json.toJson(passwordReset) - _executeRequest("POST", s"/password_resets", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/password_resets", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.PasswordResetSuccess", r, _.validate[io.apibuilder.api.v0.models.PasswordResetSuccess]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -2847,7 +2889,8 @@ package io.apibuilder.api.v0 { publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Subscription]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -2858,7 +2901,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/subscriptions", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/subscriptions", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.Subscription]", r, _.validate[Seq[io.apibuilder.api.v0.models.Subscription]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2866,9 +2909,10 @@ package io.apibuilder.api.v0 { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Subscription] = { - _executeRequest("GET", s"/subscriptions/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/subscriptions/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Subscription", r, _.validate[io.apibuilder.api.v0.models.Subscription]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -2877,11 +2921,12 @@ package io.apibuilder.api.v0 { override def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Subscription] = { val payload = play.api.libs.json.Json.toJson(subscriptionForm) - _executeRequest("POST", s"/subscriptions", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/subscriptions", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 201 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Subscription", r, _.validate[io.apibuilder.api.v0.models.Subscription]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 201, 409") @@ -2890,9 +2935,10 @@ package io.apibuilder.api.v0 { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/subscriptions/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/subscriptions/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204") } @@ -2905,7 +2951,8 @@ package io.apibuilder.api.v0 { guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Token]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -2913,7 +2960,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/tokens/users/${userGuid}", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/tokens/users/${userGuid}", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.Token]", r, _.validate[Seq[io.apibuilder.api.v0.models.Token]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2921,9 +2968,10 @@ package io.apibuilder.api.v0 { override def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.CleartextToken] = { - _executeRequest("GET", s"/tokens/${guid}/cleartext", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/tokens/${guid}/cleartext", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.CleartextToken", r, _.validate[io.apibuilder.api.v0.models.CleartextToken]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -2932,11 +2980,12 @@ package io.apibuilder.api.v0 { override def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Token] = { val payload = play.api.libs.json.Json.toJson(tokenForm) - _executeRequest("POST", s"/tokens", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/tokens", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 201 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Token", r, _.validate[io.apibuilder.api.v0.models.Token]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 201, 409") @@ -2945,9 +2994,10 @@ package io.apibuilder.api.v0 { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/tokens/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/tokens/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204") } @@ -2959,7 +3009,8 @@ package io.apibuilder.api.v0 { guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.User]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -2967,7 +3018,7 @@ package io.apibuilder.api.v0 { token.map("token" -> _) ).flatten - _executeRequest("GET", s"/users", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/users", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.User]", r, _.validate[Seq[io.apibuilder.api.v0.models.User]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2975,9 +3026,10 @@ package io.apibuilder.api.v0 { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.User] = { - _executeRequest("GET", s"/users/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/users/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.User", r, _.validate[io.apibuilder.api.v0.models.User]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -2987,14 +3039,15 @@ package io.apibuilder.api.v0 { override def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.User] = { val payload = play.api.libs.json.Json.obj( "email" -> play.api.libs.json.Json.toJson(email), "password" -> play.api.libs.json.Json.toJson(password) ) - _executeRequest("POST", s"/users/authenticate", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/users/authenticate", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.User", r, _.validate[io.apibuilder.api.v0.models.User]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -3003,11 +3056,12 @@ package io.apibuilder.api.v0 { override def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.User] = { val payload = play.api.libs.json.Json.toJson(userForm) - _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.User", r, _.validate[io.apibuilder.api.v0.models.User]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -3017,11 +3071,12 @@ package io.apibuilder.api.v0 { override def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.User] = { val payload = play.api.libs.json.Json.toJson(userUpdateForm) - _executeRequest("PUT", s"/users/${guid}", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("PUT", s"/users/${guid}", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.User", r, _.validate[io.apibuilder.api.v0.models.User]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -3032,11 +3087,12 @@ package io.apibuilder.api.v0 { object Validations extends Validations { override def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Validation] = { val payload = play.api.libs.json.Json.toJson(value) - _executeRequest("POST", s"/validations", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/validations", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Validation", r, _.validate[io.apibuilder.api.v0.models.Validation]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -3049,14 +3105,15 @@ package io.apibuilder.api.v0 { applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Version]] = { val queryParameters = Seq( Some("limit" -> limit.toString), Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.Version]", r, _.validate[Seq[io.apibuilder.api.v0.models.Version]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -3066,9 +3123,10 @@ package io.apibuilder.api.v0 { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Version] = { - _executeRequest("GET", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(version, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(version, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Version", r, _.validate[io.apibuilder.api.v0.models.Version]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -3079,11 +3137,12 @@ package io.apibuilder.api.v0 { orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Version] = { val payload = play.api.libs.json.Json.toJson(versionForm) - _executeRequest("POST", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(version, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(version, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Version", r, _.validate[io.apibuilder.api.v0.models.Version]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -3095,11 +3154,12 @@ package io.apibuilder.api.v0 { applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Version] = { val payload = play.api.libs.json.Json.toJson(versionForm) - _executeRequest("PUT", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(version, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("PUT", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(version, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Version", r, _.validate[io.apibuilder.api.v0.models.Version]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -3110,9 +3170,10 @@ package io.apibuilder.api.v0 { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(version, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(version, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204") } @@ -3127,7 +3188,8 @@ package io.apibuilder.api.v0 { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Watch]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -3138,7 +3200,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/watches", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/watches", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.Watch]", r, _.validate[Seq[io.apibuilder.api.v0.models.Watch]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -3146,9 +3208,10 @@ package io.apibuilder.api.v0 { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Watch] = { - _executeRequest("GET", s"/watches/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/watches/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Watch", r, _.validate[io.apibuilder.api.v0.models.Watch]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -3159,7 +3222,8 @@ package io.apibuilder.api.v0 { userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Boolean] = { val queryParameters = Seq( userGuid.map("user_guid" -> _.toString), @@ -3167,7 +3231,7 @@ package io.apibuilder.api.v0 { Some("application_key" -> applicationKey) ).flatten - _executeRequest("GET", s"/watches/check", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/watches/check", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Boolean", r, _.validate[Boolean]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -3175,11 +3239,12 @@ package io.apibuilder.api.v0 { override def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Watch] = { val payload = play.api.libs.json.Json.toJson(watchForm) - _executeRequest("POST", s"/watches", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/watches", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 201 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Watch", r, _.validate[io.apibuilder.api.v0.models.Watch]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 201, 409") @@ -3188,9 +3253,10 @@ package io.apibuilder.api.v0 { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/watches/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/watches/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204") } @@ -3229,32 +3295,41 @@ package io.apibuilder.api.v0 { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity ): scala.concurrent.Future[play.api.libs.ws.WSResponse] = { method.toUpperCase match { case "GET" => { - _logRequest("GET", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).get() + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("GET", request).get() } case "POST" => { - _logRequest("POST", _requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)).post(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("POST", request).post(body.getOrElse(play.api.libs.json.Json.obj())) } case "PUT" => { - _logRequest("PUT", _requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)).put(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("PUT", request).put(body.getOrElse(play.api.libs.json.Json.obj())) } case "PATCH" => { - _logRequest("PATCH", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).patch(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("PATCH", request).patch(body.getOrElse(play.api.libs.json.Json.obj())) } case "DELETE" => { - _logRequest("DELETE", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).delete() + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("DELETE", request).delete() } - case "HEAD" => { - _logRequest("HEAD", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).head() + case "HEAD" => { + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("HEAD", request).head() } - case "OPTIONS" => { - _logRequest("OPTIONS", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).options() + case "OPTIONS" => { + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("OPTIONS", request).options() } case _ => { - _logRequest(method, _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest(method, request) sys.error("Unsupported method[%s]".format(method)) } } @@ -3345,7 +3420,8 @@ package io.apibuilder.api.v0 { hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Application]] /** @@ -3354,7 +3430,8 @@ package io.apibuilder.api.v0 { def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Application] /** @@ -3364,7 +3441,8 @@ package io.apibuilder.api.v0 { orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Application] /** @@ -3373,7 +3451,8 @@ package io.apibuilder.api.v0 { def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] /** @@ -3383,7 +3462,8 @@ package io.apibuilder.api.v0 { orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Application] } @@ -3401,7 +3481,8 @@ package io.apibuilder.api.v0 { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Attribute]] /** @@ -3409,7 +3490,8 @@ package io.apibuilder.api.v0 { */ def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Attribute] /** @@ -3417,7 +3499,8 @@ package io.apibuilder.api.v0 { */ def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Attribute] /** @@ -3426,7 +3509,8 @@ package io.apibuilder.api.v0 { */ def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -3442,7 +3526,8 @@ package io.apibuilder.api.v0 { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Change]] } @@ -3460,7 +3545,8 @@ package io.apibuilder.api.v0 { applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Code] } @@ -3471,7 +3557,8 @@ package io.apibuilder.api.v0 { def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Domain] /** @@ -3480,7 +3567,8 @@ package io.apibuilder.api.v0 { def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -3490,7 +3578,8 @@ package io.apibuilder.api.v0 { */ def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -3507,17 +3596,20 @@ package io.apibuilder.api.v0 { generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.GeneratorService]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.GeneratorService] def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.GeneratorService] /** @@ -3525,7 +3617,8 @@ package io.apibuilder.api.v0 { */ def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -3549,22 +3642,26 @@ package io.apibuilder.api.v0 { key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.GeneratorWithService] } trait Healthchecks { def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.generator.v0.models.Healthcheck] def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Map[String, String]] } @@ -3578,12 +3675,14 @@ package io.apibuilder.api.v0 { q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Item]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Item] } @@ -3601,7 +3700,8 @@ package io.apibuilder.api.v0 { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.MembershipRequest]] /** @@ -3611,7 +3711,8 @@ package io.apibuilder.api.v0 { orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.MembershipRequest] /** @@ -3620,7 +3721,8 @@ package io.apibuilder.api.v0 { */ def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] /** @@ -3629,7 +3731,8 @@ package io.apibuilder.api.v0 { */ def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -3647,17 +3750,20 @@ package io.apibuilder.api.v0 { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Membership]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Membership] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -3683,7 +3789,8 @@ package io.apibuilder.api.v0 { namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Organization]] /** @@ -3691,7 +3798,8 @@ package io.apibuilder.api.v0 { */ def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Organization] /** @@ -3699,7 +3807,8 @@ package io.apibuilder.api.v0 { */ def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Organization] /** @@ -3708,7 +3817,8 @@ package io.apibuilder.api.v0 { def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Organization] /** @@ -3716,7 +3826,8 @@ package io.apibuilder.api.v0 { */ def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] /** @@ -3732,7 +3843,8 @@ package io.apibuilder.api.v0 { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.AttributeValue]] /** @@ -3741,7 +3853,8 @@ package io.apibuilder.api.v0 { def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.AttributeValue] /** @@ -3751,7 +3864,8 @@ package io.apibuilder.api.v0 { key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.AttributeValue] /** @@ -3761,7 +3875,8 @@ package io.apibuilder.api.v0 { def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -3772,7 +3887,8 @@ package io.apibuilder.api.v0 { */ def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -3784,7 +3900,8 @@ package io.apibuilder.api.v0 { */ def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.PasswordResetSuccess] } @@ -3806,7 +3923,8 @@ package io.apibuilder.api.v0 { publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Subscription]] /** @@ -3814,7 +3932,8 @@ package io.apibuilder.api.v0 { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Subscription] /** @@ -3822,12 +3941,14 @@ package io.apibuilder.api.v0 { */ def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Subscription] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -3841,7 +3962,8 @@ package io.apibuilder.api.v0 { guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Token]] /** @@ -3849,7 +3971,8 @@ package io.apibuilder.api.v0 { */ def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.CleartextToken] /** @@ -3857,12 +3980,14 @@ package io.apibuilder.api.v0 { */ def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Token] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -3879,7 +4004,8 @@ package io.apibuilder.api.v0 { guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.User]] /** @@ -3887,7 +4013,8 @@ package io.apibuilder.api.v0 { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.User] /** @@ -3898,7 +4025,8 @@ package io.apibuilder.api.v0 { def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.User] /** @@ -3906,7 +4034,8 @@ package io.apibuilder.api.v0 { */ def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.User] /** @@ -3915,14 +4044,16 @@ package io.apibuilder.api.v0 { def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.User] } trait Validations { def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Validation] } @@ -3940,7 +4071,8 @@ package io.apibuilder.api.v0 { applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Version]] /** @@ -3953,7 +4085,8 @@ package io.apibuilder.api.v0 { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Version] /** @@ -3963,7 +4096,8 @@ package io.apibuilder.api.v0 { orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Version] /** @@ -3974,7 +4108,8 @@ package io.apibuilder.api.v0 { applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Version] /** @@ -3984,7 +4119,8 @@ package io.apibuilder.api.v0 { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -4006,7 +4142,8 @@ package io.apibuilder.api.v0 { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Watch]] /** @@ -4014,7 +4151,8 @@ package io.apibuilder.api.v0 { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Watch] /** @@ -4027,7 +4165,8 @@ package io.apibuilder.api.v0 { userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Boolean] /** @@ -4035,12 +4174,14 @@ package io.apibuilder.api.v0 { */ def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Watch] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } diff --git a/lib/src/test/resources/generators/play-26-built-in-types.txt b/lib/src/test/resources/generators/play-26-built-in-types.txt index 7ef64819a..361de69f9 100644 --- a/lib/src/test/resources/generators/play-26-built-in-types.txt +++ b/lib/src/test/resources/generators/play-26-built-in-types.txt @@ -455,9 +455,10 @@ package apibuilder { object Arrays extends Arrays { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Array] = { - _executeRequest("GET", s"/arrays", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/arrays", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Array", r, _.validate[apibuilder.models.Array]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -466,9 +467,10 @@ package apibuilder { object Optarrays extends Optarrays { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optarray] = { - _executeRequest("GET", s"/optarrays", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/optarrays", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Optarray", r, _.validate[apibuilder.models.Optarray]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -477,9 +479,10 @@ package apibuilder { object Optionals extends Optionals { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optional] = { - _executeRequest("GET", s"/optionals", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/optionals", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Optional", r, _.validate[apibuilder.models.Optional]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -488,9 +491,10 @@ package apibuilder { object Requireds extends Requireds { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Required] = { - _executeRequest("GET", s"/requireds", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/requireds", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Required", r, _.validate[apibuilder.models.Required]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -529,32 +533,41 @@ package apibuilder { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity ): scala.concurrent.Future[play.api.libs.ws.WSResponse] = { method.toUpperCase match { case "GET" => { - _logRequest("GET", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).get() + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("GET", request).get() } case "POST" => { - _logRequest("POST", _requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)).post(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("POST", request).post(body.getOrElse(play.api.libs.json.Json.obj())) } case "PUT" => { - _logRequest("PUT", _requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)).put(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("PUT", request).put(body.getOrElse(play.api.libs.json.Json.obj())) } case "PATCH" => { - _logRequest("PATCH", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).patch(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("PATCH", request).patch(body.getOrElse(play.api.libs.json.Json.obj())) } case "DELETE" => { - _logRequest("DELETE", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).delete() + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("DELETE", request).delete() } - case "HEAD" => { - _logRequest("HEAD", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).head() + case "HEAD" => { + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("HEAD", request).head() } - case "OPTIONS" => { - _logRequest("OPTIONS", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).options() + case "OPTIONS" => { + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("OPTIONS", request).options() } case _ => { - _logRequest(method, _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest(method, request) sys.error("Unsupported method[%s]".format(method)) } } @@ -609,25 +622,29 @@ package apibuilder { trait Arrays { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Array] } trait Optarrays { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optarray] } trait Optionals { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optional] } trait Requireds { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Required] } diff --git a/lib/src/test/resources/generators/play-26-envelope.txt b/lib/src/test/resources/generators/play-26-envelope.txt index 2ad5140e4..a9935f135 100644 --- a/lib/src/test/resources/generators/play-26-envelope.txt +++ b/lib/src/test/resources/generators/play-26-envelope.txt @@ -308,7 +308,8 @@ package io.gregor.time.types.v0 { queryDate: _root_.org.joda.time.LocalDate, queryTime: _root_.org.joda.time.DateTime, dateTimeModel: io.gregor.time.types.v0.models.DateTimeModel, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.gregor.time.types.v0.Response[io.gregor.time.types.v0.models.DateTimeModel]] = { val payload = play.api.libs.json.Json.toJson(dateTimeModel) @@ -317,7 +318,7 @@ package io.gregor.time.types.v0 { Some("query_time" -> _root_.org.joda.time.format.ISODateTimeFormat.dateTime.print(queryTime)) ).flatten - _executeRequest("POST", s"/date_time_models/${play.utils.UriEncoding.encodePathSegment(_root_.org.joda.time.format.ISODateTimeFormat.date.print(pathDate), "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(_root_.org.joda.time.format.ISODateTimeFormat.dateTime.print(pathTime), "UTF-8")}", body = Some(payload), queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/date_time_models/${play.utils.UriEncoding.encodePathSegment(_root_.org.joda.time.format.ISODateTimeFormat.date.print(pathDate), "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(_root_.org.joda.time.format.ISODateTimeFormat.dateTime.print(pathTime), "UTF-8")}", body = Some(payload), queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.gregor.time.types.v0.Client.buildResponse("io.gregor.time.types.v0.models.DateTimeModel", r, _.validate[io.gregor.time.types.v0.models.DateTimeModel]) case r => throw io.gregor.time.types.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -356,32 +357,41 @@ package io.gregor.time.types.v0 { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity ): scala.concurrent.Future[play.api.libs.ws.WSResponse] = { method.toUpperCase match { case "GET" => { - _logRequest("GET", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).get() + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("GET", request).get() } case "POST" => { - _logRequest("POST", _requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)).post(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("POST", request).post(body.getOrElse(play.api.libs.json.Json.obj())) } case "PUT" => { - _logRequest("PUT", _requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)).put(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("PUT", request).put(body.getOrElse(play.api.libs.json.Json.obj())) } case "PATCH" => { - _logRequest("PATCH", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).patch(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("PATCH", request).patch(body.getOrElse(play.api.libs.json.Json.obj())) } case "DELETE" => { - _logRequest("DELETE", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).delete() + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("DELETE", request).delete() } - case "HEAD" => { - _logRequest("HEAD", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).head() + case "HEAD" => { + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("HEAD", request).head() } - case "OPTIONS" => { - _logRequest("OPTIONS", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).options() + case "OPTIONS" => { + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("OPTIONS", request).options() } case _ => { - _logRequest(method, _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest(method, request) sys.error("Unsupported method[%s]".format(method)) } } @@ -451,7 +461,8 @@ package io.gregor.time.types.v0 { queryDate: _root_.org.joda.time.LocalDate, queryTime: _root_.org.joda.time.DateTime, dateTimeModel: io.gregor.time.types.v0.models.DateTimeModel, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.gregor.time.types.v0.Response[io.gregor.time.types.v0.models.DateTimeModel]] } diff --git a/lib/src/test/resources/generators/play-27-apidoc-api.txt b/lib/src/test/resources/generators/play-27-apidoc-api.txt index 402f379e5..c837bc10f 100644 --- a/lib/src/test/resources/generators/play-27-apidoc-api.txt +++ b/lib/src/test/resources/generators/play-27-apidoc-api.txt @@ -2195,7 +2195,8 @@ package io.apibuilder.api.v0 { hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Application]] = { val queryParameters = Seq( name.map("name" -> _), @@ -2206,7 +2207,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.Application]", r, _.validate[Seq[io.apibuilder.api.v0.models.Application]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2215,11 +2216,12 @@ package io.apibuilder.api.v0 { override def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Application] = { val payload = play.api.libs.json.Json.toJson(applicationForm) - _executeRequest("POST", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Application", r, _.validate[io.apibuilder.api.v0.models.Application]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -2230,11 +2232,12 @@ package io.apibuilder.api.v0 { orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Application] = { val payload = play.api.libs.json.Json.toJson(applicationForm) - _executeRequest("PUT", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("PUT", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Application", r, _.validate[io.apibuilder.api.v0.models.Application]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -2244,9 +2247,10 @@ package io.apibuilder.api.v0 { override def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204") } @@ -2256,11 +2260,12 @@ package io.apibuilder.api.v0 { orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Application] = { val payload = play.api.libs.json.Json.toJson(moveForm) - _executeRequest("POST", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}/move", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}/move", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Application", r, _.validate[io.apibuilder.api.v0.models.Application]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -2274,7 +2279,8 @@ package io.apibuilder.api.v0 { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Attribute]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -2283,7 +2289,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/attributes", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/attributes", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.Attribute]", r, _.validate[Seq[io.apibuilder.api.v0.models.Attribute]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2291,9 +2297,10 @@ package io.apibuilder.api.v0 { override def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Attribute] = { - _executeRequest("GET", s"/attributes/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/attributes/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Attribute", r, _.validate[io.apibuilder.api.v0.models.Attribute]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -2302,11 +2309,12 @@ package io.apibuilder.api.v0 { override def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Attribute] = { val payload = play.api.libs.json.Json.toJson(attributeForm) - _executeRequest("POST", s"/attributes", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/attributes", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 201 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Attribute", r, _.validate[io.apibuilder.api.v0.models.Attribute]) case r if r.status == 401 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) @@ -2316,9 +2324,10 @@ package io.apibuilder.api.v0 { override def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/attributes/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/attributes/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r if r.status == 401 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) @@ -2333,7 +2342,8 @@ package io.apibuilder.api.v0 { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Change]] = { val queryParameters = Seq( orgKey.map("org_key" -> _), @@ -2342,7 +2352,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/changes", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/changes", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.Change]", r, _.validate[Seq[io.apibuilder.api.v0.models.Change]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2355,9 +2365,10 @@ package io.apibuilder.api.v0 { applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Code] = { - _executeRequest("GET", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(version, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(generatorKey, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(version, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(generatorKey, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Code", r, _.validate[io.apibuilder.api.v0.models.Code]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) @@ -2370,11 +2381,12 @@ package io.apibuilder.api.v0 { override def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Domain] = { val payload = play.api.libs.json.Json.toJson(domain) - _executeRequest("POST", s"/domains/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/domains/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Domain", r, _.validate[io.apibuilder.api.v0.models.Domain]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -2384,9 +2396,10 @@ package io.apibuilder.api.v0 { override def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/domains/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/domains/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204") } @@ -2396,11 +2409,12 @@ package io.apibuilder.api.v0 { object EmailVerificationConfirmationForms extends EmailVerificationConfirmationForms { override def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { val payload = play.api.libs.json.Json.toJson(emailVerificationConfirmationForm) - _executeRequest("POST", s"/email_verification_confirmations", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/email_verification_confirmations", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204, 409") @@ -2415,7 +2429,8 @@ package io.apibuilder.api.v0 { generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.GeneratorService]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -2425,7 +2440,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/generator_services", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/generator_services", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.GeneratorService]", r, _.validate[Seq[io.apibuilder.api.v0.models.GeneratorService]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2433,9 +2448,10 @@ package io.apibuilder.api.v0 { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.GeneratorService] = { - _executeRequest("GET", s"/generator_services/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/generator_services/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.GeneratorService", r, _.validate[io.apibuilder.api.v0.models.GeneratorService]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -2444,11 +2460,12 @@ package io.apibuilder.api.v0 { override def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.GeneratorService] = { val payload = play.api.libs.json.Json.toJson(generatorServiceForm) - _executeRequest("POST", s"/generator_services", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/generator_services", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.GeneratorService", r, _.validate[io.apibuilder.api.v0.models.GeneratorService]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -2457,9 +2474,10 @@ package io.apibuilder.api.v0 { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/generator_services/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/generator_services/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r if r.status == 403 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) @@ -2477,7 +2495,8 @@ package io.apibuilder.api.v0 { key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -2489,7 +2508,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/generators", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/generators", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.GeneratorWithService]", r, _.validate[Seq[io.apibuilder.api.v0.models.GeneratorWithService]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2497,9 +2516,10 @@ package io.apibuilder.api.v0 { override def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.GeneratorWithService] = { - _executeRequest("GET", s"/generators/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/generators/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.GeneratorWithService", r, _.validate[io.apibuilder.api.v0.models.GeneratorWithService]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -2509,18 +2529,20 @@ package io.apibuilder.api.v0 { object Healthchecks extends Healthchecks { override def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.generator.v0.models.Healthcheck] = { - _executeRequest("GET", s"/_internal_/healthcheck", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/_internal_/healthcheck", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.generator.v0.models.Healthcheck", r, _.validate[io.apibuilder.generator.v0.models.Healthcheck]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } } override def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Map[String, String]] = { - _executeRequest("GET", s"/_internal_/migrate", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/_internal_/migrate", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Map[String, String]", r, _.validate[Map[String, String]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2532,7 +2554,8 @@ package io.apibuilder.api.v0 { q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Item]] = { val queryParameters = Seq( q.map("q" -> _), @@ -2540,7 +2563,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/items", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/items", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.Item]", r, _.validate[Seq[io.apibuilder.api.v0.models.Item]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2548,9 +2571,10 @@ package io.apibuilder.api.v0 { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Item] = { - _executeRequest("GET", s"/items/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/items/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Item", r, _.validate[io.apibuilder.api.v0.models.Item]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -2566,7 +2590,8 @@ package io.apibuilder.api.v0 { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.MembershipRequest]] = { val queryParameters = Seq( orgGuid.map("org_guid" -> _.toString), @@ -2577,7 +2602,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/membership_requests", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/membership_requests", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.MembershipRequest]", r, _.validate[Seq[io.apibuilder.api.v0.models.MembershipRequest]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2587,7 +2612,8 @@ package io.apibuilder.api.v0 { orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.MembershipRequest] = { val payload = play.api.libs.json.Json.obj( "org_guid" -> play.api.libs.json.Json.toJson(orgGuid), @@ -2595,7 +2621,7 @@ package io.apibuilder.api.v0 { "role" -> play.api.libs.json.Json.toJson(role) ) - _executeRequest("POST", s"/membership_requests", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/membership_requests", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.MembershipRequest", r, _.validate[io.apibuilder.api.v0.models.MembershipRequest]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -2604,9 +2630,10 @@ package io.apibuilder.api.v0 { override def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("POST", s"/membership_requests/${guid}/accept", requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/membership_requests/${guid}/accept", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204, 409") @@ -2615,9 +2642,10 @@ package io.apibuilder.api.v0 { override def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("POST", s"/membership_requests/${guid}/decline", requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/membership_requests/${guid}/decline", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204, 409") @@ -2633,7 +2661,8 @@ package io.apibuilder.api.v0 { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Membership]] = { val queryParameters = Seq( orgGuid.map("org_guid" -> _.toString), @@ -2644,7 +2673,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/memberships", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/memberships", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.Membership]", r, _.validate[Seq[io.apibuilder.api.v0.models.Membership]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2652,9 +2681,10 @@ package io.apibuilder.api.v0 { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Membership] = { - _executeRequest("GET", s"/memberships/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/memberships/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Membership", r, _.validate[io.apibuilder.api.v0.models.Membership]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -2663,9 +2693,10 @@ package io.apibuilder.api.v0 { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/memberships/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/memberships/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204") } @@ -2681,7 +2712,8 @@ package io.apibuilder.api.v0 { namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Organization]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -2693,7 +2725,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/organizations", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/organizations", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.Organization]", r, _.validate[Seq[io.apibuilder.api.v0.models.Organization]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2701,9 +2733,10 @@ package io.apibuilder.api.v0 { override def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Organization] = { - _executeRequest("GET", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Organization", r, _.validate[io.apibuilder.api.v0.models.Organization]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -2712,11 +2745,12 @@ package io.apibuilder.api.v0 { override def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Organization] = { val payload = play.api.libs.json.Json.toJson(organizationForm) - _executeRequest("POST", s"/organizations", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/organizations", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Organization", r, _.validate[io.apibuilder.api.v0.models.Organization]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -2726,11 +2760,12 @@ package io.apibuilder.api.v0 { override def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Organization] = { val payload = play.api.libs.json.Json.toJson(organizationForm) - _executeRequest("PUT", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("PUT", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Organization", r, _.validate[io.apibuilder.api.v0.models.Organization]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -2739,9 +2774,10 @@ package io.apibuilder.api.v0 { override def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204") } @@ -2752,7 +2788,8 @@ package io.apibuilder.api.v0 { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.AttributeValue]] = { val queryParameters = Seq( name.map("name" -> _), @@ -2760,7 +2797,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}/attributes", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}/attributes", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.AttributeValue]", r, _.validate[Seq[io.apibuilder.api.v0.models.AttributeValue]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2769,9 +2806,10 @@ package io.apibuilder.api.v0 { override def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.AttributeValue] = { - _executeRequest("GET", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}/attributes/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}/attributes/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.AttributeValue", r, _.validate[io.apibuilder.api.v0.models.AttributeValue]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -2782,11 +2820,12 @@ package io.apibuilder.api.v0 { key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.AttributeValue] = { val payload = play.api.libs.json.Json.toJson(attributeValueForm) - _executeRequest("PUT", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}/attributes/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("PUT", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}/attributes/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.AttributeValue", r, _.validate[io.apibuilder.api.v0.models.AttributeValue]) case r if r.status == 201 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.AttributeValue", r, _.validate[io.apibuilder.api.v0.models.AttributeValue]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) @@ -2798,9 +2837,10 @@ package io.apibuilder.api.v0 { override def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}/attributes/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/organizations/${play.utils.UriEncoding.encodePathSegment(key, "UTF-8")}/attributes/${play.utils.UriEncoding.encodePathSegment(name, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r if r.status == 401 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) @@ -2812,11 +2852,12 @@ package io.apibuilder.api.v0 { object PasswordResetRequests extends PasswordResetRequests { override def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { val payload = play.api.libs.json.Json.toJson(passwordResetRequest) - _executeRequest("POST", s"/password_reset_requests", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/password_reset_requests", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204, 409") @@ -2827,11 +2868,12 @@ package io.apibuilder.api.v0 { object PasswordResets extends PasswordResets { override def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.PasswordResetSuccess] = { val payload = play.api.libs.json.Json.toJson(passwordReset) - _executeRequest("POST", s"/password_resets", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/password_resets", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.PasswordResetSuccess", r, _.validate[io.apibuilder.api.v0.models.PasswordResetSuccess]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -2847,7 +2889,8 @@ package io.apibuilder.api.v0 { publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Subscription]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -2858,7 +2901,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/subscriptions", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/subscriptions", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.Subscription]", r, _.validate[Seq[io.apibuilder.api.v0.models.Subscription]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2866,9 +2909,10 @@ package io.apibuilder.api.v0 { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Subscription] = { - _executeRequest("GET", s"/subscriptions/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/subscriptions/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Subscription", r, _.validate[io.apibuilder.api.v0.models.Subscription]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -2877,11 +2921,12 @@ package io.apibuilder.api.v0 { override def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Subscription] = { val payload = play.api.libs.json.Json.toJson(subscriptionForm) - _executeRequest("POST", s"/subscriptions", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/subscriptions", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 201 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Subscription", r, _.validate[io.apibuilder.api.v0.models.Subscription]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 201, 409") @@ -2890,9 +2935,10 @@ package io.apibuilder.api.v0 { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/subscriptions/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/subscriptions/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204") } @@ -2905,7 +2951,8 @@ package io.apibuilder.api.v0 { guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Token]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -2913,7 +2960,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/tokens/users/${userGuid}", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/tokens/users/${userGuid}", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.Token]", r, _.validate[Seq[io.apibuilder.api.v0.models.Token]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2921,9 +2968,10 @@ package io.apibuilder.api.v0 { override def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.CleartextToken] = { - _executeRequest("GET", s"/tokens/${guid}/cleartext", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/tokens/${guid}/cleartext", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.CleartextToken", r, _.validate[io.apibuilder.api.v0.models.CleartextToken]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -2932,11 +2980,12 @@ package io.apibuilder.api.v0 { override def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Token] = { val payload = play.api.libs.json.Json.toJson(tokenForm) - _executeRequest("POST", s"/tokens", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/tokens", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 201 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Token", r, _.validate[io.apibuilder.api.v0.models.Token]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 201, 409") @@ -2945,9 +2994,10 @@ package io.apibuilder.api.v0 { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/tokens/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/tokens/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204") } @@ -2959,7 +3009,8 @@ package io.apibuilder.api.v0 { guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.User]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -2967,7 +3018,7 @@ package io.apibuilder.api.v0 { token.map("token" -> _) ).flatten - _executeRequest("GET", s"/users", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/users", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.User]", r, _.validate[Seq[io.apibuilder.api.v0.models.User]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -2975,9 +3026,10 @@ package io.apibuilder.api.v0 { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.User] = { - _executeRequest("GET", s"/users/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/users/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.User", r, _.validate[io.apibuilder.api.v0.models.User]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -2987,14 +3039,15 @@ package io.apibuilder.api.v0 { override def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.User] = { val payload = play.api.libs.json.Json.obj( "email" -> play.api.libs.json.Json.toJson(email), "password" -> play.api.libs.json.Json.toJson(password) ) - _executeRequest("POST", s"/users/authenticate", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/users/authenticate", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.User", r, _.validate[io.apibuilder.api.v0.models.User]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -3003,11 +3056,12 @@ package io.apibuilder.api.v0 { override def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.User] = { val payload = play.api.libs.json.Json.toJson(userForm) - _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.User", r, _.validate[io.apibuilder.api.v0.models.User]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -3017,11 +3071,12 @@ package io.apibuilder.api.v0 { override def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.User] = { val payload = play.api.libs.json.Json.toJson(userUpdateForm) - _executeRequest("PUT", s"/users/${guid}", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("PUT", s"/users/${guid}", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.User", r, _.validate[io.apibuilder.api.v0.models.User]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -3032,11 +3087,12 @@ package io.apibuilder.api.v0 { object Validations extends Validations { override def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Validation] = { val payload = play.api.libs.json.Json.toJson(value) - _executeRequest("POST", s"/validations", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/validations", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Validation", r, _.validate[io.apibuilder.api.v0.models.Validation]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -3049,14 +3105,15 @@ package io.apibuilder.api.v0 { applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Version]] = { val queryParameters = Seq( Some("limit" -> limit.toString), Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.Version]", r, _.validate[Seq[io.apibuilder.api.v0.models.Version]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -3066,9 +3123,10 @@ package io.apibuilder.api.v0 { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Version] = { - _executeRequest("GET", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(version, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(version, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Version", r, _.validate[io.apibuilder.api.v0.models.Version]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -3079,11 +3137,12 @@ package io.apibuilder.api.v0 { orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Version] = { val payload = play.api.libs.json.Json.toJson(versionForm) - _executeRequest("POST", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(version, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(version, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Version", r, _.validate[io.apibuilder.api.v0.models.Version]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -3095,11 +3154,12 @@ package io.apibuilder.api.v0 { applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Version] = { val payload = play.api.libs.json.Json.toJson(versionForm) - _executeRequest("PUT", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(version, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("PUT", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(version, "UTF-8")}", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Version", r, _.validate[io.apibuilder.api.v0.models.Version]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 409") @@ -3110,9 +3170,10 @@ package io.apibuilder.api.v0 { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(version, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/${play.utils.UriEncoding.encodePathSegment(orgKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(applicationKey, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(version, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204") } @@ -3127,7 +3188,8 @@ package io.apibuilder.api.v0 { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Watch]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -3138,7 +3200,7 @@ package io.apibuilder.api.v0 { Some("offset" -> offset.toString) ).flatten - _executeRequest("GET", s"/watches", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/watches", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Seq[io.apibuilder.api.v0.models.Watch]", r, _.validate[Seq[io.apibuilder.api.v0.models.Watch]]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -3146,9 +3208,10 @@ package io.apibuilder.api.v0 { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Watch] = { - _executeRequest("GET", s"/watches/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/watches/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Watch", r, _.validate[io.apibuilder.api.v0.models.Watch]) case r if r.status == 404 => throw io.apibuilder.api.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -3159,7 +3222,8 @@ package io.apibuilder.api.v0 { userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Boolean] = { val queryParameters = Seq( userGuid.map("user_guid" -> _.toString), @@ -3167,7 +3231,7 @@ package io.apibuilder.api.v0 { Some("application_key" -> applicationKey) ).flatten - _executeRequest("GET", s"/watches/check", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/watches/check", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.api.v0.Client.parseJson("Boolean", r, _.validate[Boolean]) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -3175,11 +3239,12 @@ package io.apibuilder.api.v0 { override def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Watch] = { val payload = play.api.libs.json.Json.toJson(watchForm) - _executeRequest("POST", s"/watches", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/watches", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 201 => _root_.io.apibuilder.api.v0.Client.parseJson("io.apibuilder.api.v0.models.Watch", r, _.validate[io.apibuilder.api.v0.models.Watch]) case r if r.status == 409 => throw io.apibuilder.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 201, 409") @@ -3188,9 +3253,10 @@ package io.apibuilder.api.v0 { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("DELETE", s"/watches/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("DELETE", s"/watches/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r => throw io.apibuilder.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204") } @@ -3229,32 +3295,41 @@ package io.apibuilder.api.v0 { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity ): scala.concurrent.Future[play.api.libs.ws.WSResponse] = { method.toUpperCase match { case "GET" => { - _logRequest("GET", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).get() + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("GET", request).get() } case "POST" => { - _logRequest("POST", _requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)).post(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("POST", request).post(body.getOrElse(play.api.libs.json.Json.obj())) } case "PUT" => { - _logRequest("PUT", _requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)).put(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("PUT", request).put(body.getOrElse(play.api.libs.json.Json.obj())) } case "PATCH" => { - _logRequest("PATCH", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).patch(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("PATCH", request).patch(body.getOrElse(play.api.libs.json.Json.obj())) } case "DELETE" => { - _logRequest("DELETE", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).delete() + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("DELETE", request).delete() } - case "HEAD" => { - _logRequest("HEAD", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).head() + case "HEAD" => { + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("HEAD", request).head() } - case "OPTIONS" => { - _logRequest("OPTIONS", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).options() + case "OPTIONS" => { + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("OPTIONS", request).options() } case _ => { - _logRequest(method, _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest(method, request) sys.error("Unsupported method[%s]".format(method)) } } @@ -3345,7 +3420,8 @@ package io.apibuilder.api.v0 { hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Application]] /** @@ -3354,7 +3430,8 @@ package io.apibuilder.api.v0 { def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Application] /** @@ -3364,7 +3441,8 @@ package io.apibuilder.api.v0 { orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Application] /** @@ -3373,7 +3451,8 @@ package io.apibuilder.api.v0 { def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] /** @@ -3383,7 +3462,8 @@ package io.apibuilder.api.v0 { orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Application] } @@ -3401,7 +3481,8 @@ package io.apibuilder.api.v0 { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Attribute]] /** @@ -3409,7 +3490,8 @@ package io.apibuilder.api.v0 { */ def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Attribute] /** @@ -3417,7 +3499,8 @@ package io.apibuilder.api.v0 { */ def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Attribute] /** @@ -3426,7 +3509,8 @@ package io.apibuilder.api.v0 { */ def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -3442,7 +3526,8 @@ package io.apibuilder.api.v0 { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Change]] } @@ -3460,7 +3545,8 @@ package io.apibuilder.api.v0 { applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Code] } @@ -3471,7 +3557,8 @@ package io.apibuilder.api.v0 { def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Domain] /** @@ -3480,7 +3567,8 @@ package io.apibuilder.api.v0 { def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -3490,7 +3578,8 @@ package io.apibuilder.api.v0 { */ def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -3507,17 +3596,20 @@ package io.apibuilder.api.v0 { generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.GeneratorService]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.GeneratorService] def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.GeneratorService] /** @@ -3525,7 +3617,8 @@ package io.apibuilder.api.v0 { */ def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -3549,22 +3642,26 @@ package io.apibuilder.api.v0 { key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.GeneratorWithService] } trait Healthchecks { def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.generator.v0.models.Healthcheck] def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Map[String, String]] } @@ -3578,12 +3675,14 @@ package io.apibuilder.api.v0 { q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Item]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Item] } @@ -3601,7 +3700,8 @@ package io.apibuilder.api.v0 { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.MembershipRequest]] /** @@ -3611,7 +3711,8 @@ package io.apibuilder.api.v0 { orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.MembershipRequest] /** @@ -3620,7 +3721,8 @@ package io.apibuilder.api.v0 { */ def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] /** @@ -3629,7 +3731,8 @@ package io.apibuilder.api.v0 { */ def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -3647,17 +3750,20 @@ package io.apibuilder.api.v0 { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Membership]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Membership] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -3683,7 +3789,8 @@ package io.apibuilder.api.v0 { namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Organization]] /** @@ -3691,7 +3798,8 @@ package io.apibuilder.api.v0 { */ def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Organization] /** @@ -3699,7 +3807,8 @@ package io.apibuilder.api.v0 { */ def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Organization] /** @@ -3708,7 +3817,8 @@ package io.apibuilder.api.v0 { def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Organization] /** @@ -3716,7 +3826,8 @@ package io.apibuilder.api.v0 { */ def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] /** @@ -3732,7 +3843,8 @@ package io.apibuilder.api.v0 { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.AttributeValue]] /** @@ -3741,7 +3853,8 @@ package io.apibuilder.api.v0 { def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.AttributeValue] /** @@ -3751,7 +3864,8 @@ package io.apibuilder.api.v0 { key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.AttributeValue] /** @@ -3761,7 +3875,8 @@ package io.apibuilder.api.v0 { def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -3772,7 +3887,8 @@ package io.apibuilder.api.v0 { */ def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -3784,7 +3900,8 @@ package io.apibuilder.api.v0 { */ def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.PasswordResetSuccess] } @@ -3806,7 +3923,8 @@ package io.apibuilder.api.v0 { publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Subscription]] /** @@ -3814,7 +3932,8 @@ package io.apibuilder.api.v0 { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Subscription] /** @@ -3822,12 +3941,14 @@ package io.apibuilder.api.v0 { */ def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Subscription] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -3841,7 +3962,8 @@ package io.apibuilder.api.v0 { guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Token]] /** @@ -3849,7 +3971,8 @@ package io.apibuilder.api.v0 { */ def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.CleartextToken] /** @@ -3857,12 +3980,14 @@ package io.apibuilder.api.v0 { */ def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Token] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -3879,7 +4004,8 @@ package io.apibuilder.api.v0 { guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.User]] /** @@ -3887,7 +4013,8 @@ package io.apibuilder.api.v0 { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.User] /** @@ -3898,7 +4025,8 @@ package io.apibuilder.api.v0 { def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.User] /** @@ -3906,7 +4034,8 @@ package io.apibuilder.api.v0 { */ def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.User] /** @@ -3915,14 +4044,16 @@ package io.apibuilder.api.v0 { def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.User] } trait Validations { def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Validation] } @@ -3940,7 +4071,8 @@ package io.apibuilder.api.v0 { applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Version]] /** @@ -3953,7 +4085,8 @@ package io.apibuilder.api.v0 { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Version] /** @@ -3963,7 +4096,8 @@ package io.apibuilder.api.v0 { orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Version] /** @@ -3974,7 +4108,8 @@ package io.apibuilder.api.v0 { applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Version] /** @@ -3984,7 +4119,8 @@ package io.apibuilder.api.v0 { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } @@ -4006,7 +4142,8 @@ package io.apibuilder.api.v0 { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.api.v0.models.Watch]] /** @@ -4014,7 +4151,8 @@ package io.apibuilder.api.v0 { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Watch] /** @@ -4027,7 +4165,8 @@ package io.apibuilder.api.v0 { userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Boolean] /** @@ -4035,12 +4174,14 @@ package io.apibuilder.api.v0 { */ def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.api.v0.models.Watch] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } diff --git a/lib/src/test/resources/generators/play-27-built-in-types.txt b/lib/src/test/resources/generators/play-27-built-in-types.txt index 7ef64819a..361de69f9 100644 --- a/lib/src/test/resources/generators/play-27-built-in-types.txt +++ b/lib/src/test/resources/generators/play-27-built-in-types.txt @@ -455,9 +455,10 @@ package apibuilder { object Arrays extends Arrays { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Array] = { - _executeRequest("GET", s"/arrays", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/arrays", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Array", r, _.validate[apibuilder.models.Array]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -466,9 +467,10 @@ package apibuilder { object Optarrays extends Optarrays { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optarray] = { - _executeRequest("GET", s"/optarrays", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/optarrays", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Optarray", r, _.validate[apibuilder.models.Optarray]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -477,9 +479,10 @@ package apibuilder { object Optionals extends Optionals { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optional] = { - _executeRequest("GET", s"/optionals", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/optionals", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Optional", r, _.validate[apibuilder.models.Optional]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -488,9 +491,10 @@ package apibuilder { object Requireds extends Requireds { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Required] = { - _executeRequest("GET", s"/requireds", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/requireds", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.apibuilder.Client.parseJson("apibuilder.models.Required", r, _.validate[apibuilder.models.Required]) case r => throw apibuilder.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -529,32 +533,41 @@ package apibuilder { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity ): scala.concurrent.Future[play.api.libs.ws.WSResponse] = { method.toUpperCase match { case "GET" => { - _logRequest("GET", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).get() + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("GET", request).get() } case "POST" => { - _logRequest("POST", _requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)).post(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("POST", request).post(body.getOrElse(play.api.libs.json.Json.obj())) } case "PUT" => { - _logRequest("PUT", _requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)).put(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("PUT", request).put(body.getOrElse(play.api.libs.json.Json.obj())) } case "PATCH" => { - _logRequest("PATCH", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).patch(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("PATCH", request).patch(body.getOrElse(play.api.libs.json.Json.obj())) } case "DELETE" => { - _logRequest("DELETE", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).delete() + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("DELETE", request).delete() } - case "HEAD" => { - _logRequest("HEAD", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).head() + case "HEAD" => { + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("HEAD", request).head() } - case "OPTIONS" => { - _logRequest("OPTIONS", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).options() + case "OPTIONS" => { + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("OPTIONS", request).options() } case _ => { - _logRequest(method, _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest(method, request) sys.error("Unsupported method[%s]".format(method)) } } @@ -609,25 +622,29 @@ package apibuilder { trait Arrays { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Array] } trait Optarrays { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optarray] } trait Optionals { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Optional] } trait Requireds { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[apibuilder.models.Required] } diff --git a/lib/src/test/resources/generators/play-27-java-instant.txt b/lib/src/test/resources/generators/play-27-java-instant.txt index b465f8eef..2f37c976f 100644 --- a/lib/src/test/resources/generators/play-27-java-instant.txt +++ b/lib/src/test/resources/generators/play-27-java-instant.txt @@ -265,7 +265,8 @@ package io.gregor.time.types.v0 { queryDate: _root_.java.time.LocalDate, queryTime: _root_.java.time.Instant, dateTimeModel: io.gregor.time.types.v0.models.DateTimeModel, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.gregor.time.types.v0.models.DateTimeModel] = { val payload = play.api.libs.json.Json.toJson(dateTimeModel) @@ -274,7 +275,7 @@ package io.gregor.time.types.v0 { Some("query_time" -> queryTime.toString) ).flatten - _executeRequest("POST", s"/date_time_models/${play.utils.UriEncoding.encodePathSegment(pathDate.toString, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(pathTime.toString, "UTF-8")}", body = Some(payload), queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/date_time_models/${play.utils.UriEncoding.encodePathSegment(pathDate.toString, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(pathTime.toString, "UTF-8")}", body = Some(payload), queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.gregor.time.types.v0.Client.parseJson("io.gregor.time.types.v0.models.DateTimeModel", r, _.validate[io.gregor.time.types.v0.models.DateTimeModel]) case r => throw io.gregor.time.types.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -313,32 +314,41 @@ package io.gregor.time.types.v0 { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity ): scala.concurrent.Future[play.api.libs.ws.WSResponse] = { method.toUpperCase match { case "GET" => { - _logRequest("GET", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).get() + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("GET", request).get() } case "POST" => { - _logRequest("POST", _requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)).post(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("POST", request).post(body.getOrElse(play.api.libs.json.Json.obj())) } case "PUT" => { - _logRequest("PUT", _requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)).put(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("PUT", request).put(body.getOrElse(play.api.libs.json.Json.obj())) } case "PATCH" => { - _logRequest("PATCH", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).patch(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("PATCH", request).patch(body.getOrElse(play.api.libs.json.Json.obj())) } case "DELETE" => { - _logRequest("DELETE", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).delete() + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("DELETE", request).delete() } - case "HEAD" => { - _logRequest("HEAD", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).head() + case "HEAD" => { + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("HEAD", request).head() } - case "OPTIONS" => { - _logRequest("OPTIONS", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).options() + case "OPTIONS" => { + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("OPTIONS", request).options() } case _ => { - _logRequest(method, _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest(method, request) sys.error("Unsupported method[%s]".format(method)) } } @@ -395,7 +405,8 @@ package io.gregor.time.types.v0 { queryDate: _root_.java.time.LocalDate, queryTime: _root_.java.time.Instant, dateTimeModel: io.gregor.time.types.v0.models.DateTimeModel, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.gregor.time.types.v0.models.DateTimeModel] } diff --git a/lib/src/test/resources/generators/play-27-java-offsetdatetime.txt b/lib/src/test/resources/generators/play-27-java-offsetdatetime.txt index 73fe376d3..8354a1722 100644 --- a/lib/src/test/resources/generators/play-27-java-offsetdatetime.txt +++ b/lib/src/test/resources/generators/play-27-java-offsetdatetime.txt @@ -265,7 +265,8 @@ package io.gregor.time.types.v0 { queryDate: _root_.java.time.LocalDate, queryTime: _root_.java.time.OffsetDateTime, dateTimeModel: io.gregor.time.types.v0.models.DateTimeModel, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.gregor.time.types.v0.models.DateTimeModel] = { val payload = play.api.libs.json.Json.toJson(dateTimeModel) @@ -274,7 +275,7 @@ package io.gregor.time.types.v0 { Some("query_time" -> queryTime.toString) ).flatten - _executeRequest("POST", s"/date_time_models/${play.utils.UriEncoding.encodePathSegment(pathDate.toString, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(pathTime.toString, "UTF-8")}", body = Some(payload), queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/date_time_models/${play.utils.UriEncoding.encodePathSegment(pathDate.toString, "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(pathTime.toString, "UTF-8")}", body = Some(payload), queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.gregor.time.types.v0.Client.parseJson("io.gregor.time.types.v0.models.DateTimeModel", r, _.validate[io.gregor.time.types.v0.models.DateTimeModel]) case r => throw io.gregor.time.types.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -313,32 +314,41 @@ package io.gregor.time.types.v0 { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity ): scala.concurrent.Future[play.api.libs.ws.WSResponse] = { method.toUpperCase match { case "GET" => { - _logRequest("GET", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).get() + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("GET", request).get() } case "POST" => { - _logRequest("POST", _requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)).post(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("POST", request).post(body.getOrElse(play.api.libs.json.Json.obj())) } case "PUT" => { - _logRequest("PUT", _requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)).put(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("PUT", request).put(body.getOrElse(play.api.libs.json.Json.obj())) } case "PATCH" => { - _logRequest("PATCH", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).patch(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("PATCH", request).patch(body.getOrElse(play.api.libs.json.Json.obj())) } case "DELETE" => { - _logRequest("DELETE", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).delete() + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("DELETE", request).delete() } - case "HEAD" => { - _logRequest("HEAD", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).head() + case "HEAD" => { + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("HEAD", request).head() } - case "OPTIONS" => { - _logRequest("OPTIONS", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).options() + case "OPTIONS" => { + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("OPTIONS", request).options() } case _ => { - _logRequest(method, _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest(method, request) sys.error("Unsupported method[%s]".format(method)) } } @@ -395,7 +405,8 @@ package io.gregor.time.types.v0 { queryDate: _root_.java.time.LocalDate, queryTime: _root_.java.time.OffsetDateTime, dateTimeModel: io.gregor.time.types.v0.models.DateTimeModel, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.gregor.time.types.v0.models.DateTimeModel] } diff --git a/lib/src/test/resources/generators/play-27-joda-date-time.txt b/lib/src/test/resources/generators/play-27-joda-date-time.txt index 03979ef68..33d900dba 100644 --- a/lib/src/test/resources/generators/play-27-joda-date-time.txt +++ b/lib/src/test/resources/generators/play-27-joda-date-time.txt @@ -291,7 +291,8 @@ package io.gregor.time.types.v0 { queryDate: _root_.org.joda.time.LocalDate, queryTime: _root_.org.joda.time.DateTime, dateTimeModel: io.gregor.time.types.v0.models.DateTimeModel, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.gregor.time.types.v0.models.DateTimeModel] = { val payload = play.api.libs.json.Json.toJson(dateTimeModel) @@ -300,7 +301,7 @@ package io.gregor.time.types.v0 { Some("query_time" -> _root_.org.joda.time.format.ISODateTimeFormat.dateTime.print(queryTime)) ).flatten - _executeRequest("POST", s"/date_time_models/${play.utils.UriEncoding.encodePathSegment(_root_.org.joda.time.format.ISODateTimeFormat.date.print(pathDate), "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(_root_.org.joda.time.format.ISODateTimeFormat.dateTime.print(pathTime), "UTF-8")}", body = Some(payload), queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/date_time_models/${play.utils.UriEncoding.encodePathSegment(_root_.org.joda.time.format.ISODateTimeFormat.date.print(pathDate), "UTF-8")}/${play.utils.UriEncoding.encodePathSegment(_root_.org.joda.time.format.ISODateTimeFormat.dateTime.print(pathTime), "UTF-8")}", body = Some(payload), queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.gregor.time.types.v0.Client.parseJson("io.gregor.time.types.v0.models.DateTimeModel", r, _.validate[io.gregor.time.types.v0.models.DateTimeModel]) case r => throw io.gregor.time.types.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -339,32 +340,41 @@ package io.gregor.time.types.v0 { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity ): scala.concurrent.Future[play.api.libs.ws.WSResponse] = { method.toUpperCase match { case "GET" => { - _logRequest("GET", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).get() + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("GET", request).get() } case "POST" => { - _logRequest("POST", _requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)).post(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("POST", request).post(body.getOrElse(play.api.libs.json.Json.obj())) } case "PUT" => { - _logRequest("PUT", _requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)).put(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(_withJsonContentType(requestHeaders):_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("PUT", request).put(body.getOrElse(play.api.libs.json.Json.obj())) } case "PATCH" => { - _logRequest("PATCH", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).patch(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("PATCH", request).patch(body.getOrElse(play.api.libs.json.Json.obj())) } case "DELETE" => { - _logRequest("DELETE", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).delete() + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("DELETE", request).delete() } - case "HEAD" => { - _logRequest("HEAD", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).head() + case "HEAD" => { + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("HEAD", request).head() } - case "OPTIONS" => { - _logRequest("OPTIONS", _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)).options() + case "OPTIONS" => { + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest("OPTIONS", request).options() } case _ => { - _logRequest(method, _requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + val request = requestModifier(_requestHolder(path).addHttpHeaders(requestHeaders:_*).addQueryStringParameters(queryParameters:_*)) + _logRequest(method, request) sys.error("Unsupported method[%s]".format(method)) } } @@ -421,7 +431,8 @@ package io.gregor.time.types.v0 { queryDate: _root_.org.joda.time.LocalDate, queryTime: _root_.org.joda.time.DateTime, dateTimeModel: io.gregor.time.types.v0.models.DateTimeModel, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.gregor.time.types.v0.models.DateTimeModel] } diff --git a/lib/src/test/resources/generators/reference-spec-ning-client.txt b/lib/src/test/resources/generators/reference-spec-ning-client.txt index 3f1a61e5c..bfede5e1a 100644 --- a/lib/src/test/resources/generators/reference-spec-ning-client.txt +++ b/lib/src/test/resources/generators/reference-spec-ning-client.txt @@ -456,7 +456,8 @@ package io.apibuilder.reference.api.v0 { foo: _root_.scala.Option[String] = None, optionalMessages: _root_.scala.Option[Seq[String]] = None, requiredMessages: Seq[String], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { val queryParameters = Seq( foo.map("foo" -> _) @@ -464,7 +465,7 @@ package io.apibuilder.reference.api.v0 { optionalMessages.getOrElse(Nil).map("optional_messages" -> _) ++ requiredMessages.map("required_messages" -> _) - _executeRequest("GET", s"/echoes", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/echoes", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 204 => () case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 204", requestUri = Some(r.getUri)) } @@ -473,12 +474,13 @@ package io.apibuilder.reference.api.v0 { override def getArraysOnly( optionalMessages: _root_.scala.Option[Seq[String]] = None, requiredMessages: Seq[String], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { val queryParameters = optionalMessages.getOrElse(Nil).map("optional_messages" -> _) ++ requiredMessages.map("required_messages" -> _) - _executeRequest("GET", s"/echoes/arrays-only", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/echoes/arrays-only", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 204 => () case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 204", requestUri = Some(r.getUri)) } @@ -488,9 +490,10 @@ package io.apibuilder.reference.api.v0 { object Groups extends Groups { override def getByOrganization( organization: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Map[String, Seq[io.apibuilder.reference.api.v0.models.User]]] = { - _executeRequest("GET", s"/groups/${organization}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/groups/${organization}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Map[String, Seq[io.apibuilder.reference.api.v0.models.User]]", r, _.validate[Map[String, Seq[io.apibuilder.reference.api.v0.models.User]]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri)) } @@ -503,7 +506,8 @@ package io.apibuilder.reference.api.v0 { organization: _root_.java.util.UUID, user: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Member] = { val payload = play.api.libs.json.Json.obj( "guid" -> play.api.libs.json.Json.toJson(guid), @@ -512,7 +516,7 @@ package io.apibuilder.reference.api.v0 { "role" -> play.api.libs.json.Json.toJson(role) ) - _executeRequest("POST", s"/members", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/members", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 201 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("io.apibuilder.reference.api.v0.models.Member", r, _.validate[io.apibuilder.reference.api.v0.models.Member]) case r if r.getStatusCode == 409 => throw io.apibuilder.reference.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 201, 409", requestUri = Some(r.getUri)) @@ -524,7 +528,8 @@ package io.apibuilder.reference.api.v0 { organizationGuid: _root_.scala.Option[_root_.java.util.UUID] = None, userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, role: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -533,7 +538,7 @@ package io.apibuilder.reference.api.v0 { role.map("role" -> _) ).flatten - _executeRequest("GET", s"/members", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/members", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.Member]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.Member]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri)) } @@ -541,9 +546,10 @@ package io.apibuilder.reference.api.v0 { override def getByOrganization( organization: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] = { - _executeRequest("GET", s"/members/${organization}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/members/${organization}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.Member]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.Member]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri)) } @@ -552,11 +558,12 @@ package io.apibuilder.reference.api.v0 { override def postMembersBulkByOrganization( organization: _root_.java.util.UUID, members: Seq[io.apibuilder.reference.api.v0.models.Member], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] = { val payload = play.api.libs.json.Json.toJson(members) - _executeRequest("POST", s"/members/${organization}/members_bulk", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/members/${organization}/members_bulk", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.Member]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.Member]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri)) } @@ -566,13 +573,14 @@ package io.apibuilder.reference.api.v0 { object Organizations extends Organizations { override def post( organization: io.apibuilder.reference.api.v0.models.Organization, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Organization] = { val payload = play.api.libs.json.Json.obj( "organization" -> play.api.libs.json.Json.toJson(organization) ) - _executeRequest("POST", s"/organizations", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/organizations", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 201 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("io.apibuilder.reference.api.v0.models.Organization", r, _.validate[io.apibuilder.reference.api.v0.models.Organization]) case r if r.getStatusCode == 409 => throw io.apibuilder.reference.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 201, 409", requestUri = Some(r.getUri)) @@ -582,14 +590,15 @@ package io.apibuilder.reference.api.v0 { override def get( guid: _root_.scala.Option[_root_.java.util.UUID] = None, name: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Organization]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), name.map("name" -> _) ).flatten - _executeRequest("GET", s"/organizations", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/organizations", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.Organization]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.Organization]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri)) } @@ -597,9 +606,10 @@ package io.apibuilder.reference.api.v0 { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Organization] = { - _executeRequest("GET", s"/organizations/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/organizations/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("io.apibuilder.reference.api.v0.models.Organization", r, _.validate[io.apibuilder.reference.api.v0.models.Organization]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri)) } @@ -611,7 +621,8 @@ package io.apibuilder.reference.api.v0 { guid: _root_.java.util.UUID, email: String, active: Boolean, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.User] = { val payload = play.api.libs.json.Json.obj( "guid" -> play.api.libs.json.Json.toJson(guid), @@ -619,7 +630,7 @@ package io.apibuilder.reference.api.v0 { "active" -> play.api.libs.json.Json.toJson(active) ) - _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 201 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("io.apibuilder.reference.api.v0.models.User", r, _.validate[io.apibuilder.reference.api.v0.models.User]) case r if r.getStatusCode == 409 => throw io.apibuilder.reference.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 201, 409", requestUri = Some(r.getUri)) @@ -632,7 +643,8 @@ package io.apibuilder.reference.api.v0 { ageGroup: _root_.scala.Option[io.apibuilder.reference.api.v0.models.AgeGroup] = None, email: _root_.scala.Option[String] = None, active: Boolean = true, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.User]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -642,7 +654,7 @@ package io.apibuilder.reference.api.v0 { ).flatten ++ organizationGuids.getOrElse(Nil).map("organization_guids" -> _.toString) - _executeRequest("GET", s"/users", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/users", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.User]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.User]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri)) } @@ -650,18 +662,20 @@ package io.apibuilder.reference.api.v0 { override def getByAgeGroup( ageGroup: io.apibuilder.reference.api.v0.models.AgeGroup, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.User]] = { - _executeRequest("GET", s"/users/${_root_.io.apibuilder.reference.api.v0.PathSegment.encode(ageGroup.toString, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/users/${_root_.io.apibuilder.reference.api.v0.PathSegment.encode(ageGroup.toString, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.User]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.User]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri)) } } override def postNoop( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("POST", s"/users/noop", requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/users/noop", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => () case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri)) } @@ -680,8 +694,8 @@ package io.apibuilder.reference.api.v0 { } } - def _requestBuilder(method: String, path: String, requestHeaders: Seq[(String, String)]): RequestBuilder = { - val builder = new RequestBuilder(method) + def _requestBuilder(method: String, path: String, requestHeaders: Seq[(String, String)]): _root_.com.ning.http.client.RequestBuilder = { + val builder = new _root_.com.ning.http.client.RequestBuilder(method) .setUrl(baseUrl + path) .addHeader("User-Agent", Constants.UserAgent) .addHeader("X-Apidoc-Version", Constants.Version) @@ -710,7 +724,8 @@ package io.apibuilder.reference.api.v0 { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.ning.http.client.Response] = { val allHeaders = body match { case None => requestHeaders @@ -728,7 +743,7 @@ package io.apibuilder.reference.api.v0 { request.setBody(serialized) } - val finalRequest = requestWithParamsAndBody.build() + val finalRequest = requestModifier(requestWithParamsAndBody).build() _logRequest(finalRequest) val result = scala.concurrent.Promise[com.ning.http.client.Response]() @@ -805,20 +820,23 @@ package io.apibuilder.reference.api.v0 { foo: _root_.scala.Option[String] = None, optionalMessages: _root_.scala.Option[Seq[String]] = None, requiredMessages: Seq[String], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] def getArraysOnly( optionalMessages: _root_.scala.Option[Seq[String]] = None, requiredMessages: Seq[String], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } trait Groups { def getByOrganization( organization: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Map[String, Seq[io.apibuilder.reference.api.v0.models.User]]] } @@ -828,7 +846,8 @@ package io.apibuilder.reference.api.v0 { organization: _root_.java.util.UUID, user: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Member] def get( @@ -836,36 +855,42 @@ package io.apibuilder.reference.api.v0 { organizationGuid: _root_.scala.Option[_root_.java.util.UUID] = None, userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, role: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] def getByOrganization( organization: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] def postMembersBulkByOrganization( organization: _root_.java.util.UUID, members: Seq[io.apibuilder.reference.api.v0.models.Member], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] } trait Organizations { def post( organization: io.apibuilder.reference.api.v0.models.Organization, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Organization] def get( guid: _root_.scala.Option[_root_.java.util.UUID] = None, name: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Organization]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Organization] } @@ -874,7 +899,8 @@ package io.apibuilder.reference.api.v0 { guid: _root_.java.util.UUID, email: String, active: Boolean, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.User] /** @@ -887,16 +913,19 @@ package io.apibuilder.reference.api.v0 { ageGroup: _root_.scala.Option[io.apibuilder.reference.api.v0.models.AgeGroup] = None, email: _root_.scala.Option[String] = None, active: Boolean = true, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.User]] def getByAgeGroup( ageGroup: io.apibuilder.reference.api.v0.models.AgeGroup, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.User]] def postNoop( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } diff --git a/lib/src/test/resources/generators/reference-spec-play-23.txt b/lib/src/test/resources/generators/reference-spec-play-23.txt index 7c2b72903..3bc895fe7 100644 --- a/lib/src/test/resources/generators/reference-spec-play-23.txt +++ b/lib/src/test/resources/generators/reference-spec-play-23.txt @@ -562,7 +562,8 @@ package io.apibuilder.reference.api.v0 { foo: _root_.scala.Option[String] = None, optionalMessages: _root_.scala.Option[Seq[String]] = None, requiredMessages: Seq[String], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { val queryParameters = Seq( foo.map("foo" -> _) @@ -570,7 +571,7 @@ package io.apibuilder.reference.api.v0 { optionalMessages.getOrElse(Nil).map("optional_messages" -> _) ++ requiredMessages.map("required_messages" -> _) - _executeRequest("GET", s"/echoes", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/echoes", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204") } @@ -579,12 +580,13 @@ package io.apibuilder.reference.api.v0 { override def getArraysOnly( optionalMessages: _root_.scala.Option[Seq[String]] = None, requiredMessages: Seq[String], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { val queryParameters = optionalMessages.getOrElse(Nil).map("optional_messages" -> _) ++ requiredMessages.map("required_messages" -> _) - _executeRequest("GET", s"/echoes/arrays-only", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/echoes/arrays-only", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204") } @@ -594,9 +596,10 @@ package io.apibuilder.reference.api.v0 { object Groups extends Groups { override def getByOrganization( organization: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Map[String, Seq[io.apibuilder.reference.api.v0.models.User]]] = { - _executeRequest("GET", s"/groups/${organization}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/groups/${organization}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Map[String, Seq[io.apibuilder.reference.api.v0.models.User]]", r, _.validate[Map[String, Seq[io.apibuilder.reference.api.v0.models.User]]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -609,7 +612,8 @@ package io.apibuilder.reference.api.v0 { organization: _root_.java.util.UUID, user: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Member] = { val payload = play.api.libs.json.Json.obj( "guid" -> play.api.libs.json.Json.toJson(guid), @@ -618,7 +622,7 @@ package io.apibuilder.reference.api.v0 { "role" -> play.api.libs.json.Json.toJson(role) ) - _executeRequest("POST", s"/members", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/members", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 201 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("io.apibuilder.reference.api.v0.models.Member", r, _.validate[io.apibuilder.reference.api.v0.models.Member]) case r if r.status == 409 => throw io.apibuilder.reference.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 201, 409") @@ -630,7 +634,8 @@ package io.apibuilder.reference.api.v0 { organizationGuid: _root_.scala.Option[_root_.java.util.UUID] = None, userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, role: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -639,7 +644,7 @@ package io.apibuilder.reference.api.v0 { role.map("role" -> _) ).flatten - _executeRequest("GET", s"/members", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/members", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.Member]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.Member]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -647,9 +652,10 @@ package io.apibuilder.reference.api.v0 { override def getByOrganization( organization: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] = { - _executeRequest("GET", s"/members/${organization}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/members/${organization}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.Member]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.Member]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -658,11 +664,12 @@ package io.apibuilder.reference.api.v0 { override def postMembersBulkByOrganization( organization: _root_.java.util.UUID, members: Seq[io.apibuilder.reference.api.v0.models.Member], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] = { val payload = play.api.libs.json.Json.toJson(members) - _executeRequest("POST", s"/members/${organization}/members_bulk", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/members/${organization}/members_bulk", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.Member]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.Member]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -672,13 +679,14 @@ package io.apibuilder.reference.api.v0 { object Organizations extends Organizations { override def post( organization: io.apibuilder.reference.api.v0.models.Organization, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Organization] = { val payload = play.api.libs.json.Json.obj( "organization" -> play.api.libs.json.Json.toJson(organization) ) - _executeRequest("POST", s"/organizations", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/organizations", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 201 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("io.apibuilder.reference.api.v0.models.Organization", r, _.validate[io.apibuilder.reference.api.v0.models.Organization]) case r if r.status == 409 => throw io.apibuilder.reference.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 201, 409") @@ -688,14 +696,15 @@ package io.apibuilder.reference.api.v0 { override def get( guid: _root_.scala.Option[_root_.java.util.UUID] = None, name: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Organization]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), name.map("name" -> _) ).flatten - _executeRequest("GET", s"/organizations", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/organizations", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.Organization]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.Organization]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -703,9 +712,10 @@ package io.apibuilder.reference.api.v0 { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Organization] = { - _executeRequest("GET", s"/organizations/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/organizations/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("io.apibuilder.reference.api.v0.models.Organization", r, _.validate[io.apibuilder.reference.api.v0.models.Organization]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -717,7 +727,8 @@ package io.apibuilder.reference.api.v0 { guid: _root_.java.util.UUID, email: String, active: Boolean, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.User] = { val payload = play.api.libs.json.Json.obj( "guid" -> play.api.libs.json.Json.toJson(guid), @@ -725,7 +736,7 @@ package io.apibuilder.reference.api.v0 { "active" -> play.api.libs.json.Json.toJson(active) ) - _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 201 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("io.apibuilder.reference.api.v0.models.User", r, _.validate[io.apibuilder.reference.api.v0.models.User]) case r if r.status == 409 => throw io.apibuilder.reference.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 201, 409") @@ -738,7 +749,8 @@ package io.apibuilder.reference.api.v0 { ageGroup: _root_.scala.Option[io.apibuilder.reference.api.v0.models.AgeGroup] = None, email: _root_.scala.Option[String] = None, active: Boolean = true, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.User]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -748,7 +760,7 @@ package io.apibuilder.reference.api.v0 { ).flatten ++ organizationGuids.getOrElse(Nil).map("organization_guids" -> _.toString) - _executeRequest("GET", s"/users", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/users", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.User]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.User]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -756,18 +768,20 @@ package io.apibuilder.reference.api.v0 { override def getByAgeGroup( ageGroup: io.apibuilder.reference.api.v0.models.AgeGroup, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.User]] = { - _executeRequest("GET", s"/users/${play.utils.UriEncoding.encodePathSegment(ageGroup.toString, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/users/${play.utils.UriEncoding.encodePathSegment(ageGroup.toString, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.User]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.User]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } } override def postNoop( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("POST", s"/users/noop", requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/users/noop", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => () case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -807,32 +821,41 @@ package io.apibuilder.reference.api.v0 { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity ): scala.concurrent.Future[play.api.libs.ws.WSResponse] = { method.toUpperCase match { case "GET" => { - _logRequest("GET", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).get() + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("GET", request).get() } case "POST" => { - _logRequest("POST", _requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)).post(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)) + _logRequest("POST", request).post(body.getOrElse(play.api.libs.json.Json.obj())) } case "PUT" => { - _logRequest("PUT", _requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)).put(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)) + _logRequest("PUT", request).put(body.getOrElse(play.api.libs.json.Json.obj())) } case "PATCH" => { - _logRequest("PATCH", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).patch(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("PATCH", request).patch(body.getOrElse(play.api.libs.json.Json.obj())) } case "DELETE" => { - _logRequest("DELETE", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).delete() + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("DELETE", request).delete() } - case "HEAD" => { - _logRequest("HEAD", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).head() + case "HEAD" => { + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("HEAD", request).head() } - case "OPTIONS" => { - _logRequest("OPTIONS", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).options() + case "OPTIONS" => { + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("OPTIONS", request).options() } case _ => { - _logRequest(method, _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest(method, request) sys.error("Unsupported method[%s]".format(method)) } } @@ -891,20 +914,23 @@ package io.apibuilder.reference.api.v0 { foo: _root_.scala.Option[String] = None, optionalMessages: _root_.scala.Option[Seq[String]] = None, requiredMessages: Seq[String], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] def getArraysOnly( optionalMessages: _root_.scala.Option[Seq[String]] = None, requiredMessages: Seq[String], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } trait Groups { def getByOrganization( organization: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Map[String, Seq[io.apibuilder.reference.api.v0.models.User]]] } @@ -914,7 +940,8 @@ package io.apibuilder.reference.api.v0 { organization: _root_.java.util.UUID, user: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Member] def get( @@ -922,36 +949,42 @@ package io.apibuilder.reference.api.v0 { organizationGuid: _root_.scala.Option[_root_.java.util.UUID] = None, userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, role: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] def getByOrganization( organization: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] def postMembersBulkByOrganization( organization: _root_.java.util.UUID, members: Seq[io.apibuilder.reference.api.v0.models.Member], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] } trait Organizations { def post( organization: io.apibuilder.reference.api.v0.models.Organization, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Organization] def get( guid: _root_.scala.Option[_root_.java.util.UUID] = None, name: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Organization]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Organization] } @@ -960,7 +993,8 @@ package io.apibuilder.reference.api.v0 { guid: _root_.java.util.UUID, email: String, active: Boolean, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.User] /** @@ -973,16 +1007,19 @@ package io.apibuilder.reference.api.v0 { ageGroup: _root_.scala.Option[io.apibuilder.reference.api.v0.models.AgeGroup] = None, email: _root_.scala.Option[String] = None, active: Boolean = true, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.User]] def getByAgeGroup( ageGroup: io.apibuilder.reference.api.v0.models.AgeGroup, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.User]] def postNoop( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } diff --git a/lib/src/test/resources/generators/reference-with-imports-spec-ning-client.txt b/lib/src/test/resources/generators/reference-with-imports-spec-ning-client.txt index e08be8b8e..9e008966f 100644 --- a/lib/src/test/resources/generators/reference-with-imports-spec-ning-client.txt +++ b/lib/src/test/resources/generators/reference-with-imports-spec-ning-client.txt @@ -458,7 +458,8 @@ package io.apibuilder.reference.api.v0 { foo: _root_.scala.Option[String] = None, optionalMessages: _root_.scala.Option[Seq[String]] = None, requiredMessages: Seq[String], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { val queryParameters = Seq( foo.map("foo" -> _) @@ -466,7 +467,7 @@ package io.apibuilder.reference.api.v0 { optionalMessages.getOrElse(Nil).map("optional_messages" -> _) ++ requiredMessages.map("required_messages" -> _) - _executeRequest("GET", s"/echoes", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/echoes", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 204 => () case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 204", requestUri = Some(r.getUri)) } @@ -475,12 +476,13 @@ package io.apibuilder.reference.api.v0 { override def getArraysOnly( optionalMessages: _root_.scala.Option[Seq[String]] = None, requiredMessages: Seq[String], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { val queryParameters = optionalMessages.getOrElse(Nil).map("optional_messages" -> _) ++ requiredMessages.map("required_messages" -> _) - _executeRequest("GET", s"/echoes/arrays-only", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/echoes/arrays-only", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 204 => () case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 204", requestUri = Some(r.getUri)) } @@ -490,9 +492,10 @@ package io.apibuilder.reference.api.v0 { object Groups extends Groups { override def getByOrganization( organization: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Map[String, Seq[io.apibuilder.reference.api.v0.models.User]]] = { - _executeRequest("GET", s"/groups/${organization}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/groups/${organization}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Map[String, Seq[io.apibuilder.reference.api.v0.models.User]]", r, _.validate[Map[String, Seq[io.apibuilder.reference.api.v0.models.User]]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri)) } @@ -505,7 +508,8 @@ package io.apibuilder.reference.api.v0 { organization: _root_.java.util.UUID, user: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Member] = { val payload = play.api.libs.json.Json.obj( "guid" -> play.api.libs.json.Json.toJson(guid), @@ -514,7 +518,7 @@ package io.apibuilder.reference.api.v0 { "role" -> play.api.libs.json.Json.toJson(role) ) - _executeRequest("POST", s"/members", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/members", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 201 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("io.apibuilder.reference.api.v0.models.Member", r, _.validate[io.apibuilder.reference.api.v0.models.Member]) case r if r.getStatusCode == 409 => throw io.apibuilder.reference.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 201, 409", requestUri = Some(r.getUri)) @@ -526,7 +530,8 @@ package io.apibuilder.reference.api.v0 { organizationGuid: _root_.scala.Option[_root_.java.util.UUID] = None, userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, role: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -535,7 +540,7 @@ package io.apibuilder.reference.api.v0 { role.map("role" -> _) ).flatten - _executeRequest("GET", s"/members", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/members", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.Member]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.Member]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri)) } @@ -543,9 +548,10 @@ package io.apibuilder.reference.api.v0 { override def getByOrganization( organization: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] = { - _executeRequest("GET", s"/members/${organization}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/members/${organization}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.Member]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.Member]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri)) } @@ -554,11 +560,12 @@ package io.apibuilder.reference.api.v0 { override def postMembersBulkByOrganization( organization: _root_.java.util.UUID, members: Seq[io.apibuilder.reference.api.v0.models.Member], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] = { val payload = play.api.libs.json.Json.toJson(members) - _executeRequest("POST", s"/members/${organization}/members_bulk", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/members/${organization}/members_bulk", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.Member]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.Member]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri)) } @@ -568,13 +575,14 @@ package io.apibuilder.reference.api.v0 { object Organizations extends Organizations { override def postOrganizations( organization: io.apibuilder.reference.api.v0.models.Organization, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Organization] = { val payload = play.api.libs.json.Json.obj( "organization" -> play.api.libs.json.Json.toJson(organization) ) - _executeRequest("POST", s"/organizations", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/organizations", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 201 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("io.apibuilder.reference.api.v0.models.Organization", r, _.validate[io.apibuilder.reference.api.v0.models.Organization]) case r if r.getStatusCode == 409 => throw io.apibuilder.reference.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 201, 409", requestUri = Some(r.getUri)) @@ -584,14 +592,15 @@ package io.apibuilder.reference.api.v0 { override def getOrganizations( guid: _root_.scala.Option[_root_.java.util.UUID] = None, name: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Organization]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), name.map("name" -> _) ).flatten - _executeRequest("GET", s"/organizations", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/organizations", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.Organization]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.Organization]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri)) } @@ -599,9 +608,10 @@ package io.apibuilder.reference.api.v0 { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Organization] = { - _executeRequest("GET", s"/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("io.apibuilder.reference.api.v0.models.Organization", r, _.validate[io.apibuilder.reference.api.v0.models.Organization]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri)) } @@ -613,7 +623,8 @@ package io.apibuilder.reference.api.v0 { guid: _root_.java.util.UUID, email: String, active: Boolean, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.User] = { val payload = play.api.libs.json.Json.obj( "guid" -> play.api.libs.json.Json.toJson(guid), @@ -621,7 +632,7 @@ package io.apibuilder.reference.api.v0 { "active" -> play.api.libs.json.Json.toJson(active) ) - _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 201 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("io.apibuilder.reference.api.v0.models.User", r, _.validate[io.apibuilder.reference.api.v0.models.User]) case r if r.getStatusCode == 409 => throw io.apibuilder.reference.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 201, 409", requestUri = Some(r.getUri)) @@ -634,7 +645,8 @@ package io.apibuilder.reference.api.v0 { ageGroup: _root_.scala.Option[io.apibuilder.reference.api.v0.models.AgeGroup] = None, email: _root_.scala.Option[String] = None, active: Boolean = true, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.User]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -644,7 +656,7 @@ package io.apibuilder.reference.api.v0 { ).flatten ++ organizationGuids.getOrElse(Nil).map("organization_guids" -> _.toString) - _executeRequest("GET", s"/users", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/users", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.User]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.User]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri)) } @@ -652,18 +664,20 @@ package io.apibuilder.reference.api.v0 { override def getByAgeGroup( ageGroup: io.apibuilder.reference.api.v0.models.AgeGroup, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.User]] = { - _executeRequest("GET", s"/users/${_root_.io.apibuilder.reference.api.v0.PathSegment.encode(ageGroup.toString, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/users/${_root_.io.apibuilder.reference.api.v0.PathSegment.encode(ageGroup.toString, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.User]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.User]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri)) } } override def postNoop( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("POST", s"/users/noop", requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/users/noop", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.getStatusCode == 200 => () case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.getStatusCode, s"Unsupported response code[${r.getStatusCode}]. Expected: 200", requestUri = Some(r.getUri)) } @@ -682,8 +696,8 @@ package io.apibuilder.reference.api.v0 { } } - def _requestBuilder(method: String, path: String, requestHeaders: Seq[(String, String)]): RequestBuilder = { - val builder = new RequestBuilder(method) + def _requestBuilder(method: String, path: String, requestHeaders: Seq[(String, String)]): _root_.com.ning.http.client.RequestBuilder = { + val builder = new _root_.com.ning.http.client.RequestBuilder(method) .setUrl(baseUrl + path) .addHeader("User-Agent", Constants.UserAgent) .addHeader("X-Apidoc-Version", Constants.Version) @@ -712,7 +726,8 @@ package io.apibuilder.reference.api.v0 { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[com.ning.http.client.Response] = { val allHeaders = body match { case None => requestHeaders @@ -730,7 +745,7 @@ package io.apibuilder.reference.api.v0 { request.setBody(serialized) } - val finalRequest = requestWithParamsAndBody.build() + val finalRequest = requestModifier(requestWithParamsAndBody).build() _logRequest(finalRequest) val result = scala.concurrent.Promise[com.ning.http.client.Response]() @@ -807,20 +822,23 @@ package io.apibuilder.reference.api.v0 { foo: _root_.scala.Option[String] = None, optionalMessages: _root_.scala.Option[Seq[String]] = None, requiredMessages: Seq[String], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] def getArraysOnly( optionalMessages: _root_.scala.Option[Seq[String]] = None, requiredMessages: Seq[String], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } trait Groups { def getByOrganization( organization: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Map[String, Seq[io.apibuilder.reference.api.v0.models.User]]] } @@ -830,7 +848,8 @@ package io.apibuilder.reference.api.v0 { organization: _root_.java.util.UUID, user: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Member] def get( @@ -838,36 +857,42 @@ package io.apibuilder.reference.api.v0 { organizationGuid: _root_.scala.Option[_root_.java.util.UUID] = None, userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, role: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] def getByOrganization( organization: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] def postMembersBulkByOrganization( organization: _root_.java.util.UUID, members: Seq[io.apibuilder.reference.api.v0.models.Member], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] } trait Organizations { def postOrganizations( organization: io.apibuilder.reference.api.v0.models.Organization, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Organization] def getOrganizations( guid: _root_.scala.Option[_root_.java.util.UUID] = None, name: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Organization]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Organization] } @@ -876,7 +901,8 @@ package io.apibuilder.reference.api.v0 { guid: _root_.java.util.UUID, email: String, active: Boolean, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.User] /** @@ -889,16 +915,19 @@ package io.apibuilder.reference.api.v0 { ageGroup: _root_.scala.Option[io.apibuilder.reference.api.v0.models.AgeGroup] = None, email: _root_.scala.Option[String] = None, active: Boolean = true, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.User]] def getByAgeGroup( ageGroup: io.apibuilder.reference.api.v0.models.AgeGroup, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.User]] def postNoop( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: _root_.com.ning.http.client.RequestBuilder => _root_.com.ning.http.client.RequestBuilder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } diff --git a/lib/src/test/resources/generators/reference-with-imports-spec-play-23.txt b/lib/src/test/resources/generators/reference-with-imports-spec-play-23.txt index de357da47..d9a735385 100644 --- a/lib/src/test/resources/generators/reference-with-imports-spec-play-23.txt +++ b/lib/src/test/resources/generators/reference-with-imports-spec-play-23.txt @@ -564,7 +564,8 @@ package io.apibuilder.reference.api.v0 { foo: _root_.scala.Option[String] = None, optionalMessages: _root_.scala.Option[Seq[String]] = None, requiredMessages: Seq[String], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { val queryParameters = Seq( foo.map("foo" -> _) @@ -572,7 +573,7 @@ package io.apibuilder.reference.api.v0 { optionalMessages.getOrElse(Nil).map("optional_messages" -> _) ++ requiredMessages.map("required_messages" -> _) - _executeRequest("GET", s"/echoes", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/echoes", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204") } @@ -581,12 +582,13 @@ package io.apibuilder.reference.api.v0 { override def getArraysOnly( optionalMessages: _root_.scala.Option[Seq[String]] = None, requiredMessages: Seq[String], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { val queryParameters = optionalMessages.getOrElse(Nil).map("optional_messages" -> _) ++ requiredMessages.map("required_messages" -> _) - _executeRequest("GET", s"/echoes/arrays-only", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/echoes/arrays-only", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 204 => () case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 204") } @@ -596,9 +598,10 @@ package io.apibuilder.reference.api.v0 { object Groups extends Groups { override def getByOrganization( organization: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Map[String, Seq[io.apibuilder.reference.api.v0.models.User]]] = { - _executeRequest("GET", s"/groups/${organization}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/groups/${organization}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Map[String, Seq[io.apibuilder.reference.api.v0.models.User]]", r, _.validate[Map[String, Seq[io.apibuilder.reference.api.v0.models.User]]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -611,7 +614,8 @@ package io.apibuilder.reference.api.v0 { organization: _root_.java.util.UUID, user: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Member] = { val payload = play.api.libs.json.Json.obj( "guid" -> play.api.libs.json.Json.toJson(guid), @@ -620,7 +624,7 @@ package io.apibuilder.reference.api.v0 { "role" -> play.api.libs.json.Json.toJson(role) ) - _executeRequest("POST", s"/members", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/members", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 201 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("io.apibuilder.reference.api.v0.models.Member", r, _.validate[io.apibuilder.reference.api.v0.models.Member]) case r if r.status == 409 => throw io.apibuilder.reference.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 201, 409") @@ -632,7 +636,8 @@ package io.apibuilder.reference.api.v0 { organizationGuid: _root_.scala.Option[_root_.java.util.UUID] = None, userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, role: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -641,7 +646,7 @@ package io.apibuilder.reference.api.v0 { role.map("role" -> _) ).flatten - _executeRequest("GET", s"/members", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/members", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.Member]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.Member]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -649,9 +654,10 @@ package io.apibuilder.reference.api.v0 { override def getByOrganization( organization: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] = { - _executeRequest("GET", s"/members/${organization}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/members/${organization}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.Member]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.Member]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -660,11 +666,12 @@ package io.apibuilder.reference.api.v0 { override def postMembersBulkByOrganization( organization: _root_.java.util.UUID, members: Seq[io.apibuilder.reference.api.v0.models.Member], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] = { val payload = play.api.libs.json.Json.toJson(members) - _executeRequest("POST", s"/members/${organization}/members_bulk", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/members/${organization}/members_bulk", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.Member]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.Member]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -674,13 +681,14 @@ package io.apibuilder.reference.api.v0 { object Organizations extends Organizations { override def postOrganizations( organization: io.apibuilder.reference.api.v0.models.Organization, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Organization] = { val payload = play.api.libs.json.Json.obj( "organization" -> play.api.libs.json.Json.toJson(organization) ) - _executeRequest("POST", s"/organizations", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/organizations", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 201 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("io.apibuilder.reference.api.v0.models.Organization", r, _.validate[io.apibuilder.reference.api.v0.models.Organization]) case r if r.status == 409 => throw io.apibuilder.reference.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 201, 409") @@ -690,14 +698,15 @@ package io.apibuilder.reference.api.v0 { override def getOrganizations( guid: _root_.scala.Option[_root_.java.util.UUID] = None, name: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Organization]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), name.map("name" -> _) ).flatten - _executeRequest("GET", s"/organizations", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/organizations", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.Organization]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.Organization]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -705,9 +714,10 @@ package io.apibuilder.reference.api.v0 { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Organization] = { - _executeRequest("GET", s"/${guid}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/${guid}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("io.apibuilder.reference.api.v0.models.Organization", r, _.validate[io.apibuilder.reference.api.v0.models.Organization]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -719,7 +729,8 @@ package io.apibuilder.reference.api.v0 { guid: _root_.java.util.UUID, email: String, active: Boolean, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.User] = { val payload = play.api.libs.json.Json.obj( "guid" -> play.api.libs.json.Json.toJson(guid), @@ -727,7 +738,7 @@ package io.apibuilder.reference.api.v0 { "active" -> play.api.libs.json.Json.toJson(active) ) - _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 201 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("io.apibuilder.reference.api.v0.models.User", r, _.validate[io.apibuilder.reference.api.v0.models.User]) case r if r.status == 409 => throw io.apibuilder.reference.api.v0.errors.ErrorsResponse(r) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 201, 409") @@ -740,7 +751,8 @@ package io.apibuilder.reference.api.v0 { ageGroup: _root_.scala.Option[io.apibuilder.reference.api.v0.models.AgeGroup] = None, email: _root_.scala.Option[String] = None, active: Boolean = true, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.User]] = { val queryParameters = Seq( guid.map("guid" -> _.toString), @@ -750,7 +762,7 @@ package io.apibuilder.reference.api.v0 { ).flatten ++ organizationGuids.getOrElse(Nil).map("organization_guids" -> _.toString) - _executeRequest("GET", s"/users", queryParameters = queryParameters, requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/users", queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.User]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.User]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -758,18 +770,20 @@ package io.apibuilder.reference.api.v0 { override def getByAgeGroup( ageGroup: io.apibuilder.reference.api.v0.models.AgeGroup, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.User]] = { - _executeRequest("GET", s"/users/${play.utils.UriEncoding.encodePathSegment(ageGroup.toString, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/users/${play.utils.UriEncoding.encodePathSegment(ageGroup.toString, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.reference.api.v0.Client.parseJson("Seq[io.apibuilder.reference.api.v0.models.User]", r, _.validate[Seq[io.apibuilder.reference.api.v0.models.User]]) case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } } override def postNoop( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] = { - _executeRequest("POST", s"/users/noop", requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/users/noop", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => () case r => throw io.apibuilder.reference.api.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -809,32 +823,41 @@ package io.apibuilder.reference.api.v0 { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity ): scala.concurrent.Future[play.api.libs.ws.WSResponse] = { method.toUpperCase match { case "GET" => { - _logRequest("GET", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).get() + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("GET", request).get() } case "POST" => { - _logRequest("POST", _requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)).post(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)) + _logRequest("POST", request).post(body.getOrElse(play.api.libs.json.Json.obj())) } case "PUT" => { - _logRequest("PUT", _requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)).put(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)) + _logRequest("PUT", request).put(body.getOrElse(play.api.libs.json.Json.obj())) } case "PATCH" => { - _logRequest("PATCH", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).patch(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("PATCH", request).patch(body.getOrElse(play.api.libs.json.Json.obj())) } case "DELETE" => { - _logRequest("DELETE", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).delete() + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("DELETE", request).delete() } - case "HEAD" => { - _logRequest("HEAD", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).head() + case "HEAD" => { + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("HEAD", request).head() } - case "OPTIONS" => { - _logRequest("OPTIONS", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).options() + case "OPTIONS" => { + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("OPTIONS", request).options() } case _ => { - _logRequest(method, _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest(method, request) sys.error("Unsupported method[%s]".format(method)) } } @@ -893,20 +916,23 @@ package io.apibuilder.reference.api.v0 { foo: _root_.scala.Option[String] = None, optionalMessages: _root_.scala.Option[Seq[String]] = None, requiredMessages: Seq[String], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] def getArraysOnly( optionalMessages: _root_.scala.Option[Seq[String]] = None, requiredMessages: Seq[String], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } trait Groups { def getByOrganization( organization: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Map[String, Seq[io.apibuilder.reference.api.v0.models.User]]] } @@ -916,7 +942,8 @@ package io.apibuilder.reference.api.v0 { organization: _root_.java.util.UUID, user: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Member] def get( @@ -924,36 +951,42 @@ package io.apibuilder.reference.api.v0 { organizationGuid: _root_.scala.Option[_root_.java.util.UUID] = None, userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, role: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] def getByOrganization( organization: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] def postMembersBulkByOrganization( organization: _root_.java.util.UUID, members: Seq[io.apibuilder.reference.api.v0.models.Member], - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Member]] } trait Organizations { def postOrganizations( organization: io.apibuilder.reference.api.v0.models.Organization, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Organization] def getOrganizations( guid: _root_.scala.Option[_root_.java.util.UUID] = None, name: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.Organization]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.Organization] } @@ -962,7 +995,8 @@ package io.apibuilder.reference.api.v0 { guid: _root_.java.util.UUID, email: String, active: Boolean, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.reference.api.v0.models.User] /** @@ -975,16 +1009,19 @@ package io.apibuilder.reference.api.v0 { ageGroup: _root_.scala.Option[io.apibuilder.reference.api.v0.models.AgeGroup] = None, email: _root_.scala.Option[String] = None, active: Boolean = true, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.User]] def getByAgeGroup( ageGroup: io.apibuilder.reference.api.v0.models.AgeGroup, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.reference.api.v0.models.User]] def postNoop( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Unit] } diff --git a/lib/src/test/resources/generators/scala-primitive-object-response-list.txt b/lib/src/test/resources/generators/scala-primitive-object-response-list.txt index ff8b7b040..5b916007c 100644 --- a/lib/src/test/resources/generators/scala-primitive-object-response-list.txt +++ b/lib/src/test/resources/generators/scala-primitive-object-response-list.txt @@ -1,8 +1,9 @@ object Contents extends Contents { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[_root_.play.api.libs.json.JsObject]] = { - _executeRequest("GET", s"/contents/data", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/contents/data", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.test.apidoc.Client.parseJson("Seq[_root_.play.api.libs.json.JsObject]", r, _.validate[Seq[_root_.play.api.libs.json.JsObject]]) case r => throw test.apidoc.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } diff --git a/lib/src/test/resources/generators/scala-primitive-object-response-map.txt b/lib/src/test/resources/generators/scala-primitive-object-response-map.txt index 4eac39383..c72524fda 100644 --- a/lib/src/test/resources/generators/scala-primitive-object-response-map.txt +++ b/lib/src/test/resources/generators/scala-primitive-object-response-map.txt @@ -1,8 +1,9 @@ object Contents extends Contents { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Map[String, _root_.play.api.libs.json.JsObject]] = { - _executeRequest("GET", s"/contents/data", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/contents/data", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.test.apidoc.Client.parseJson("Map[String, _root_.play.api.libs.json.JsObject]", r, _.validate[Map[String, _root_.play.api.libs.json.JsObject]]) case r => throw test.apidoc.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } diff --git a/lib/src/test/resources/generators/scala-primitive-object-response-singleton.txt b/lib/src/test/resources/generators/scala-primitive-object-response-singleton.txt index 563c4af53..ed1b1f534 100644 --- a/lib/src/test/resources/generators/scala-primitive-object-response-singleton.txt +++ b/lib/src/test/resources/generators/scala-primitive-object-response-singleton.txt @@ -1,8 +1,9 @@ object Contents extends Contents { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequestHolder => play.api.libs.ws.WSRequestHolder = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[_root_.play.api.libs.json.JsObject] = { - _executeRequest("GET", s"/contents/data", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/contents/data", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.test.apidoc.Client.parseJson("_root_.play.api.libs.json.JsObject", r, _.validate[_root_.play.api.libs.json.JsObject]) case r => throw test.apidoc.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } diff --git a/lib/src/test/resources/http4s/apidoc-api/015/BryzekApidocApiV0Client.scala.txt b/lib/src/test/resources/http4s/apidoc-api/015/BryzekApidocApiV0Client.scala.txt index 8a0279756..2af722b7a 100644 --- a/lib/src/test/resources/http4s/apidoc-api/015/BryzekApidocApiV0Client.scala.txt +++ b/lib/src/test/resources/http4s/apidoc-api/015/BryzekApidocApiV0Client.scala.txt @@ -1885,7 +1885,8 @@ def closeAsyncHttpClient(): Unit = { hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Application]] = { val urlPath = Seq(orgKey) @@ -1898,7 +1899,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Application]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Application]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Application]]("Seq[io.apibuilder.api.v0.models.Application]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1907,13 +1908,14 @@ def closeAsyncHttpClient(): Unit = { override def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey) val (payload, formPayload) = (Some(applicationForm), None) - _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1924,13 +1926,14 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey, applicationKey) val (payload, formPayload) = (Some(applicationForm), None) - _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1940,11 +1943,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq(orgKey, applicationKey) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -1954,13 +1958,14 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey, applicationKey, "move") val (payload, formPayload) = (Some(moveForm), None) - _executeRequest[io.apibuilder.api.v0.models.MoveForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.MoveForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1974,7 +1979,8 @@ def closeAsyncHttpClient(): Unit = { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Attribute]] = { val urlPath = Seq("attributes") @@ -1985,7 +1991,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Attribute]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Attribute]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Attribute]]("Seq[io.apibuilder.api.v0.models.Attribute]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1993,11 +1999,12 @@ def closeAsyncHttpClient(): Unit = { override def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Attribute] = { val urlPath = Seq("attributes", name) - _executeRequest[Unit, io.apibuilder.api.v0.models.Attribute]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Attribute]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Attribute]("io.apibuilder.api.v0.models.Attribute", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2006,13 +2013,14 @@ def closeAsyncHttpClient(): Unit = { override def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Attribute] = { val urlPath = Seq("attributes") val (payload, formPayload) = (Some(attributeForm), None) - _executeRequest[io.apibuilder.api.v0.models.AttributeForm, io.apibuilder.api.v0.models.Attribute]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.AttributeForm, io.apibuilder.api.v0.models.Attribute]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Attribute]("io.apibuilder.api.v0.models.Attribute", r) case r if r.status.code == 401 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) @@ -2022,11 +2030,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("attributes", name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r if r.status.code == 401 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -2041,7 +2050,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Change]] = { val urlPath = Seq("changes") @@ -2052,7 +2062,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Change]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Change]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Change]]("Seq[io.apibuilder.api.v0.models.Change]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2065,11 +2075,12 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Code] = { val urlPath = Seq(orgKey, applicationKey, version, generatorKey) - _executeRequest[Unit, io.apibuilder.api.v0.models.Code]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Code]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Code]("io.apibuilder.api.v0.models.Code", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) @@ -2082,13 +2093,14 @@ def closeAsyncHttpClient(): Unit = { override def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Domain] = { val urlPath = Seq("domains", orgKey) val (payload, formPayload) = (Some(domain), None) - _executeRequest[io.apibuilder.api.v0.models.Domain, io.apibuilder.api.v0.models.Domain]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.Domain, io.apibuilder.api.v0.models.Domain]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Domain]("io.apibuilder.api.v0.models.Domain", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2098,11 +2110,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("domains", orgKey, name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2112,13 +2125,14 @@ def closeAsyncHttpClient(): Unit = { object EmailVerificationConfirmationForms extends EmailVerificationConfirmationForms { override def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("email_verification_confirmations") val (payload, formPayload) = (Some(emailVerificationConfirmationForm), None) - _executeRequest[io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -2133,7 +2147,8 @@ def closeAsyncHttpClient(): Unit = { generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.GeneratorService]] = { val urlPath = Seq("generator_services") @@ -2145,7 +2160,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.GeneratorService]]("Seq[io.apibuilder.api.v0.models.GeneratorService]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2153,11 +2168,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.GeneratorService] = { val urlPath = Seq("generator_services", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorService]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorService]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.GeneratorService]("io.apibuilder.api.v0.models.GeneratorService", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2166,13 +2182,14 @@ def closeAsyncHttpClient(): Unit = { override def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.GeneratorService] = { val urlPath = Seq("generator_services") val (payload, formPayload) = (Some(generatorServiceForm), None) - _executeRequest[io.apibuilder.api.v0.models.GeneratorServiceForm, io.apibuilder.api.v0.models.GeneratorService]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.GeneratorServiceForm, io.apibuilder.api.v0.models.GeneratorService]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.GeneratorService]("io.apibuilder.api.v0.models.GeneratorService", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2181,11 +2198,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("generator_services", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r if r.status.code == 403 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -2203,7 +2221,8 @@ def closeAsyncHttpClient(): Unit = { key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] = { val urlPath = Seq("generators") @@ -2217,7 +2236,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("Seq[io.apibuilder.api.v0.models.GeneratorWithService]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2225,11 +2244,12 @@ def closeAsyncHttpClient(): Unit = { override def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.GeneratorWithService] = { val urlPath = Seq("generators", key) - _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorWithService]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorWithService]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.GeneratorWithService]("io.apibuilder.api.v0.models.GeneratorWithService", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2239,22 +2259,24 @@ def closeAsyncHttpClient(): Unit = { object Healthchecks extends Healthchecks { override def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.generator.v0.models.Healthcheck] = { val urlPath = Seq("_internal_", "healthcheck") - _executeRequest[Unit, io.apibuilder.generator.v0.models.Healthcheck]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.generator.v0.models.Healthcheck]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.generator.v0.models.Healthcheck]("io.apibuilder.generator.v0.models.Healthcheck", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } } override def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Map[String, String]] = { val urlPath = Seq("_internal_", "migrate") - _executeRequest[Unit, Map[String, String]]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Map[String, String]]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Map[String, String]]("Map[String, String]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2266,7 +2288,8 @@ def closeAsyncHttpClient(): Unit = { q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Item]] = { val urlPath = Seq("items") @@ -2276,7 +2299,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Item]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Item]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Item]]("Seq[io.apibuilder.api.v0.models.Item]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2284,11 +2307,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Item] = { val urlPath = Seq("items", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Item]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Item]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Item]("io.apibuilder.api.v0.models.Item", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2304,7 +2328,8 @@ def closeAsyncHttpClient(): Unit = { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.MembershipRequest]] = { val urlPath = Seq("membership_requests") @@ -2317,7 +2342,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.MembershipRequest]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.MembershipRequest]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.MembershipRequest]]("Seq[io.apibuilder.api.v0.models.MembershipRequest]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2327,7 +2352,8 @@ def closeAsyncHttpClient(): Unit = { orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.MembershipRequest] = { val urlPath = Seq("membership_requests") @@ -2338,7 +2364,7 @@ def closeAsyncHttpClient(): Unit = { "role" -> role )) - _executeRequest[Unit, io.apibuilder.api.v0.models.MembershipRequest]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.MembershipRequest]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.MembershipRequest]("io.apibuilder.api.v0.models.MembershipRequest", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2347,11 +2373,12 @@ def closeAsyncHttpClient(): Unit = { override def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("membership_requests", guid.toString, "accept") - _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -2360,11 +2387,12 @@ def closeAsyncHttpClient(): Unit = { override def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("membership_requests", guid.toString, "decline") - _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -2380,7 +2408,8 @@ def closeAsyncHttpClient(): Unit = { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Membership]] = { val urlPath = Seq("memberships") @@ -2393,7 +2422,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Membership]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Membership]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Membership]]("Seq[io.apibuilder.api.v0.models.Membership]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2401,11 +2430,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Membership] = { val urlPath = Seq("memberships", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Membership]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Membership]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Membership]("io.apibuilder.api.v0.models.Membership", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2414,11 +2444,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("memberships", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2434,7 +2465,8 @@ def closeAsyncHttpClient(): Unit = { namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Organization]] = { val urlPath = Seq("organizations") @@ -2448,7 +2480,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Organization]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Organization]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Organization]]("Seq[io.apibuilder.api.v0.models.Organization]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2456,11 +2488,12 @@ def closeAsyncHttpClient(): Unit = { override def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations", key) - _executeRequest[Unit, io.apibuilder.api.v0.models.Organization]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Organization]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2469,13 +2502,14 @@ def closeAsyncHttpClient(): Unit = { override def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations") val (payload, formPayload) = (Some(organizationForm), None) - _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2485,13 +2519,14 @@ def closeAsyncHttpClient(): Unit = { override def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations", key) val (payload, formPayload) = (Some(organizationForm), None) - _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2500,11 +2535,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("organizations", key) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2515,7 +2551,8 @@ def closeAsyncHttpClient(): Unit = { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.AttributeValue]] = { val urlPath = Seq("organizations", key, "attributes") @@ -2525,7 +2562,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.AttributeValue]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.AttributeValue]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.AttributeValue]]("Seq[io.apibuilder.api.v0.models.AttributeValue]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2534,11 +2571,12 @@ def closeAsyncHttpClient(): Unit = { override def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.AttributeValue] = { val urlPath = Seq("organizations", key, "attributes", name) - _executeRequest[Unit, io.apibuilder.api.v0.models.AttributeValue]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.AttributeValue]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2549,13 +2587,14 @@ def closeAsyncHttpClient(): Unit = { key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.AttributeValue] = { val urlPath = Seq("organizations", key, "attributes", name) val (payload, formPayload) = (Some(attributeValueForm), None) - _executeRequest[io.apibuilder.api.v0.models.AttributeValueForm, io.apibuilder.api.v0.models.AttributeValue]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.AttributeValueForm, io.apibuilder.api.v0.models.AttributeValue]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -2567,11 +2606,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("organizations", key, "attributes", name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r if r.status.code == 401 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -2583,13 +2623,14 @@ def closeAsyncHttpClient(): Unit = { object PasswordResetRequests extends PasswordResetRequests { override def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("password_reset_requests") val (payload, formPayload) = (Some(passwordResetRequest), None) - _executeRequest[io.apibuilder.api.v0.models.PasswordResetRequest, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.PasswordResetRequest, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -2600,13 +2641,14 @@ def closeAsyncHttpClient(): Unit = { object PasswordResets extends PasswordResets { override def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.PasswordResetSuccess] = { val urlPath = Seq("password_resets") val (payload, formPayload) = (Some(passwordReset), None) - _executeRequest[io.apibuilder.api.v0.models.PasswordReset, io.apibuilder.api.v0.models.PasswordResetSuccess]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.PasswordReset, io.apibuilder.api.v0.models.PasswordResetSuccess]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.PasswordResetSuccess]("io.apibuilder.api.v0.models.PasswordResetSuccess", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2622,7 +2664,8 @@ def closeAsyncHttpClient(): Unit = { publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Subscription]] = { val urlPath = Seq("subscriptions") @@ -2635,7 +2678,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Subscription]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Subscription]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Subscription]]("Seq[io.apibuilder.api.v0.models.Subscription]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2643,11 +2686,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Subscription] = { val urlPath = Seq("subscriptions", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Subscription]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Subscription]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Subscription]("io.apibuilder.api.v0.models.Subscription", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2656,13 +2700,14 @@ def closeAsyncHttpClient(): Unit = { override def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Subscription] = { val urlPath = Seq("subscriptions") val (payload, formPayload) = (Some(subscriptionForm), None) - _executeRequest[io.apibuilder.api.v0.models.SubscriptionForm, io.apibuilder.api.v0.models.Subscription]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.SubscriptionForm, io.apibuilder.api.v0.models.Subscription]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Subscription]("io.apibuilder.api.v0.models.Subscription", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -2671,11 +2716,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("subscriptions", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2688,7 +2734,8 @@ def closeAsyncHttpClient(): Unit = { guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Token]] = { val urlPath = Seq("tokens", "users", userGuid.toString) @@ -2698,7 +2745,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Token]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Token]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Token]]("Seq[io.apibuilder.api.v0.models.Token]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2706,11 +2753,12 @@ def closeAsyncHttpClient(): Unit = { override def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.CleartextToken] = { val urlPath = Seq("tokens", guid.toString, "cleartext") - _executeRequest[Unit, io.apibuilder.api.v0.models.CleartextToken]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.CleartextToken]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.CleartextToken]("io.apibuilder.api.v0.models.CleartextToken", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2719,13 +2767,14 @@ def closeAsyncHttpClient(): Unit = { override def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Token] = { val urlPath = Seq("tokens") val (payload, formPayload) = (Some(tokenForm), None) - _executeRequest[io.apibuilder.api.v0.models.TokenForm, io.apibuilder.api.v0.models.Token]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.TokenForm, io.apibuilder.api.v0.models.Token]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Token]("io.apibuilder.api.v0.models.Token", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -2734,11 +2783,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("tokens", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2750,7 +2800,8 @@ def closeAsyncHttpClient(): Unit = { guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.User]] = { val urlPath = Seq("users") @@ -2760,7 +2811,7 @@ def closeAsyncHttpClient(): Unit = { token.map("token" -> _) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.User]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.User]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.User]]("Seq[io.apibuilder.api.v0.models.User]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2768,11 +2819,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.User]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.User]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2782,7 +2834,8 @@ def closeAsyncHttpClient(): Unit = { override def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", "authenticate") @@ -2792,7 +2845,7 @@ def closeAsyncHttpClient(): Unit = { "password" -> password )) - _executeRequest[Unit, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2801,13 +2854,14 @@ def closeAsyncHttpClient(): Unit = { override def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users") val (payload, formPayload) = (Some(userForm), None) - _executeRequest[io.apibuilder.api.v0.models.UserForm, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.UserForm, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2817,13 +2871,14 @@ def closeAsyncHttpClient(): Unit = { override def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", guid.toString) val (payload, formPayload) = (Some(userUpdateForm), None) - _executeRequest[io.apibuilder.api.v0.models.UserUpdateForm, io.apibuilder.api.v0.models.User]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.UserUpdateForm, io.apibuilder.api.v0.models.User]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2834,13 +2889,14 @@ def closeAsyncHttpClient(): Unit = { object Validations extends Validations { override def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Validation] = { val urlPath = Seq("validations") val (payload, formPayload) = (Some(value), None) - _executeRequest[String, io.apibuilder.api.v0.models.Validation]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[String, io.apibuilder.api.v0.models.Validation]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Validation]("io.apibuilder.api.v0.models.Validation", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2853,7 +2909,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Version]] = { val urlPath = Seq(orgKey, applicationKey) @@ -2862,7 +2919,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Version]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Version]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Version]]("Seq[io.apibuilder.api.v0.models.Version]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2872,11 +2929,12 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, applicationKey, version) - _executeRequest[Unit, io.apibuilder.api.v0.models.Version]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Version]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2887,13 +2945,14 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, version) val (payload, formPayload) = (Some(versionForm), None) - _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2905,13 +2964,14 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, applicationKey, version) val (payload, formPayload) = (Some(versionForm), None) - _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2922,11 +2982,12 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq(orgKey, applicationKey, version) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2941,7 +3002,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Watch]] = { val urlPath = Seq("watches") @@ -2954,7 +3016,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Watch]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Watch]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Watch]]("Seq[io.apibuilder.api.v0.models.Watch]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2962,11 +3024,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Watch] = { val urlPath = Seq("watches", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Watch]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Watch]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Watch]("io.apibuilder.api.v0.models.Watch", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2977,7 +3040,8 @@ def closeAsyncHttpClient(): Unit = { userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Boolean] = { val urlPath = Seq("watches", "check") @@ -2987,7 +3051,7 @@ def closeAsyncHttpClient(): Unit = { Some("application_key" -> applicationKey) ).flatten - _executeRequest[Unit, Boolean]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Boolean]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Boolean]("Boolean", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2995,13 +3059,14 @@ def closeAsyncHttpClient(): Unit = { override def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Watch] = { val urlPath = Seq("watches") val (payload, formPayload) = (Some(watchForm), None) - _executeRequest[io.apibuilder.api.v0.models.WatchForm, io.apibuilder.api.v0.models.Watch]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.WatchForm, io.apibuilder.api.v0.models.Watch]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Watch]("io.apibuilder.api.v0.models.Watch", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -3010,11 +3075,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("watches", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -3039,7 +3105,8 @@ def closeAsyncHttpClient(): Unit = { queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, body: Option[T] = None, - formBody : Option[org.http4s.UrlForm] = None + formBody: Option[org.http4s.UrlForm] = None, + requestModifier: org.http4s.Request => org.http4s.Request = identity )(handler: org.http4s.Response => scalaz.concurrent.Task[U] )(implicit encoder: io.circe.Encoder[T]): scalaz.concurrent.Task[U] = { import org.http4s.QueryParamEncoder._ @@ -3058,9 +3125,7 @@ def closeAsyncHttpClient(): Unit = { val queryMap = queryParameters.groupBy(_._1).map { case (k, v) => k -> v.map(_._2) } val uri = path.foldLeft(baseUrl){ case (uri, segment) => uri / segment }.setQueryParams(queryMap) - val request = org.http4s.Request(method = m, - uri = uri, - headers = headers) + val request = org.http4s.Request(method = m, uri = uri, headers = headers) val reqAndMaybeAuth = auth.fold(request) { case Authorization.Basic(username, passwordOpt) => { @@ -3071,9 +3136,10 @@ def closeAsyncHttpClient(): Unit = { case a => sys.error("Invalid authorization scheme[" + a.getClass + "]") } + val decoratedRequest = requestModifier(reqAndMaybeAuth) val reqAndMaybeAuthAndBody = - if (formBody.nonEmpty) formBody.fold(scalaz.concurrent.Task.now(reqAndMaybeAuth))(reqAndMaybeAuth.withBody) - else body.fold(scalaz.concurrent.Task.now(reqAndMaybeAuth))(reqAndMaybeAuth.withBody) + if (formBody.nonEmpty) formBody.fold(scalaz.concurrent.Task.now(decoratedRequest))(decoratedRequest.withBody) + else body.fold(scalaz.concurrent.Task.now(decoratedRequest))(decoratedRequest.withBody) asyncHttpClient.fetch(modifyRequest(reqAndMaybeAuthAndBody))(handler) } @@ -3151,7 +3217,8 @@ def closeAsyncHttpClient(): Unit = { hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Application]] /** @@ -3160,7 +3227,8 @@ def closeAsyncHttpClient(): Unit = { def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Application] /** @@ -3170,7 +3238,8 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Application] /** @@ -3179,7 +3248,8 @@ def closeAsyncHttpClient(): Unit = { def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] /** @@ -3189,7 +3259,8 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Application] } @@ -3207,7 +3278,8 @@ def closeAsyncHttpClient(): Unit = { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Attribute]] /** @@ -3215,7 +3287,8 @@ def closeAsyncHttpClient(): Unit = { */ def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Attribute] /** @@ -3223,7 +3296,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Attribute] /** @@ -3232,7 +3306,8 @@ def closeAsyncHttpClient(): Unit = { */ def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -3248,7 +3323,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Change]] } @@ -3266,7 +3342,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Code] } @@ -3277,7 +3354,8 @@ def closeAsyncHttpClient(): Unit = { def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Domain] /** @@ -3286,7 +3364,8 @@ def closeAsyncHttpClient(): Unit = { def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -3296,7 +3375,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -3313,17 +3393,20 @@ def closeAsyncHttpClient(): Unit = { generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.GeneratorService]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.GeneratorService] def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.GeneratorService] /** @@ -3331,7 +3414,8 @@ def closeAsyncHttpClient(): Unit = { */ def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -3355,22 +3439,26 @@ def closeAsyncHttpClient(): Unit = { key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.GeneratorWithService] } trait Healthchecks { def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.generator.v0.models.Healthcheck] def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Map[String, String]] } @@ -3384,12 +3472,14 @@ def closeAsyncHttpClient(): Unit = { q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Item]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Item] } @@ -3407,7 +3497,8 @@ def closeAsyncHttpClient(): Unit = { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.MembershipRequest]] /** @@ -3417,7 +3508,8 @@ def closeAsyncHttpClient(): Unit = { orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.MembershipRequest] /** @@ -3426,7 +3518,8 @@ def closeAsyncHttpClient(): Unit = { */ def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] /** @@ -3435,7 +3528,8 @@ def closeAsyncHttpClient(): Unit = { */ def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -3453,17 +3547,20 @@ def closeAsyncHttpClient(): Unit = { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Membership]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Membership] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -3489,7 +3586,8 @@ def closeAsyncHttpClient(): Unit = { namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Organization]] /** @@ -3497,7 +3595,8 @@ def closeAsyncHttpClient(): Unit = { */ def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Organization] /** @@ -3505,7 +3604,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Organization] /** @@ -3514,7 +3614,8 @@ def closeAsyncHttpClient(): Unit = { def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Organization] /** @@ -3522,7 +3623,8 @@ def closeAsyncHttpClient(): Unit = { */ def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] /** @@ -3538,7 +3640,8 @@ def closeAsyncHttpClient(): Unit = { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.AttributeValue]] /** @@ -3547,7 +3650,8 @@ def closeAsyncHttpClient(): Unit = { def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.AttributeValue] /** @@ -3557,7 +3661,8 @@ def closeAsyncHttpClient(): Unit = { key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.AttributeValue] /** @@ -3567,7 +3672,8 @@ def closeAsyncHttpClient(): Unit = { def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -3578,7 +3684,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -3590,7 +3697,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.PasswordResetSuccess] } @@ -3612,7 +3720,8 @@ def closeAsyncHttpClient(): Unit = { publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Subscription]] /** @@ -3620,7 +3729,8 @@ def closeAsyncHttpClient(): Unit = { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Subscription] /** @@ -3628,12 +3738,14 @@ def closeAsyncHttpClient(): Unit = { */ def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Subscription] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -3647,7 +3759,8 @@ def closeAsyncHttpClient(): Unit = { guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Token]] /** @@ -3655,7 +3768,8 @@ def closeAsyncHttpClient(): Unit = { */ def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.CleartextToken] /** @@ -3663,12 +3777,14 @@ def closeAsyncHttpClient(): Unit = { */ def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Token] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -3685,7 +3801,8 @@ def closeAsyncHttpClient(): Unit = { guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.User]] /** @@ -3693,7 +3810,8 @@ def closeAsyncHttpClient(): Unit = { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.User] /** @@ -3704,7 +3822,8 @@ def closeAsyncHttpClient(): Unit = { def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.User] /** @@ -3712,7 +3831,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.User] /** @@ -3721,14 +3841,16 @@ def closeAsyncHttpClient(): Unit = { def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.User] } trait Validations { def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Validation] } @@ -3746,7 +3868,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Version]] /** @@ -3759,7 +3882,8 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Version] /** @@ -3769,7 +3893,8 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Version] /** @@ -3780,7 +3905,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Version] /** @@ -3790,7 +3916,8 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -3812,7 +3939,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Watch]] /** @@ -3820,7 +3948,8 @@ def closeAsyncHttpClient(): Unit = { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Watch] /** @@ -3833,7 +3962,8 @@ def closeAsyncHttpClient(): Unit = { userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Boolean] /** @@ -3841,12 +3971,14 @@ def closeAsyncHttpClient(): Unit = { */ def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Watch] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } diff --git a/lib/src/test/resources/http4s/apidoc-api/015/BryzekApidocApiV0ClientOnly.scala.txt b/lib/src/test/resources/http4s/apidoc-api/015/BryzekApidocApiV0ClientOnly.scala.txt index f9739b039..f9e98fc22 100644 --- a/lib/src/test/resources/http4s/apidoc-api/015/BryzekApidocApiV0ClientOnly.scala.txt +++ b/lib/src/test/resources/http4s/apidoc-api/015/BryzekApidocApiV0ClientOnly.scala.txt @@ -83,7 +83,8 @@ def closeAsyncHttpClient(): Unit = { hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Application]] = { val urlPath = Seq(orgKey) @@ -96,7 +97,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Application]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Application]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Application]]("Seq[io.apibuilder.api.v0.models.Application]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -105,13 +106,14 @@ def closeAsyncHttpClient(): Unit = { override def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey) val (payload, formPayload) = (Some(applicationForm), None) - _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -122,13 +124,14 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey, applicationKey) val (payload, formPayload) = (Some(applicationForm), None) - _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -138,11 +141,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq(orgKey, applicationKey) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -152,13 +156,14 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey, applicationKey, "move") val (payload, formPayload) = (Some(moveForm), None) - _executeRequest[io.apibuilder.api.v0.models.MoveForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.MoveForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -172,7 +177,8 @@ def closeAsyncHttpClient(): Unit = { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Attribute]] = { val urlPath = Seq("attributes") @@ -183,7 +189,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Attribute]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Attribute]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Attribute]]("Seq[io.apibuilder.api.v0.models.Attribute]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -191,11 +197,12 @@ def closeAsyncHttpClient(): Unit = { override def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Attribute] = { val urlPath = Seq("attributes", name) - _executeRequest[Unit, io.apibuilder.api.v0.models.Attribute]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Attribute]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Attribute]("io.apibuilder.api.v0.models.Attribute", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -204,13 +211,14 @@ def closeAsyncHttpClient(): Unit = { override def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Attribute] = { val urlPath = Seq("attributes") val (payload, formPayload) = (Some(attributeForm), None) - _executeRequest[io.apibuilder.api.v0.models.AttributeForm, io.apibuilder.api.v0.models.Attribute]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.AttributeForm, io.apibuilder.api.v0.models.Attribute]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Attribute]("io.apibuilder.api.v0.models.Attribute", r) case r if r.status.code == 401 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) @@ -220,11 +228,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("attributes", name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r if r.status.code == 401 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -239,7 +248,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Change]] = { val urlPath = Seq("changes") @@ -250,7 +260,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Change]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Change]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Change]]("Seq[io.apibuilder.api.v0.models.Change]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -263,11 +273,12 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Code] = { val urlPath = Seq(orgKey, applicationKey, version, generatorKey) - _executeRequest[Unit, io.apibuilder.api.v0.models.Code]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Code]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Code]("io.apibuilder.api.v0.models.Code", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) @@ -280,13 +291,14 @@ def closeAsyncHttpClient(): Unit = { override def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Domain] = { val urlPath = Seq("domains", orgKey) val (payload, formPayload) = (Some(domain), None) - _executeRequest[io.apibuilder.api.v0.models.Domain, io.apibuilder.api.v0.models.Domain]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.Domain, io.apibuilder.api.v0.models.Domain]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Domain]("io.apibuilder.api.v0.models.Domain", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -296,11 +308,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("domains", orgKey, name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -310,13 +323,14 @@ def closeAsyncHttpClient(): Unit = { object EmailVerificationConfirmationForms extends EmailVerificationConfirmationForms { override def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("email_verification_confirmations") val (payload, formPayload) = (Some(emailVerificationConfirmationForm), None) - _executeRequest[io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -331,7 +345,8 @@ def closeAsyncHttpClient(): Unit = { generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.GeneratorService]] = { val urlPath = Seq("generator_services") @@ -343,7 +358,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.GeneratorService]]("Seq[io.apibuilder.api.v0.models.GeneratorService]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -351,11 +366,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.GeneratorService] = { val urlPath = Seq("generator_services", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorService]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorService]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.GeneratorService]("io.apibuilder.api.v0.models.GeneratorService", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -364,13 +380,14 @@ def closeAsyncHttpClient(): Unit = { override def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.GeneratorService] = { val urlPath = Seq("generator_services") val (payload, formPayload) = (Some(generatorServiceForm), None) - _executeRequest[io.apibuilder.api.v0.models.GeneratorServiceForm, io.apibuilder.api.v0.models.GeneratorService]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.GeneratorServiceForm, io.apibuilder.api.v0.models.GeneratorService]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.GeneratorService]("io.apibuilder.api.v0.models.GeneratorService", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -379,11 +396,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("generator_services", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r if r.status.code == 403 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -401,7 +419,8 @@ def closeAsyncHttpClient(): Unit = { key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] = { val urlPath = Seq("generators") @@ -415,7 +434,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("Seq[io.apibuilder.api.v0.models.GeneratorWithService]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -423,11 +442,12 @@ def closeAsyncHttpClient(): Unit = { override def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.GeneratorWithService] = { val urlPath = Seq("generators", key) - _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorWithService]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorWithService]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.GeneratorWithService]("io.apibuilder.api.v0.models.GeneratorWithService", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -437,22 +457,24 @@ def closeAsyncHttpClient(): Unit = { object Healthchecks extends Healthchecks { override def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.generator.v0.models.Healthcheck] = { val urlPath = Seq("_internal_", "healthcheck") - _executeRequest[Unit, io.apibuilder.generator.v0.models.Healthcheck]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.generator.v0.models.Healthcheck]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.generator.v0.models.Healthcheck]("io.apibuilder.generator.v0.models.Healthcheck", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } } override def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Map[String, String]] = { val urlPath = Seq("_internal_", "migrate") - _executeRequest[Unit, Map[String, String]]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Map[String, String]]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Map[String, String]]("Map[String, String]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -464,7 +486,8 @@ def closeAsyncHttpClient(): Unit = { q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Item]] = { val urlPath = Seq("items") @@ -474,7 +497,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Item]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Item]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Item]]("Seq[io.apibuilder.api.v0.models.Item]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -482,11 +505,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Item] = { val urlPath = Seq("items", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Item]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Item]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Item]("io.apibuilder.api.v0.models.Item", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -502,7 +526,8 @@ def closeAsyncHttpClient(): Unit = { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.MembershipRequest]] = { val urlPath = Seq("membership_requests") @@ -515,7 +540,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.MembershipRequest]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.MembershipRequest]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.MembershipRequest]]("Seq[io.apibuilder.api.v0.models.MembershipRequest]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -525,7 +550,8 @@ def closeAsyncHttpClient(): Unit = { orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.MembershipRequest] = { val urlPath = Seq("membership_requests") @@ -536,7 +562,7 @@ def closeAsyncHttpClient(): Unit = { "role" -> role )) - _executeRequest[Unit, io.apibuilder.api.v0.models.MembershipRequest]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.MembershipRequest]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.MembershipRequest]("io.apibuilder.api.v0.models.MembershipRequest", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -545,11 +571,12 @@ def closeAsyncHttpClient(): Unit = { override def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("membership_requests", guid.toString, "accept") - _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -558,11 +585,12 @@ def closeAsyncHttpClient(): Unit = { override def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("membership_requests", guid.toString, "decline") - _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -578,7 +606,8 @@ def closeAsyncHttpClient(): Unit = { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Membership]] = { val urlPath = Seq("memberships") @@ -591,7 +620,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Membership]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Membership]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Membership]]("Seq[io.apibuilder.api.v0.models.Membership]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -599,11 +628,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Membership] = { val urlPath = Seq("memberships", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Membership]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Membership]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Membership]("io.apibuilder.api.v0.models.Membership", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -612,11 +642,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("memberships", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -632,7 +663,8 @@ def closeAsyncHttpClient(): Unit = { namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Organization]] = { val urlPath = Seq("organizations") @@ -646,7 +678,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Organization]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Organization]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Organization]]("Seq[io.apibuilder.api.v0.models.Organization]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -654,11 +686,12 @@ def closeAsyncHttpClient(): Unit = { override def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations", key) - _executeRequest[Unit, io.apibuilder.api.v0.models.Organization]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Organization]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -667,13 +700,14 @@ def closeAsyncHttpClient(): Unit = { override def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations") val (payload, formPayload) = (Some(organizationForm), None) - _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -683,13 +717,14 @@ def closeAsyncHttpClient(): Unit = { override def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations", key) val (payload, formPayload) = (Some(organizationForm), None) - _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -698,11 +733,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("organizations", key) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -713,7 +749,8 @@ def closeAsyncHttpClient(): Unit = { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.AttributeValue]] = { val urlPath = Seq("organizations", key, "attributes") @@ -723,7 +760,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.AttributeValue]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.AttributeValue]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.AttributeValue]]("Seq[io.apibuilder.api.v0.models.AttributeValue]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -732,11 +769,12 @@ def closeAsyncHttpClient(): Unit = { override def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.AttributeValue] = { val urlPath = Seq("organizations", key, "attributes", name) - _executeRequest[Unit, io.apibuilder.api.v0.models.AttributeValue]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.AttributeValue]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -747,13 +785,14 @@ def closeAsyncHttpClient(): Unit = { key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.AttributeValue] = { val urlPath = Seq("organizations", key, "attributes", name) val (payload, formPayload) = (Some(attributeValueForm), None) - _executeRequest[io.apibuilder.api.v0.models.AttributeValueForm, io.apibuilder.api.v0.models.AttributeValue]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.AttributeValueForm, io.apibuilder.api.v0.models.AttributeValue]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -765,11 +804,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("organizations", key, "attributes", name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r if r.status.code == 401 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -781,13 +821,14 @@ def closeAsyncHttpClient(): Unit = { object PasswordResetRequests extends PasswordResetRequests { override def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("password_reset_requests") val (payload, formPayload) = (Some(passwordResetRequest), None) - _executeRequest[io.apibuilder.api.v0.models.PasswordResetRequest, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.PasswordResetRequest, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -798,13 +839,14 @@ def closeAsyncHttpClient(): Unit = { object PasswordResets extends PasswordResets { override def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.PasswordResetSuccess] = { val urlPath = Seq("password_resets") val (payload, formPayload) = (Some(passwordReset), None) - _executeRequest[io.apibuilder.api.v0.models.PasswordReset, io.apibuilder.api.v0.models.PasswordResetSuccess]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.PasswordReset, io.apibuilder.api.v0.models.PasswordResetSuccess]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.PasswordResetSuccess]("io.apibuilder.api.v0.models.PasswordResetSuccess", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -820,7 +862,8 @@ def closeAsyncHttpClient(): Unit = { publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Subscription]] = { val urlPath = Seq("subscriptions") @@ -833,7 +876,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Subscription]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Subscription]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Subscription]]("Seq[io.apibuilder.api.v0.models.Subscription]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -841,11 +884,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Subscription] = { val urlPath = Seq("subscriptions", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Subscription]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Subscription]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Subscription]("io.apibuilder.api.v0.models.Subscription", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -854,13 +898,14 @@ def closeAsyncHttpClient(): Unit = { override def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Subscription] = { val urlPath = Seq("subscriptions") val (payload, formPayload) = (Some(subscriptionForm), None) - _executeRequest[io.apibuilder.api.v0.models.SubscriptionForm, io.apibuilder.api.v0.models.Subscription]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.SubscriptionForm, io.apibuilder.api.v0.models.Subscription]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Subscription]("io.apibuilder.api.v0.models.Subscription", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -869,11 +914,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("subscriptions", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -886,7 +932,8 @@ def closeAsyncHttpClient(): Unit = { guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Token]] = { val urlPath = Seq("tokens", "users", userGuid.toString) @@ -896,7 +943,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Token]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Token]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Token]]("Seq[io.apibuilder.api.v0.models.Token]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -904,11 +951,12 @@ def closeAsyncHttpClient(): Unit = { override def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.CleartextToken] = { val urlPath = Seq("tokens", guid.toString, "cleartext") - _executeRequest[Unit, io.apibuilder.api.v0.models.CleartextToken]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.CleartextToken]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.CleartextToken]("io.apibuilder.api.v0.models.CleartextToken", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -917,13 +965,14 @@ def closeAsyncHttpClient(): Unit = { override def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Token] = { val urlPath = Seq("tokens") val (payload, formPayload) = (Some(tokenForm), None) - _executeRequest[io.apibuilder.api.v0.models.TokenForm, io.apibuilder.api.v0.models.Token]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.TokenForm, io.apibuilder.api.v0.models.Token]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Token]("io.apibuilder.api.v0.models.Token", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -932,11 +981,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("tokens", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -948,7 +998,8 @@ def closeAsyncHttpClient(): Unit = { guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.User]] = { val urlPath = Seq("users") @@ -958,7 +1009,7 @@ def closeAsyncHttpClient(): Unit = { token.map("token" -> _) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.User]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.User]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.User]]("Seq[io.apibuilder.api.v0.models.User]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -966,11 +1017,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.User]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.User]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -980,7 +1032,8 @@ def closeAsyncHttpClient(): Unit = { override def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", "authenticate") @@ -990,7 +1043,7 @@ def closeAsyncHttpClient(): Unit = { "password" -> password )) - _executeRequest[Unit, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -999,13 +1052,14 @@ def closeAsyncHttpClient(): Unit = { override def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users") val (payload, formPayload) = (Some(userForm), None) - _executeRequest[io.apibuilder.api.v0.models.UserForm, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.UserForm, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1015,13 +1069,14 @@ def closeAsyncHttpClient(): Unit = { override def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", guid.toString) val (payload, formPayload) = (Some(userUpdateForm), None) - _executeRequest[io.apibuilder.api.v0.models.UserUpdateForm, io.apibuilder.api.v0.models.User]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.UserUpdateForm, io.apibuilder.api.v0.models.User]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1032,13 +1087,14 @@ def closeAsyncHttpClient(): Unit = { object Validations extends Validations { override def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Validation] = { val urlPath = Seq("validations") val (payload, formPayload) = (Some(value), None) - _executeRequest[String, io.apibuilder.api.v0.models.Validation]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[String, io.apibuilder.api.v0.models.Validation]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Validation]("io.apibuilder.api.v0.models.Validation", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1051,7 +1107,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Version]] = { val urlPath = Seq(orgKey, applicationKey) @@ -1060,7 +1117,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Version]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Version]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Version]]("Seq[io.apibuilder.api.v0.models.Version]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1070,11 +1127,12 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, applicationKey, version) - _executeRequest[Unit, io.apibuilder.api.v0.models.Version]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Version]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -1085,13 +1143,14 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, version) val (payload, formPayload) = (Some(versionForm), None) - _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1103,13 +1162,14 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, applicationKey, version) val (payload, formPayload) = (Some(versionForm), None) - _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1120,11 +1180,12 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq(orgKey, applicationKey, version) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -1139,7 +1200,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Watch]] = { val urlPath = Seq("watches") @@ -1152,7 +1214,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Watch]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Watch]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Watch]]("Seq[io.apibuilder.api.v0.models.Watch]", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1160,11 +1222,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Watch] = { val urlPath = Seq("watches", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Watch]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Watch]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Watch]("io.apibuilder.api.v0.models.Watch", r) case r if r.status.code == 404 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -1175,7 +1238,8 @@ def closeAsyncHttpClient(): Unit = { userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Boolean] = { val urlPath = Seq("watches", "check") @@ -1185,7 +1249,7 @@ def closeAsyncHttpClient(): Unit = { Some("application_key" -> applicationKey) ).flatten - _executeRequest[Unit, Boolean]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Boolean]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Boolean]("Boolean", r) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1193,13 +1257,14 @@ def closeAsyncHttpClient(): Unit = { override def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Watch] = { val urlPath = Seq("watches") val (payload, formPayload) = (Some(watchForm), None) - _executeRequest[io.apibuilder.api.v0.models.WatchForm, io.apibuilder.api.v0.models.Watch]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.WatchForm, io.apibuilder.api.v0.models.Watch]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Watch]("io.apibuilder.api.v0.models.Watch", r) case r if r.status.code == 409 => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -1208,11 +1273,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = { val urlPath = Seq("watches", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => scalaz.concurrent.Task.now(()) case r => scalaz.concurrent.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -1237,7 +1303,8 @@ def closeAsyncHttpClient(): Unit = { queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, body: Option[T] = None, - formBody : Option[org.http4s.UrlForm] = None + formBody: Option[org.http4s.UrlForm] = None, + requestModifier: org.http4s.Request => org.http4s.Request = identity )(handler: org.http4s.Response => scalaz.concurrent.Task[U] )(implicit encoder: io.circe.Encoder[T]): scalaz.concurrent.Task[U] = { import org.http4s.QueryParamEncoder._ @@ -1256,9 +1323,7 @@ def closeAsyncHttpClient(): Unit = { val queryMap = queryParameters.groupBy(_._1).map { case (k, v) => k -> v.map(_._2) } val uri = path.foldLeft(baseUrl){ case (uri, segment) => uri / segment }.setQueryParams(queryMap) - val request = org.http4s.Request(method = m, - uri = uri, - headers = headers) + val request = org.http4s.Request(method = m, uri = uri, headers = headers) val reqAndMaybeAuth = auth.fold(request) { case Authorization.Basic(username, passwordOpt) => { @@ -1269,9 +1334,10 @@ def closeAsyncHttpClient(): Unit = { case a => sys.error("Invalid authorization scheme[" + a.getClass + "]") } + val decoratedRequest = requestModifier(reqAndMaybeAuth) val reqAndMaybeAuthAndBody = - if (formBody.nonEmpty) formBody.fold(scalaz.concurrent.Task.now(reqAndMaybeAuth))(reqAndMaybeAuth.withBody) - else body.fold(scalaz.concurrent.Task.now(reqAndMaybeAuth))(reqAndMaybeAuth.withBody) + if (formBody.nonEmpty) formBody.fold(scalaz.concurrent.Task.now(decoratedRequest))(decoratedRequest.withBody) + else body.fold(scalaz.concurrent.Task.now(decoratedRequest))(decoratedRequest.withBody) asyncHttpClient.fetch(modifyRequest(reqAndMaybeAuthAndBody))(handler) } @@ -1349,7 +1415,8 @@ def closeAsyncHttpClient(): Unit = { hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Application]] /** @@ -1358,7 +1425,8 @@ def closeAsyncHttpClient(): Unit = { def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Application] /** @@ -1368,7 +1436,8 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Application] /** @@ -1377,7 +1446,8 @@ def closeAsyncHttpClient(): Unit = { def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] /** @@ -1387,7 +1457,8 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Application] } @@ -1405,7 +1476,8 @@ def closeAsyncHttpClient(): Unit = { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Attribute]] /** @@ -1413,7 +1485,8 @@ def closeAsyncHttpClient(): Unit = { */ def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Attribute] /** @@ -1421,7 +1494,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Attribute] /** @@ -1430,7 +1504,8 @@ def closeAsyncHttpClient(): Unit = { */ def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -1446,7 +1521,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Change]] } @@ -1464,7 +1540,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Code] } @@ -1475,7 +1552,8 @@ def closeAsyncHttpClient(): Unit = { def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Domain] /** @@ -1484,7 +1562,8 @@ def closeAsyncHttpClient(): Unit = { def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -1494,7 +1573,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -1511,17 +1591,20 @@ def closeAsyncHttpClient(): Unit = { generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.GeneratorService]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.GeneratorService] def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.GeneratorService] /** @@ -1529,7 +1612,8 @@ def closeAsyncHttpClient(): Unit = { */ def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -1553,22 +1637,26 @@ def closeAsyncHttpClient(): Unit = { key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.GeneratorWithService] } trait Healthchecks { def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.generator.v0.models.Healthcheck] def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Map[String, String]] } @@ -1582,12 +1670,14 @@ def closeAsyncHttpClient(): Unit = { q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Item]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Item] } @@ -1605,7 +1695,8 @@ def closeAsyncHttpClient(): Unit = { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.MembershipRequest]] /** @@ -1615,7 +1706,8 @@ def closeAsyncHttpClient(): Unit = { orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.MembershipRequest] /** @@ -1624,7 +1716,8 @@ def closeAsyncHttpClient(): Unit = { */ def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] /** @@ -1633,7 +1726,8 @@ def closeAsyncHttpClient(): Unit = { */ def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -1651,17 +1745,20 @@ def closeAsyncHttpClient(): Unit = { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Membership]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Membership] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -1687,7 +1784,8 @@ def closeAsyncHttpClient(): Unit = { namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Organization]] /** @@ -1695,7 +1793,8 @@ def closeAsyncHttpClient(): Unit = { */ def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Organization] /** @@ -1703,7 +1802,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Organization] /** @@ -1712,7 +1812,8 @@ def closeAsyncHttpClient(): Unit = { def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Organization] /** @@ -1720,7 +1821,8 @@ def closeAsyncHttpClient(): Unit = { */ def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] /** @@ -1736,7 +1838,8 @@ def closeAsyncHttpClient(): Unit = { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.AttributeValue]] /** @@ -1745,7 +1848,8 @@ def closeAsyncHttpClient(): Unit = { def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.AttributeValue] /** @@ -1755,7 +1859,8 @@ def closeAsyncHttpClient(): Unit = { key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.AttributeValue] /** @@ -1765,7 +1870,8 @@ def closeAsyncHttpClient(): Unit = { def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -1776,7 +1882,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -1788,7 +1895,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.PasswordResetSuccess] } @@ -1810,7 +1918,8 @@ def closeAsyncHttpClient(): Unit = { publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Subscription]] /** @@ -1818,7 +1927,8 @@ def closeAsyncHttpClient(): Unit = { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Subscription] /** @@ -1826,12 +1936,14 @@ def closeAsyncHttpClient(): Unit = { */ def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Subscription] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -1845,7 +1957,8 @@ def closeAsyncHttpClient(): Unit = { guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Token]] /** @@ -1853,7 +1966,8 @@ def closeAsyncHttpClient(): Unit = { */ def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.CleartextToken] /** @@ -1861,12 +1975,14 @@ def closeAsyncHttpClient(): Unit = { */ def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Token] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -1883,7 +1999,8 @@ def closeAsyncHttpClient(): Unit = { guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.User]] /** @@ -1891,7 +2008,8 @@ def closeAsyncHttpClient(): Unit = { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.User] /** @@ -1902,7 +2020,8 @@ def closeAsyncHttpClient(): Unit = { def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.User] /** @@ -1910,7 +2029,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.User] /** @@ -1919,14 +2039,16 @@ def closeAsyncHttpClient(): Unit = { def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.User] } trait Validations { def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Validation] } @@ -1944,7 +2066,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Version]] /** @@ -1957,7 +2080,8 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Version] /** @@ -1967,7 +2091,8 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Version] /** @@ -1978,7 +2103,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Version] /** @@ -1988,7 +2114,8 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } @@ -2010,7 +2137,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Watch]] /** @@ -2018,7 +2146,8 @@ def closeAsyncHttpClient(): Unit = { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Watch] /** @@ -2031,7 +2160,8 @@ def closeAsyncHttpClient(): Unit = { userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Boolean] /** @@ -2039,12 +2169,14 @@ def closeAsyncHttpClient(): Unit = { */ def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Watch] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] } diff --git a/lib/src/test/resources/http4s/apidoc-api/015/BryzekApidocApiV0MockClient.scala.txt b/lib/src/test/resources/http4s/apidoc-api/015/BryzekApidocApiV0MockClient.scala.txt index 7a05c70a8..b707b324e 100644 --- a/lib/src/test/resources/http4s/apidoc-api/015/BryzekApidocApiV0MockClient.scala.txt +++ b/lib/src/test/resources/http4s/apidoc-api/015/BryzekApidocApiV0MockClient.scala.txt @@ -56,7 +56,8 @@ package io.apibuilder.api.v0.mock { hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Application]] = scalaz.concurrent.Task.now { Nil } @@ -67,7 +68,8 @@ package io.apibuilder.api.v0.mock { def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Application] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeApplication() } @@ -79,7 +81,8 @@ package io.apibuilder.api.v0.mock { orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Application] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeApplication() } @@ -90,7 +93,8 @@ package io.apibuilder.api.v0.mock { def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = scalaz.concurrent.Task.now { // unit type } @@ -102,7 +106,8 @@ package io.apibuilder.api.v0.mock { orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Application] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeApplication() } @@ -126,7 +131,8 @@ package io.apibuilder.api.v0.mock { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Attribute]] = scalaz.concurrent.Task.now { Nil } @@ -136,7 +142,8 @@ package io.apibuilder.api.v0.mock { */ def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Attribute] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeAttribute() } @@ -146,7 +153,8 @@ package io.apibuilder.api.v0.mock { */ def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Attribute] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeAttribute() } @@ -157,7 +165,8 @@ package io.apibuilder.api.v0.mock { */ def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = scalaz.concurrent.Task.now { // unit type } @@ -179,7 +188,8 @@ package io.apibuilder.api.v0.mock { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Change]] = scalaz.concurrent.Task.now { Nil } @@ -203,7 +213,8 @@ package io.apibuilder.api.v0.mock { applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Code] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeCode() } @@ -215,13 +226,15 @@ package io.apibuilder.api.v0.mock { trait MockHealthchecks extends io.apibuilder.api.v0.Healthchecks { def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.generator.v0.models.Healthcheck] = scalaz.concurrent.Task.now { io.apibuilder.generator.v0.mock.Factories.makeHealthcheck() } def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Map[String, String]] = scalaz.concurrent.Task.now { Map() } @@ -238,7 +251,8 @@ package io.apibuilder.api.v0.mock { def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Domain] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeDomain() } @@ -249,7 +263,8 @@ package io.apibuilder.api.v0.mock { def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = scalaz.concurrent.Task.now { // unit type } @@ -265,7 +280,8 @@ package io.apibuilder.api.v0.mock { */ def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = scalaz.concurrent.Task.now { // unit type } @@ -288,21 +304,24 @@ package io.apibuilder.api.v0.mock { generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.GeneratorService]] = scalaz.concurrent.Task.now { Nil } def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.GeneratorService] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeGeneratorService() } def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.GeneratorService] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeGeneratorService() } @@ -312,7 +331,8 @@ package io.apibuilder.api.v0.mock { */ def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = scalaz.concurrent.Task.now { // unit type } @@ -342,14 +362,16 @@ package io.apibuilder.api.v0.mock { key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] = scalaz.concurrent.Task.now { Nil } def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.GeneratorWithService] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeGeneratorWithService() } @@ -369,14 +391,16 @@ package io.apibuilder.api.v0.mock { q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Item]] = scalaz.concurrent.Task.now { Nil } def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Item] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeItem() } @@ -400,21 +424,24 @@ package io.apibuilder.api.v0.mock { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Membership]] = scalaz.concurrent.Task.now { Nil } def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Membership] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeMembership() } def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = scalaz.concurrent.Task.now { // unit type } @@ -438,7 +465,8 @@ package io.apibuilder.api.v0.mock { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.MembershipRequest]] = scalaz.concurrent.Task.now { Nil } @@ -450,7 +478,8 @@ package io.apibuilder.api.v0.mock { orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.MembershipRequest] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeMembershipRequest() } @@ -461,7 +490,8 @@ package io.apibuilder.api.v0.mock { */ def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = scalaz.concurrent.Task.now { // unit type } @@ -472,7 +502,8 @@ package io.apibuilder.api.v0.mock { */ def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = scalaz.concurrent.Task.now { // unit type } @@ -504,7 +535,8 @@ package io.apibuilder.api.v0.mock { namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Organization]] = scalaz.concurrent.Task.now { Nil } @@ -514,7 +546,8 @@ package io.apibuilder.api.v0.mock { */ def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Organization] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeOrganization() } @@ -524,7 +557,8 @@ package io.apibuilder.api.v0.mock { */ def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Organization] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeOrganization() } @@ -535,7 +569,8 @@ package io.apibuilder.api.v0.mock { def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Organization] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeOrganization() } @@ -545,7 +580,8 @@ package io.apibuilder.api.v0.mock { */ def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = scalaz.concurrent.Task.now { // unit type } @@ -563,7 +599,8 @@ package io.apibuilder.api.v0.mock { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.AttributeValue]] = scalaz.concurrent.Task.now { Nil } @@ -574,7 +611,8 @@ package io.apibuilder.api.v0.mock { def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.AttributeValue] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeAttributeValue() } @@ -586,7 +624,8 @@ package io.apibuilder.api.v0.mock { key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.AttributeValue] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeAttributeValue() } @@ -598,7 +637,8 @@ package io.apibuilder.api.v0.mock { def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = scalaz.concurrent.Task.now { // unit type } @@ -616,7 +656,8 @@ package io.apibuilder.api.v0.mock { */ def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.PasswordResetSuccess] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makePasswordResetSuccess() } @@ -633,7 +674,8 @@ package io.apibuilder.api.v0.mock { */ def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = scalaz.concurrent.Task.now { // unit type } @@ -661,7 +703,8 @@ package io.apibuilder.api.v0.mock { publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Subscription]] = scalaz.concurrent.Task.now { Nil } @@ -671,7 +714,8 @@ package io.apibuilder.api.v0.mock { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Subscription] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeSubscription() } @@ -681,14 +725,16 @@ package io.apibuilder.api.v0.mock { */ def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Subscription] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeSubscription() } def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = scalaz.concurrent.Task.now { // unit type } @@ -708,7 +754,8 @@ package io.apibuilder.api.v0.mock { guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Token]] = scalaz.concurrent.Task.now { Nil } @@ -718,7 +765,8 @@ package io.apibuilder.api.v0.mock { */ def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.CleartextToken] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeCleartextToken() } @@ -728,14 +776,16 @@ package io.apibuilder.api.v0.mock { */ def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Token] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeToken() } def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = scalaz.concurrent.Task.now { // unit type } @@ -758,7 +808,8 @@ package io.apibuilder.api.v0.mock { guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.User]] = scalaz.concurrent.Task.now { Nil } @@ -768,7 +819,8 @@ package io.apibuilder.api.v0.mock { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.User] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeUser() } @@ -781,7 +833,8 @@ package io.apibuilder.api.v0.mock { def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.User] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeUser() } @@ -791,7 +844,8 @@ package io.apibuilder.api.v0.mock { */ def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.User] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeUser() } @@ -802,7 +856,8 @@ package io.apibuilder.api.v0.mock { def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.User] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeUser() } @@ -815,7 +870,8 @@ package io.apibuilder.api.v0.mock { def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Validation] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeValidation() } @@ -839,7 +895,8 @@ package io.apibuilder.api.v0.mock { applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Version]] = scalaz.concurrent.Task.now { Nil } @@ -854,7 +911,8 @@ package io.apibuilder.api.v0.mock { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Version] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeVersion() } @@ -866,7 +924,8 @@ package io.apibuilder.api.v0.mock { orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Version] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeVersion() } @@ -879,7 +938,8 @@ package io.apibuilder.api.v0.mock { applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Version] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeVersion() } @@ -891,7 +951,8 @@ package io.apibuilder.api.v0.mock { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = scalaz.concurrent.Task.now { // unit type } @@ -919,7 +980,8 @@ package io.apibuilder.api.v0.mock { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Seq[io.apibuilder.api.v0.models.Watch]] = scalaz.concurrent.Task.now { Nil } @@ -929,7 +991,8 @@ package io.apibuilder.api.v0.mock { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Watch] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeWatch() } @@ -944,7 +1007,8 @@ package io.apibuilder.api.v0.mock { userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Boolean] = scalaz.concurrent.Task.now { true } @@ -954,14 +1018,16 @@ package io.apibuilder.api.v0.mock { */ def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[io.apibuilder.api.v0.models.Watch] = scalaz.concurrent.Task.now { io.apibuilder.api.v0.mock.Factories.makeWatch() } def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): scalaz.concurrent.Task[Unit] = scalaz.concurrent.Task.now { // unit type } diff --git a/lib/src/test/resources/http4s/apidoc-api/017/BryzekApidocApiV0Client.scala.txt b/lib/src/test/resources/http4s/apidoc-api/017/BryzekApidocApiV0Client.scala.txt index f76383fde..68cd8fb4c 100644 --- a/lib/src/test/resources/http4s/apidoc-api/017/BryzekApidocApiV0Client.scala.txt +++ b/lib/src/test/resources/http4s/apidoc-api/017/BryzekApidocApiV0Client.scala.txt @@ -1885,7 +1885,8 @@ def closeAsyncHttpClient(): Unit = { hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Application]] = { val urlPath = Seq(orgKey) @@ -1898,7 +1899,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Application]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Application]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Application]]("Seq[io.apibuilder.api.v0.models.Application]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1907,13 +1908,14 @@ def closeAsyncHttpClient(): Unit = { override def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey) val (payload, formPayload) = (Some(applicationForm), None) - _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1924,13 +1926,14 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey, applicationKey) val (payload, formPayload) = (Some(applicationForm), None) - _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1940,11 +1943,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq(orgKey, applicationKey) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -1954,13 +1958,14 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey, applicationKey, "move") val (payload, formPayload) = (Some(moveForm), None) - _executeRequest[io.apibuilder.api.v0.models.MoveForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.MoveForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1974,7 +1979,8 @@ def closeAsyncHttpClient(): Unit = { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Attribute]] = { val urlPath = Seq("attributes") @@ -1985,7 +1991,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Attribute]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Attribute]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Attribute]]("Seq[io.apibuilder.api.v0.models.Attribute]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1993,11 +1999,12 @@ def closeAsyncHttpClient(): Unit = { override def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Attribute] = { val urlPath = Seq("attributes", name) - _executeRequest[Unit, io.apibuilder.api.v0.models.Attribute]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Attribute]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Attribute]("io.apibuilder.api.v0.models.Attribute", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2006,13 +2013,14 @@ def closeAsyncHttpClient(): Unit = { override def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Attribute] = { val urlPath = Seq("attributes") val (payload, formPayload) = (Some(attributeForm), None) - _executeRequest[io.apibuilder.api.v0.models.AttributeForm, io.apibuilder.api.v0.models.Attribute]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.AttributeForm, io.apibuilder.api.v0.models.Attribute]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Attribute]("io.apibuilder.api.v0.models.Attribute", r) case r if r.status.code == 401 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) @@ -2022,11 +2030,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("attributes", name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r if r.status.code == 401 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -2041,7 +2050,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Change]] = { val urlPath = Seq("changes") @@ -2052,7 +2062,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Change]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Change]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Change]]("Seq[io.apibuilder.api.v0.models.Change]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2065,11 +2075,12 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Code] = { val urlPath = Seq(orgKey, applicationKey, version, generatorKey) - _executeRequest[Unit, io.apibuilder.api.v0.models.Code]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Code]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Code]("io.apibuilder.api.v0.models.Code", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) @@ -2082,13 +2093,14 @@ def closeAsyncHttpClient(): Unit = { override def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Domain] = { val urlPath = Seq("domains", orgKey) val (payload, formPayload) = (Some(domain), None) - _executeRequest[io.apibuilder.api.v0.models.Domain, io.apibuilder.api.v0.models.Domain]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.Domain, io.apibuilder.api.v0.models.Domain]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Domain]("io.apibuilder.api.v0.models.Domain", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2098,11 +2110,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("domains", orgKey, name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2112,13 +2125,14 @@ def closeAsyncHttpClient(): Unit = { object EmailVerificationConfirmationForms extends EmailVerificationConfirmationForms { override def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("email_verification_confirmations") val (payload, formPayload) = (Some(emailVerificationConfirmationForm), None) - _executeRequest[io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -2133,7 +2147,8 @@ def closeAsyncHttpClient(): Unit = { generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.GeneratorService]] = { val urlPath = Seq("generator_services") @@ -2145,7 +2160,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.GeneratorService]]("Seq[io.apibuilder.api.v0.models.GeneratorService]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2153,11 +2168,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.GeneratorService] = { val urlPath = Seq("generator_services", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorService]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorService]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.GeneratorService]("io.apibuilder.api.v0.models.GeneratorService", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2166,13 +2182,14 @@ def closeAsyncHttpClient(): Unit = { override def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.GeneratorService] = { val urlPath = Seq("generator_services") val (payload, formPayload) = (Some(generatorServiceForm), None) - _executeRequest[io.apibuilder.api.v0.models.GeneratorServiceForm, io.apibuilder.api.v0.models.GeneratorService]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.GeneratorServiceForm, io.apibuilder.api.v0.models.GeneratorService]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.GeneratorService]("io.apibuilder.api.v0.models.GeneratorService", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2181,11 +2198,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("generator_services", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r if r.status.code == 403 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -2203,7 +2221,8 @@ def closeAsyncHttpClient(): Unit = { key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] = { val urlPath = Seq("generators") @@ -2217,7 +2236,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("Seq[io.apibuilder.api.v0.models.GeneratorWithService]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2225,11 +2244,12 @@ def closeAsyncHttpClient(): Unit = { override def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.GeneratorWithService] = { val urlPath = Seq("generators", key) - _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorWithService]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorWithService]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.GeneratorWithService]("io.apibuilder.api.v0.models.GeneratorWithService", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2239,22 +2259,24 @@ def closeAsyncHttpClient(): Unit = { object Healthchecks extends Healthchecks { override def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.generator.v0.models.Healthcheck] = { val urlPath = Seq("_internal_", "healthcheck") - _executeRequest[Unit, io.apibuilder.generator.v0.models.Healthcheck]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.generator.v0.models.Healthcheck]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.generator.v0.models.Healthcheck]("io.apibuilder.generator.v0.models.Healthcheck", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } } override def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Map[String, String]] = { val urlPath = Seq("_internal_", "migrate") - _executeRequest[Unit, Map[String, String]]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Map[String, String]]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Map[String, String]]("Map[String, String]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2266,7 +2288,8 @@ def closeAsyncHttpClient(): Unit = { q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Item]] = { val urlPath = Seq("items") @@ -2276,7 +2299,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Item]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Item]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Item]]("Seq[io.apibuilder.api.v0.models.Item]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2284,11 +2307,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Item] = { val urlPath = Seq("items", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Item]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Item]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Item]("io.apibuilder.api.v0.models.Item", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2304,7 +2328,8 @@ def closeAsyncHttpClient(): Unit = { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.MembershipRequest]] = { val urlPath = Seq("membership_requests") @@ -2317,7 +2342,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.MembershipRequest]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.MembershipRequest]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.MembershipRequest]]("Seq[io.apibuilder.api.v0.models.MembershipRequest]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2327,7 +2352,8 @@ def closeAsyncHttpClient(): Unit = { orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.MembershipRequest] = { val urlPath = Seq("membership_requests") @@ -2338,7 +2364,7 @@ def closeAsyncHttpClient(): Unit = { "role" -> role )) - _executeRequest[Unit, io.apibuilder.api.v0.models.MembershipRequest]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.MembershipRequest]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.MembershipRequest]("io.apibuilder.api.v0.models.MembershipRequest", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2347,11 +2373,12 @@ def closeAsyncHttpClient(): Unit = { override def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("membership_requests", guid.toString, "accept") - _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -2360,11 +2387,12 @@ def closeAsyncHttpClient(): Unit = { override def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("membership_requests", guid.toString, "decline") - _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -2380,7 +2408,8 @@ def closeAsyncHttpClient(): Unit = { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Membership]] = { val urlPath = Seq("memberships") @@ -2393,7 +2422,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Membership]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Membership]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Membership]]("Seq[io.apibuilder.api.v0.models.Membership]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2401,11 +2430,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Membership] = { val urlPath = Seq("memberships", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Membership]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Membership]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Membership]("io.apibuilder.api.v0.models.Membership", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2414,11 +2444,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("memberships", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2434,7 +2465,8 @@ def closeAsyncHttpClient(): Unit = { namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Organization]] = { val urlPath = Seq("organizations") @@ -2448,7 +2480,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Organization]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Organization]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Organization]]("Seq[io.apibuilder.api.v0.models.Organization]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2456,11 +2488,12 @@ def closeAsyncHttpClient(): Unit = { override def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations", key) - _executeRequest[Unit, io.apibuilder.api.v0.models.Organization]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Organization]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2469,13 +2502,14 @@ def closeAsyncHttpClient(): Unit = { override def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations") val (payload, formPayload) = (Some(organizationForm), None) - _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2485,13 +2519,14 @@ def closeAsyncHttpClient(): Unit = { override def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations", key) val (payload, formPayload) = (Some(organizationForm), None) - _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2500,11 +2535,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("organizations", key) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2515,7 +2551,8 @@ def closeAsyncHttpClient(): Unit = { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.AttributeValue]] = { val urlPath = Seq("organizations", key, "attributes") @@ -2525,7 +2562,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.AttributeValue]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.AttributeValue]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.AttributeValue]]("Seq[io.apibuilder.api.v0.models.AttributeValue]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2534,11 +2571,12 @@ def closeAsyncHttpClient(): Unit = { override def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.AttributeValue] = { val urlPath = Seq("organizations", key, "attributes", name) - _executeRequest[Unit, io.apibuilder.api.v0.models.AttributeValue]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.AttributeValue]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2549,13 +2587,14 @@ def closeAsyncHttpClient(): Unit = { key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.AttributeValue] = { val urlPath = Seq("organizations", key, "attributes", name) val (payload, formPayload) = (Some(attributeValueForm), None) - _executeRequest[io.apibuilder.api.v0.models.AttributeValueForm, io.apibuilder.api.v0.models.AttributeValue]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.AttributeValueForm, io.apibuilder.api.v0.models.AttributeValue]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -2567,11 +2606,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("organizations", key, "attributes", name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r if r.status.code == 401 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -2583,13 +2623,14 @@ def closeAsyncHttpClient(): Unit = { object PasswordResetRequests extends PasswordResetRequests { override def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("password_reset_requests") val (payload, formPayload) = (Some(passwordResetRequest), None) - _executeRequest[io.apibuilder.api.v0.models.PasswordResetRequest, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.PasswordResetRequest, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -2600,13 +2641,14 @@ def closeAsyncHttpClient(): Unit = { object PasswordResets extends PasswordResets { override def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.PasswordResetSuccess] = { val urlPath = Seq("password_resets") val (payload, formPayload) = (Some(passwordReset), None) - _executeRequest[io.apibuilder.api.v0.models.PasswordReset, io.apibuilder.api.v0.models.PasswordResetSuccess]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.PasswordReset, io.apibuilder.api.v0.models.PasswordResetSuccess]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.PasswordResetSuccess]("io.apibuilder.api.v0.models.PasswordResetSuccess", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2622,7 +2664,8 @@ def closeAsyncHttpClient(): Unit = { publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Subscription]] = { val urlPath = Seq("subscriptions") @@ -2635,7 +2678,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Subscription]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Subscription]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Subscription]]("Seq[io.apibuilder.api.v0.models.Subscription]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2643,11 +2686,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Subscription] = { val urlPath = Seq("subscriptions", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Subscription]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Subscription]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Subscription]("io.apibuilder.api.v0.models.Subscription", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2656,13 +2700,14 @@ def closeAsyncHttpClient(): Unit = { override def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Subscription] = { val urlPath = Seq("subscriptions") val (payload, formPayload) = (Some(subscriptionForm), None) - _executeRequest[io.apibuilder.api.v0.models.SubscriptionForm, io.apibuilder.api.v0.models.Subscription]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.SubscriptionForm, io.apibuilder.api.v0.models.Subscription]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Subscription]("io.apibuilder.api.v0.models.Subscription", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -2671,11 +2716,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("subscriptions", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2688,7 +2734,8 @@ def closeAsyncHttpClient(): Unit = { guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Token]] = { val urlPath = Seq("tokens", "users", userGuid.toString) @@ -2698,7 +2745,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Token]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Token]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Token]]("Seq[io.apibuilder.api.v0.models.Token]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2706,11 +2753,12 @@ def closeAsyncHttpClient(): Unit = { override def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.CleartextToken] = { val urlPath = Seq("tokens", guid.toString, "cleartext") - _executeRequest[Unit, io.apibuilder.api.v0.models.CleartextToken]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.CleartextToken]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.CleartextToken]("io.apibuilder.api.v0.models.CleartextToken", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2719,13 +2767,14 @@ def closeAsyncHttpClient(): Unit = { override def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Token] = { val urlPath = Seq("tokens") val (payload, formPayload) = (Some(tokenForm), None) - _executeRequest[io.apibuilder.api.v0.models.TokenForm, io.apibuilder.api.v0.models.Token]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.TokenForm, io.apibuilder.api.v0.models.Token]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Token]("io.apibuilder.api.v0.models.Token", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -2734,11 +2783,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("tokens", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2750,7 +2800,8 @@ def closeAsyncHttpClient(): Unit = { guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.User]] = { val urlPath = Seq("users") @@ -2760,7 +2811,7 @@ def closeAsyncHttpClient(): Unit = { token.map("token" -> _) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.User]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.User]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.User]]("Seq[io.apibuilder.api.v0.models.User]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2768,11 +2819,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.User]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.User]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2782,7 +2834,8 @@ def closeAsyncHttpClient(): Unit = { override def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", "authenticate") @@ -2792,7 +2845,7 @@ def closeAsyncHttpClient(): Unit = { "password" -> password )) - _executeRequest[Unit, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2801,13 +2854,14 @@ def closeAsyncHttpClient(): Unit = { override def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users") val (payload, formPayload) = (Some(userForm), None) - _executeRequest[io.apibuilder.api.v0.models.UserForm, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.UserForm, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2817,13 +2871,14 @@ def closeAsyncHttpClient(): Unit = { override def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", guid.toString) val (payload, formPayload) = (Some(userUpdateForm), None) - _executeRequest[io.apibuilder.api.v0.models.UserUpdateForm, io.apibuilder.api.v0.models.User]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.UserUpdateForm, io.apibuilder.api.v0.models.User]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2834,13 +2889,14 @@ def closeAsyncHttpClient(): Unit = { object Validations extends Validations { override def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Validation] = { val urlPath = Seq("validations") val (payload, formPayload) = (Some(value), None) - _executeRequest[String, io.apibuilder.api.v0.models.Validation]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[String, io.apibuilder.api.v0.models.Validation]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Validation]("io.apibuilder.api.v0.models.Validation", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2853,7 +2909,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Version]] = { val urlPath = Seq(orgKey, applicationKey) @@ -2862,7 +2919,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Version]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Version]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Version]]("Seq[io.apibuilder.api.v0.models.Version]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2872,11 +2929,12 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, applicationKey, version) - _executeRequest[Unit, io.apibuilder.api.v0.models.Version]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Version]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2887,13 +2945,14 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, version) val (payload, formPayload) = (Some(versionForm), None) - _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2905,13 +2964,14 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, applicationKey, version) val (payload, formPayload) = (Some(versionForm), None) - _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2922,11 +2982,12 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq(orgKey, applicationKey, version) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2941,7 +3002,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Watch]] = { val urlPath = Seq("watches") @@ -2954,7 +3016,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Watch]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Watch]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Watch]]("Seq[io.apibuilder.api.v0.models.Watch]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2962,11 +3024,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Watch] = { val urlPath = Seq("watches", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Watch]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Watch]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Watch]("io.apibuilder.api.v0.models.Watch", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2977,7 +3040,8 @@ def closeAsyncHttpClient(): Unit = { userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Boolean] = { val urlPath = Seq("watches", "check") @@ -2987,7 +3051,7 @@ def closeAsyncHttpClient(): Unit = { Some("application_key" -> applicationKey) ).flatten - _executeRequest[Unit, Boolean]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Boolean]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Boolean]("Boolean", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2995,13 +3059,14 @@ def closeAsyncHttpClient(): Unit = { override def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Watch] = { val urlPath = Seq("watches") val (payload, formPayload) = (Some(watchForm), None) - _executeRequest[io.apibuilder.api.v0.models.WatchForm, io.apibuilder.api.v0.models.Watch]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.WatchForm, io.apibuilder.api.v0.models.Watch]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Watch]("io.apibuilder.api.v0.models.Watch", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -3010,11 +3075,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("watches", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -3039,7 +3105,8 @@ def closeAsyncHttpClient(): Unit = { queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, body: Option[T] = None, - formBody : Option[org.http4s.UrlForm] = None + formBody: Option[org.http4s.UrlForm] = None, + requestModifier: org.http4s.Request => org.http4s.Request = identity )(handler: org.http4s.Response => fs2.Task[U] )(implicit encoder: io.circe.Encoder[T]): fs2.Task[U] = { import org.http4s.QueryParamEncoder._ @@ -3058,9 +3125,7 @@ def closeAsyncHttpClient(): Unit = { val queryMap = queryParameters.groupBy(_._1).map { case (k, v) => k -> v.map(_._2) } val uri = path.foldLeft(baseUrl){ case (uri, segment) => uri / segment }.setQueryParams(queryMap) - val request = org.http4s.Request(method = m, - uri = uri, - headers = headers) + val request = org.http4s.Request(method = m, uri = uri, headers = headers) val reqAndMaybeAuth = auth.fold(request) { case Authorization.Basic(username, passwordOpt) => { @@ -3071,9 +3136,10 @@ def closeAsyncHttpClient(): Unit = { case a => sys.error("Invalid authorization scheme[" + a.getClass + "]") } + val decoratedRequest = requestModifier(reqAndMaybeAuth) val reqAndMaybeAuthAndBody = - if (formBody.nonEmpty) formBody.fold(fs2.Task.now(reqAndMaybeAuth))(reqAndMaybeAuth.withBody) - else body.fold(fs2.Task.now(reqAndMaybeAuth))(reqAndMaybeAuth.withBody) + if (formBody.nonEmpty) formBody.fold(fs2.Task.now(decoratedRequest))(decoratedRequest.withBody) + else body.fold(fs2.Task.now(decoratedRequest))(decoratedRequest.withBody) asyncHttpClient.fetch(modifyRequest(reqAndMaybeAuthAndBody))(handler) } @@ -3151,7 +3217,8 @@ def closeAsyncHttpClient(): Unit = { hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Application]] /** @@ -3160,7 +3227,8 @@ def closeAsyncHttpClient(): Unit = { def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Application] /** @@ -3170,7 +3238,8 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Application] /** @@ -3179,7 +3248,8 @@ def closeAsyncHttpClient(): Unit = { def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] /** @@ -3189,7 +3259,8 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Application] } @@ -3207,7 +3278,8 @@ def closeAsyncHttpClient(): Unit = { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Attribute]] /** @@ -3215,7 +3287,8 @@ def closeAsyncHttpClient(): Unit = { */ def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Attribute] /** @@ -3223,7 +3296,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Attribute] /** @@ -3232,7 +3306,8 @@ def closeAsyncHttpClient(): Unit = { */ def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -3248,7 +3323,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Change]] } @@ -3266,7 +3342,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Code] } @@ -3277,7 +3354,8 @@ def closeAsyncHttpClient(): Unit = { def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Domain] /** @@ -3286,7 +3364,8 @@ def closeAsyncHttpClient(): Unit = { def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -3296,7 +3375,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -3313,17 +3393,20 @@ def closeAsyncHttpClient(): Unit = { generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.GeneratorService]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.GeneratorService] def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.GeneratorService] /** @@ -3331,7 +3414,8 @@ def closeAsyncHttpClient(): Unit = { */ def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -3355,22 +3439,26 @@ def closeAsyncHttpClient(): Unit = { key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.GeneratorWithService] } trait Healthchecks { def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.generator.v0.models.Healthcheck] def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Map[String, String]] } @@ -3384,12 +3472,14 @@ def closeAsyncHttpClient(): Unit = { q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Item]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Item] } @@ -3407,7 +3497,8 @@ def closeAsyncHttpClient(): Unit = { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.MembershipRequest]] /** @@ -3417,7 +3508,8 @@ def closeAsyncHttpClient(): Unit = { orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.MembershipRequest] /** @@ -3426,7 +3518,8 @@ def closeAsyncHttpClient(): Unit = { */ def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] /** @@ -3435,7 +3528,8 @@ def closeAsyncHttpClient(): Unit = { */ def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -3453,17 +3547,20 @@ def closeAsyncHttpClient(): Unit = { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Membership]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Membership] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -3489,7 +3586,8 @@ def closeAsyncHttpClient(): Unit = { namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Organization]] /** @@ -3497,7 +3595,8 @@ def closeAsyncHttpClient(): Unit = { */ def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Organization] /** @@ -3505,7 +3604,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Organization] /** @@ -3514,7 +3614,8 @@ def closeAsyncHttpClient(): Unit = { def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Organization] /** @@ -3522,7 +3623,8 @@ def closeAsyncHttpClient(): Unit = { */ def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] /** @@ -3538,7 +3640,8 @@ def closeAsyncHttpClient(): Unit = { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.AttributeValue]] /** @@ -3547,7 +3650,8 @@ def closeAsyncHttpClient(): Unit = { def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.AttributeValue] /** @@ -3557,7 +3661,8 @@ def closeAsyncHttpClient(): Unit = { key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.AttributeValue] /** @@ -3567,7 +3672,8 @@ def closeAsyncHttpClient(): Unit = { def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -3578,7 +3684,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -3590,7 +3697,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.PasswordResetSuccess] } @@ -3612,7 +3720,8 @@ def closeAsyncHttpClient(): Unit = { publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Subscription]] /** @@ -3620,7 +3729,8 @@ def closeAsyncHttpClient(): Unit = { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Subscription] /** @@ -3628,12 +3738,14 @@ def closeAsyncHttpClient(): Unit = { */ def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Subscription] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -3647,7 +3759,8 @@ def closeAsyncHttpClient(): Unit = { guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Token]] /** @@ -3655,7 +3768,8 @@ def closeAsyncHttpClient(): Unit = { */ def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.CleartextToken] /** @@ -3663,12 +3777,14 @@ def closeAsyncHttpClient(): Unit = { */ def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Token] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -3685,7 +3801,8 @@ def closeAsyncHttpClient(): Unit = { guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.User]] /** @@ -3693,7 +3810,8 @@ def closeAsyncHttpClient(): Unit = { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.User] /** @@ -3704,7 +3822,8 @@ def closeAsyncHttpClient(): Unit = { def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.User] /** @@ -3712,7 +3831,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.User] /** @@ -3721,14 +3841,16 @@ def closeAsyncHttpClient(): Unit = { def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.User] } trait Validations { def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Validation] } @@ -3746,7 +3868,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Version]] /** @@ -3759,7 +3882,8 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Version] /** @@ -3769,7 +3893,8 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Version] /** @@ -3780,7 +3905,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Version] /** @@ -3790,7 +3916,8 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -3812,7 +3939,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Watch]] /** @@ -3820,7 +3948,8 @@ def closeAsyncHttpClient(): Unit = { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Watch] /** @@ -3833,7 +3962,8 @@ def closeAsyncHttpClient(): Unit = { userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Boolean] /** @@ -3841,12 +3971,14 @@ def closeAsyncHttpClient(): Unit = { */ def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Watch] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } diff --git a/lib/src/test/resources/http4s/apidoc-api/017/BryzekApidocApiV0ClientOnly.scala.txt b/lib/src/test/resources/http4s/apidoc-api/017/BryzekApidocApiV0ClientOnly.scala.txt index d1869d483..2a8b13a4a 100644 --- a/lib/src/test/resources/http4s/apidoc-api/017/BryzekApidocApiV0ClientOnly.scala.txt +++ b/lib/src/test/resources/http4s/apidoc-api/017/BryzekApidocApiV0ClientOnly.scala.txt @@ -83,7 +83,8 @@ def closeAsyncHttpClient(): Unit = { hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Application]] = { val urlPath = Seq(orgKey) @@ -96,7 +97,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Application]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Application]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Application]]("Seq[io.apibuilder.api.v0.models.Application]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -105,13 +106,14 @@ def closeAsyncHttpClient(): Unit = { override def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey) val (payload, formPayload) = (Some(applicationForm), None) - _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -122,13 +124,14 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey, applicationKey) val (payload, formPayload) = (Some(applicationForm), None) - _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -138,11 +141,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq(orgKey, applicationKey) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -152,13 +156,14 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey, applicationKey, "move") val (payload, formPayload) = (Some(moveForm), None) - _executeRequest[io.apibuilder.api.v0.models.MoveForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.MoveForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -172,7 +177,8 @@ def closeAsyncHttpClient(): Unit = { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Attribute]] = { val urlPath = Seq("attributes") @@ -183,7 +189,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Attribute]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Attribute]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Attribute]]("Seq[io.apibuilder.api.v0.models.Attribute]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -191,11 +197,12 @@ def closeAsyncHttpClient(): Unit = { override def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Attribute] = { val urlPath = Seq("attributes", name) - _executeRequest[Unit, io.apibuilder.api.v0.models.Attribute]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Attribute]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Attribute]("io.apibuilder.api.v0.models.Attribute", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -204,13 +211,14 @@ def closeAsyncHttpClient(): Unit = { override def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Attribute] = { val urlPath = Seq("attributes") val (payload, formPayload) = (Some(attributeForm), None) - _executeRequest[io.apibuilder.api.v0.models.AttributeForm, io.apibuilder.api.v0.models.Attribute]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.AttributeForm, io.apibuilder.api.v0.models.Attribute]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Attribute]("io.apibuilder.api.v0.models.Attribute", r) case r if r.status.code == 401 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) @@ -220,11 +228,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("attributes", name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r if r.status.code == 401 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -239,7 +248,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Change]] = { val urlPath = Seq("changes") @@ -250,7 +260,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Change]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Change]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Change]]("Seq[io.apibuilder.api.v0.models.Change]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -263,11 +273,12 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Code] = { val urlPath = Seq(orgKey, applicationKey, version, generatorKey) - _executeRequest[Unit, io.apibuilder.api.v0.models.Code]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Code]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Code]("io.apibuilder.api.v0.models.Code", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) @@ -280,13 +291,14 @@ def closeAsyncHttpClient(): Unit = { override def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Domain] = { val urlPath = Seq("domains", orgKey) val (payload, formPayload) = (Some(domain), None) - _executeRequest[io.apibuilder.api.v0.models.Domain, io.apibuilder.api.v0.models.Domain]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.Domain, io.apibuilder.api.v0.models.Domain]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Domain]("io.apibuilder.api.v0.models.Domain", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -296,11 +308,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("domains", orgKey, name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -310,13 +323,14 @@ def closeAsyncHttpClient(): Unit = { object EmailVerificationConfirmationForms extends EmailVerificationConfirmationForms { override def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("email_verification_confirmations") val (payload, formPayload) = (Some(emailVerificationConfirmationForm), None) - _executeRequest[io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -331,7 +345,8 @@ def closeAsyncHttpClient(): Unit = { generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.GeneratorService]] = { val urlPath = Seq("generator_services") @@ -343,7 +358,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.GeneratorService]]("Seq[io.apibuilder.api.v0.models.GeneratorService]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -351,11 +366,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.GeneratorService] = { val urlPath = Seq("generator_services", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorService]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorService]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.GeneratorService]("io.apibuilder.api.v0.models.GeneratorService", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -364,13 +380,14 @@ def closeAsyncHttpClient(): Unit = { override def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.GeneratorService] = { val urlPath = Seq("generator_services") val (payload, formPayload) = (Some(generatorServiceForm), None) - _executeRequest[io.apibuilder.api.v0.models.GeneratorServiceForm, io.apibuilder.api.v0.models.GeneratorService]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.GeneratorServiceForm, io.apibuilder.api.v0.models.GeneratorService]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.GeneratorService]("io.apibuilder.api.v0.models.GeneratorService", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -379,11 +396,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("generator_services", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r if r.status.code == 403 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -401,7 +419,8 @@ def closeAsyncHttpClient(): Unit = { key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] = { val urlPath = Seq("generators") @@ -415,7 +434,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("Seq[io.apibuilder.api.v0.models.GeneratorWithService]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -423,11 +442,12 @@ def closeAsyncHttpClient(): Unit = { override def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.GeneratorWithService] = { val urlPath = Seq("generators", key) - _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorWithService]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorWithService]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.GeneratorWithService]("io.apibuilder.api.v0.models.GeneratorWithService", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -437,22 +457,24 @@ def closeAsyncHttpClient(): Unit = { object Healthchecks extends Healthchecks { override def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.generator.v0.models.Healthcheck] = { val urlPath = Seq("_internal_", "healthcheck") - _executeRequest[Unit, io.apibuilder.generator.v0.models.Healthcheck]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.generator.v0.models.Healthcheck]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.generator.v0.models.Healthcheck]("io.apibuilder.generator.v0.models.Healthcheck", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } } override def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Map[String, String]] = { val urlPath = Seq("_internal_", "migrate") - _executeRequest[Unit, Map[String, String]]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Map[String, String]]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Map[String, String]]("Map[String, String]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -464,7 +486,8 @@ def closeAsyncHttpClient(): Unit = { q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Item]] = { val urlPath = Seq("items") @@ -474,7 +497,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Item]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Item]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Item]]("Seq[io.apibuilder.api.v0.models.Item]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -482,11 +505,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Item] = { val urlPath = Seq("items", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Item]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Item]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Item]("io.apibuilder.api.v0.models.Item", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -502,7 +526,8 @@ def closeAsyncHttpClient(): Unit = { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.MembershipRequest]] = { val urlPath = Seq("membership_requests") @@ -515,7 +540,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.MembershipRequest]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.MembershipRequest]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.MembershipRequest]]("Seq[io.apibuilder.api.v0.models.MembershipRequest]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -525,7 +550,8 @@ def closeAsyncHttpClient(): Unit = { orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.MembershipRequest] = { val urlPath = Seq("membership_requests") @@ -536,7 +562,7 @@ def closeAsyncHttpClient(): Unit = { "role" -> role )) - _executeRequest[Unit, io.apibuilder.api.v0.models.MembershipRequest]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.MembershipRequest]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.MembershipRequest]("io.apibuilder.api.v0.models.MembershipRequest", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -545,11 +571,12 @@ def closeAsyncHttpClient(): Unit = { override def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("membership_requests", guid.toString, "accept") - _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -558,11 +585,12 @@ def closeAsyncHttpClient(): Unit = { override def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("membership_requests", guid.toString, "decline") - _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -578,7 +606,8 @@ def closeAsyncHttpClient(): Unit = { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Membership]] = { val urlPath = Seq("memberships") @@ -591,7 +620,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Membership]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Membership]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Membership]]("Seq[io.apibuilder.api.v0.models.Membership]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -599,11 +628,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Membership] = { val urlPath = Seq("memberships", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Membership]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Membership]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Membership]("io.apibuilder.api.v0.models.Membership", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -612,11 +642,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("memberships", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -632,7 +663,8 @@ def closeAsyncHttpClient(): Unit = { namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Organization]] = { val urlPath = Seq("organizations") @@ -646,7 +678,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Organization]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Organization]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Organization]]("Seq[io.apibuilder.api.v0.models.Organization]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -654,11 +686,12 @@ def closeAsyncHttpClient(): Unit = { override def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations", key) - _executeRequest[Unit, io.apibuilder.api.v0.models.Organization]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Organization]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -667,13 +700,14 @@ def closeAsyncHttpClient(): Unit = { override def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations") val (payload, formPayload) = (Some(organizationForm), None) - _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -683,13 +717,14 @@ def closeAsyncHttpClient(): Unit = { override def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations", key) val (payload, formPayload) = (Some(organizationForm), None) - _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -698,11 +733,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("organizations", key) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -713,7 +749,8 @@ def closeAsyncHttpClient(): Unit = { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.AttributeValue]] = { val urlPath = Seq("organizations", key, "attributes") @@ -723,7 +760,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.AttributeValue]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.AttributeValue]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.AttributeValue]]("Seq[io.apibuilder.api.v0.models.AttributeValue]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -732,11 +769,12 @@ def closeAsyncHttpClient(): Unit = { override def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.AttributeValue] = { val urlPath = Seq("organizations", key, "attributes", name) - _executeRequest[Unit, io.apibuilder.api.v0.models.AttributeValue]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.AttributeValue]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -747,13 +785,14 @@ def closeAsyncHttpClient(): Unit = { key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.AttributeValue] = { val urlPath = Seq("organizations", key, "attributes", name) val (payload, formPayload) = (Some(attributeValueForm), None) - _executeRequest[io.apibuilder.api.v0.models.AttributeValueForm, io.apibuilder.api.v0.models.AttributeValue]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.AttributeValueForm, io.apibuilder.api.v0.models.AttributeValue]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -765,11 +804,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("organizations", key, "attributes", name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r if r.status.code == 401 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -781,13 +821,14 @@ def closeAsyncHttpClient(): Unit = { object PasswordResetRequests extends PasswordResetRequests { override def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("password_reset_requests") val (payload, formPayload) = (Some(passwordResetRequest), None) - _executeRequest[io.apibuilder.api.v0.models.PasswordResetRequest, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.PasswordResetRequest, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -798,13 +839,14 @@ def closeAsyncHttpClient(): Unit = { object PasswordResets extends PasswordResets { override def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.PasswordResetSuccess] = { val urlPath = Seq("password_resets") val (payload, formPayload) = (Some(passwordReset), None) - _executeRequest[io.apibuilder.api.v0.models.PasswordReset, io.apibuilder.api.v0.models.PasswordResetSuccess]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.PasswordReset, io.apibuilder.api.v0.models.PasswordResetSuccess]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.PasswordResetSuccess]("io.apibuilder.api.v0.models.PasswordResetSuccess", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -820,7 +862,8 @@ def closeAsyncHttpClient(): Unit = { publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Subscription]] = { val urlPath = Seq("subscriptions") @@ -833,7 +876,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Subscription]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Subscription]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Subscription]]("Seq[io.apibuilder.api.v0.models.Subscription]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -841,11 +884,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Subscription] = { val urlPath = Seq("subscriptions", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Subscription]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Subscription]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Subscription]("io.apibuilder.api.v0.models.Subscription", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -854,13 +898,14 @@ def closeAsyncHttpClient(): Unit = { override def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Subscription] = { val urlPath = Seq("subscriptions") val (payload, formPayload) = (Some(subscriptionForm), None) - _executeRequest[io.apibuilder.api.v0.models.SubscriptionForm, io.apibuilder.api.v0.models.Subscription]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.SubscriptionForm, io.apibuilder.api.v0.models.Subscription]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Subscription]("io.apibuilder.api.v0.models.Subscription", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -869,11 +914,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("subscriptions", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -886,7 +932,8 @@ def closeAsyncHttpClient(): Unit = { guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Token]] = { val urlPath = Seq("tokens", "users", userGuid.toString) @@ -896,7 +943,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Token]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Token]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Token]]("Seq[io.apibuilder.api.v0.models.Token]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -904,11 +951,12 @@ def closeAsyncHttpClient(): Unit = { override def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.CleartextToken] = { val urlPath = Seq("tokens", guid.toString, "cleartext") - _executeRequest[Unit, io.apibuilder.api.v0.models.CleartextToken]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.CleartextToken]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.CleartextToken]("io.apibuilder.api.v0.models.CleartextToken", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -917,13 +965,14 @@ def closeAsyncHttpClient(): Unit = { override def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Token] = { val urlPath = Seq("tokens") val (payload, formPayload) = (Some(tokenForm), None) - _executeRequest[io.apibuilder.api.v0.models.TokenForm, io.apibuilder.api.v0.models.Token]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.TokenForm, io.apibuilder.api.v0.models.Token]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Token]("io.apibuilder.api.v0.models.Token", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -932,11 +981,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("tokens", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -948,7 +998,8 @@ def closeAsyncHttpClient(): Unit = { guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.User]] = { val urlPath = Seq("users") @@ -958,7 +1009,7 @@ def closeAsyncHttpClient(): Unit = { token.map("token" -> _) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.User]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.User]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.User]]("Seq[io.apibuilder.api.v0.models.User]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -966,11 +1017,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.User]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.User]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -980,7 +1032,8 @@ def closeAsyncHttpClient(): Unit = { override def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", "authenticate") @@ -990,7 +1043,7 @@ def closeAsyncHttpClient(): Unit = { "password" -> password )) - _executeRequest[Unit, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -999,13 +1052,14 @@ def closeAsyncHttpClient(): Unit = { override def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users") val (payload, formPayload) = (Some(userForm), None) - _executeRequest[io.apibuilder.api.v0.models.UserForm, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.UserForm, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1015,13 +1069,14 @@ def closeAsyncHttpClient(): Unit = { override def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", guid.toString) val (payload, formPayload) = (Some(userUpdateForm), None) - _executeRequest[io.apibuilder.api.v0.models.UserUpdateForm, io.apibuilder.api.v0.models.User]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.UserUpdateForm, io.apibuilder.api.v0.models.User]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1032,13 +1087,14 @@ def closeAsyncHttpClient(): Unit = { object Validations extends Validations { override def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Validation] = { val urlPath = Seq("validations") val (payload, formPayload) = (Some(value), None) - _executeRequest[String, io.apibuilder.api.v0.models.Validation]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[String, io.apibuilder.api.v0.models.Validation]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Validation]("io.apibuilder.api.v0.models.Validation", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1051,7 +1107,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Version]] = { val urlPath = Seq(orgKey, applicationKey) @@ -1060,7 +1117,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Version]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Version]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Version]]("Seq[io.apibuilder.api.v0.models.Version]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1070,11 +1127,12 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, applicationKey, version) - _executeRequest[Unit, io.apibuilder.api.v0.models.Version]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Version]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -1085,13 +1143,14 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, version) val (payload, formPayload) = (Some(versionForm), None) - _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1103,13 +1162,14 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, applicationKey, version) val (payload, formPayload) = (Some(versionForm), None) - _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1120,11 +1180,12 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq(orgKey, applicationKey, version) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -1139,7 +1200,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Watch]] = { val urlPath = Seq("watches") @@ -1152,7 +1214,7 @@ def closeAsyncHttpClient(): Unit = { Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Watch]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Watch]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Seq[io.apibuilder.api.v0.models.Watch]]("Seq[io.apibuilder.api.v0.models.Watch]", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1160,11 +1222,12 @@ def closeAsyncHttpClient(): Unit = { override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Watch] = { val urlPath = Seq("watches", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Watch]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Watch]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Watch]("io.apibuilder.api.v0.models.Watch", r) case r if r.status.code == 404 => fs2.Task.fail(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -1175,7 +1238,8 @@ def closeAsyncHttpClient(): Unit = { userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Boolean] = { val urlPath = Seq("watches", "check") @@ -1185,7 +1249,7 @@ def closeAsyncHttpClient(): Unit = { Some("application_key" -> applicationKey) ).flatten - _executeRequest[Unit, Boolean]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Boolean]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[Boolean]("Boolean", r) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1193,13 +1257,14 @@ def closeAsyncHttpClient(): Unit = { override def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Watch] = { val urlPath = Seq("watches") val (payload, formPayload) = (Some(watchForm), None) - _executeRequest[io.apibuilder.api.v0.models.WatchForm, io.apibuilder.api.v0.models.Watch]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.WatchForm, io.apibuilder.api.v0.models.Watch]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[io.apibuilder.api.v0.models.Watch]("io.apibuilder.api.v0.models.Watch", r) case r if r.status.code == 409 => fs2.Task.fail(new io.apibuilder.api.v0.errors.ErrorsResponse(r)) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -1208,11 +1273,12 @@ def closeAsyncHttpClient(): Unit = { override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = { val urlPath = Seq("watches", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => fs2.Task.now(()) case r => fs2.Task.fail(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -1237,7 +1303,8 @@ def closeAsyncHttpClient(): Unit = { queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, body: Option[T] = None, - formBody : Option[org.http4s.UrlForm] = None + formBody: Option[org.http4s.UrlForm] = None, + requestModifier: org.http4s.Request => org.http4s.Request = identity )(handler: org.http4s.Response => fs2.Task[U] )(implicit encoder: io.circe.Encoder[T]): fs2.Task[U] = { import org.http4s.QueryParamEncoder._ @@ -1256,9 +1323,7 @@ def closeAsyncHttpClient(): Unit = { val queryMap = queryParameters.groupBy(_._1).map { case (k, v) => k -> v.map(_._2) } val uri = path.foldLeft(baseUrl){ case (uri, segment) => uri / segment }.setQueryParams(queryMap) - val request = org.http4s.Request(method = m, - uri = uri, - headers = headers) + val request = org.http4s.Request(method = m, uri = uri, headers = headers) val reqAndMaybeAuth = auth.fold(request) { case Authorization.Basic(username, passwordOpt) => { @@ -1269,9 +1334,10 @@ def closeAsyncHttpClient(): Unit = { case a => sys.error("Invalid authorization scheme[" + a.getClass + "]") } + val decoratedRequest = requestModifier(reqAndMaybeAuth) val reqAndMaybeAuthAndBody = - if (formBody.nonEmpty) formBody.fold(fs2.Task.now(reqAndMaybeAuth))(reqAndMaybeAuth.withBody) - else body.fold(fs2.Task.now(reqAndMaybeAuth))(reqAndMaybeAuth.withBody) + if (formBody.nonEmpty) formBody.fold(fs2.Task.now(decoratedRequest))(decoratedRequest.withBody) + else body.fold(fs2.Task.now(decoratedRequest))(decoratedRequest.withBody) asyncHttpClient.fetch(modifyRequest(reqAndMaybeAuthAndBody))(handler) } @@ -1349,7 +1415,8 @@ def closeAsyncHttpClient(): Unit = { hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Application]] /** @@ -1358,7 +1425,8 @@ def closeAsyncHttpClient(): Unit = { def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Application] /** @@ -1368,7 +1436,8 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Application] /** @@ -1377,7 +1446,8 @@ def closeAsyncHttpClient(): Unit = { def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] /** @@ -1387,7 +1457,8 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Application] } @@ -1405,7 +1476,8 @@ def closeAsyncHttpClient(): Unit = { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Attribute]] /** @@ -1413,7 +1485,8 @@ def closeAsyncHttpClient(): Unit = { */ def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Attribute] /** @@ -1421,7 +1494,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Attribute] /** @@ -1430,7 +1504,8 @@ def closeAsyncHttpClient(): Unit = { */ def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -1446,7 +1521,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Change]] } @@ -1464,7 +1540,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Code] } @@ -1475,7 +1552,8 @@ def closeAsyncHttpClient(): Unit = { def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Domain] /** @@ -1484,7 +1562,8 @@ def closeAsyncHttpClient(): Unit = { def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -1494,7 +1573,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -1511,17 +1591,20 @@ def closeAsyncHttpClient(): Unit = { generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.GeneratorService]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.GeneratorService] def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.GeneratorService] /** @@ -1529,7 +1612,8 @@ def closeAsyncHttpClient(): Unit = { */ def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -1553,22 +1637,26 @@ def closeAsyncHttpClient(): Unit = { key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.GeneratorWithService] } trait Healthchecks { def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.generator.v0.models.Healthcheck] def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Map[String, String]] } @@ -1582,12 +1670,14 @@ def closeAsyncHttpClient(): Unit = { q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Item]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Item] } @@ -1605,7 +1695,8 @@ def closeAsyncHttpClient(): Unit = { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.MembershipRequest]] /** @@ -1615,7 +1706,8 @@ def closeAsyncHttpClient(): Unit = { orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.MembershipRequest] /** @@ -1624,7 +1716,8 @@ def closeAsyncHttpClient(): Unit = { */ def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] /** @@ -1633,7 +1726,8 @@ def closeAsyncHttpClient(): Unit = { */ def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -1651,17 +1745,20 @@ def closeAsyncHttpClient(): Unit = { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Membership]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Membership] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -1687,7 +1784,8 @@ def closeAsyncHttpClient(): Unit = { namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Organization]] /** @@ -1695,7 +1793,8 @@ def closeAsyncHttpClient(): Unit = { */ def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Organization] /** @@ -1703,7 +1802,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Organization] /** @@ -1712,7 +1812,8 @@ def closeAsyncHttpClient(): Unit = { def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Organization] /** @@ -1720,7 +1821,8 @@ def closeAsyncHttpClient(): Unit = { */ def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] /** @@ -1736,7 +1838,8 @@ def closeAsyncHttpClient(): Unit = { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.AttributeValue]] /** @@ -1745,7 +1848,8 @@ def closeAsyncHttpClient(): Unit = { def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.AttributeValue] /** @@ -1755,7 +1859,8 @@ def closeAsyncHttpClient(): Unit = { key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.AttributeValue] /** @@ -1765,7 +1870,8 @@ def closeAsyncHttpClient(): Unit = { def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -1776,7 +1882,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -1788,7 +1895,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.PasswordResetSuccess] } @@ -1810,7 +1918,8 @@ def closeAsyncHttpClient(): Unit = { publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Subscription]] /** @@ -1818,7 +1927,8 @@ def closeAsyncHttpClient(): Unit = { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Subscription] /** @@ -1826,12 +1936,14 @@ def closeAsyncHttpClient(): Unit = { */ def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Subscription] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -1845,7 +1957,8 @@ def closeAsyncHttpClient(): Unit = { guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Token]] /** @@ -1853,7 +1966,8 @@ def closeAsyncHttpClient(): Unit = { */ def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.CleartextToken] /** @@ -1861,12 +1975,14 @@ def closeAsyncHttpClient(): Unit = { */ def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Token] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -1883,7 +1999,8 @@ def closeAsyncHttpClient(): Unit = { guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.User]] /** @@ -1891,7 +2008,8 @@ def closeAsyncHttpClient(): Unit = { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.User] /** @@ -1902,7 +2020,8 @@ def closeAsyncHttpClient(): Unit = { def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.User] /** @@ -1910,7 +2029,8 @@ def closeAsyncHttpClient(): Unit = { */ def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.User] /** @@ -1919,14 +2039,16 @@ def closeAsyncHttpClient(): Unit = { def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.User] } trait Validations { def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Validation] } @@ -1944,7 +2066,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Version]] /** @@ -1957,7 +2080,8 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Version] /** @@ -1967,7 +2091,8 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Version] /** @@ -1978,7 +2103,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Version] /** @@ -1988,7 +2114,8 @@ def closeAsyncHttpClient(): Unit = { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } @@ -2010,7 +2137,8 @@ def closeAsyncHttpClient(): Unit = { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Watch]] /** @@ -2018,7 +2146,8 @@ def closeAsyncHttpClient(): Unit = { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Watch] /** @@ -2031,7 +2160,8 @@ def closeAsyncHttpClient(): Unit = { userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Boolean] /** @@ -2039,12 +2169,14 @@ def closeAsyncHttpClient(): Unit = { */ def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Watch] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] } diff --git a/lib/src/test/resources/http4s/apidoc-api/017/BryzekApidocApiV0MockClient.scala.txt b/lib/src/test/resources/http4s/apidoc-api/017/BryzekApidocApiV0MockClient.scala.txt index c9ce3c7cf..5ccf8e885 100644 --- a/lib/src/test/resources/http4s/apidoc-api/017/BryzekApidocApiV0MockClient.scala.txt +++ b/lib/src/test/resources/http4s/apidoc-api/017/BryzekApidocApiV0MockClient.scala.txt @@ -56,7 +56,8 @@ package io.apibuilder.api.v0.mock { hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Application]] = fs2.Task.now { Nil } @@ -67,7 +68,8 @@ package io.apibuilder.api.v0.mock { def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Application] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeApplication() } @@ -79,7 +81,8 @@ package io.apibuilder.api.v0.mock { orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Application] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeApplication() } @@ -90,7 +93,8 @@ package io.apibuilder.api.v0.mock { def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = fs2.Task.now { // unit type } @@ -102,7 +106,8 @@ package io.apibuilder.api.v0.mock { orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Application] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeApplication() } @@ -126,7 +131,8 @@ package io.apibuilder.api.v0.mock { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Attribute]] = fs2.Task.now { Nil } @@ -136,7 +142,8 @@ package io.apibuilder.api.v0.mock { */ def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Attribute] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeAttribute() } @@ -146,7 +153,8 @@ package io.apibuilder.api.v0.mock { */ def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Attribute] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeAttribute() } @@ -157,7 +165,8 @@ package io.apibuilder.api.v0.mock { */ def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = fs2.Task.now { // unit type } @@ -179,7 +188,8 @@ package io.apibuilder.api.v0.mock { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Change]] = fs2.Task.now { Nil } @@ -203,7 +213,8 @@ package io.apibuilder.api.v0.mock { applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Code] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeCode() } @@ -215,13 +226,15 @@ package io.apibuilder.api.v0.mock { trait MockHealthchecks extends io.apibuilder.api.v0.Healthchecks { def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.generator.v0.models.Healthcheck] = fs2.Task.now { io.apibuilder.generator.v0.mock.Factories.makeHealthcheck() } def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Map[String, String]] = fs2.Task.now { Map() } @@ -238,7 +251,8 @@ package io.apibuilder.api.v0.mock { def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Domain] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeDomain() } @@ -249,7 +263,8 @@ package io.apibuilder.api.v0.mock { def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = fs2.Task.now { // unit type } @@ -265,7 +280,8 @@ package io.apibuilder.api.v0.mock { */ def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = fs2.Task.now { // unit type } @@ -288,21 +304,24 @@ package io.apibuilder.api.v0.mock { generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.GeneratorService]] = fs2.Task.now { Nil } def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.GeneratorService] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeGeneratorService() } def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.GeneratorService] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeGeneratorService() } @@ -312,7 +331,8 @@ package io.apibuilder.api.v0.mock { */ def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = fs2.Task.now { // unit type } @@ -342,14 +362,16 @@ package io.apibuilder.api.v0.mock { key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] = fs2.Task.now { Nil } def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.GeneratorWithService] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeGeneratorWithService() } @@ -369,14 +391,16 @@ package io.apibuilder.api.v0.mock { q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Item]] = fs2.Task.now { Nil } def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Item] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeItem() } @@ -400,21 +424,24 @@ package io.apibuilder.api.v0.mock { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Membership]] = fs2.Task.now { Nil } def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Membership] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeMembership() } def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = fs2.Task.now { // unit type } @@ -438,7 +465,8 @@ package io.apibuilder.api.v0.mock { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.MembershipRequest]] = fs2.Task.now { Nil } @@ -450,7 +478,8 @@ package io.apibuilder.api.v0.mock { orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.MembershipRequest] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeMembershipRequest() } @@ -461,7 +490,8 @@ package io.apibuilder.api.v0.mock { */ def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = fs2.Task.now { // unit type } @@ -472,7 +502,8 @@ package io.apibuilder.api.v0.mock { */ def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = fs2.Task.now { // unit type } @@ -504,7 +535,8 @@ package io.apibuilder.api.v0.mock { namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Organization]] = fs2.Task.now { Nil } @@ -514,7 +546,8 @@ package io.apibuilder.api.v0.mock { */ def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Organization] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeOrganization() } @@ -524,7 +557,8 @@ package io.apibuilder.api.v0.mock { */ def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Organization] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeOrganization() } @@ -535,7 +569,8 @@ package io.apibuilder.api.v0.mock { def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Organization] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeOrganization() } @@ -545,7 +580,8 @@ package io.apibuilder.api.v0.mock { */ def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = fs2.Task.now { // unit type } @@ -563,7 +599,8 @@ package io.apibuilder.api.v0.mock { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.AttributeValue]] = fs2.Task.now { Nil } @@ -574,7 +611,8 @@ package io.apibuilder.api.v0.mock { def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.AttributeValue] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeAttributeValue() } @@ -586,7 +624,8 @@ package io.apibuilder.api.v0.mock { key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.AttributeValue] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeAttributeValue() } @@ -598,7 +637,8 @@ package io.apibuilder.api.v0.mock { def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = fs2.Task.now { // unit type } @@ -616,7 +656,8 @@ package io.apibuilder.api.v0.mock { */ def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.PasswordResetSuccess] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makePasswordResetSuccess() } @@ -633,7 +674,8 @@ package io.apibuilder.api.v0.mock { */ def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = fs2.Task.now { // unit type } @@ -661,7 +703,8 @@ package io.apibuilder.api.v0.mock { publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Subscription]] = fs2.Task.now { Nil } @@ -671,7 +714,8 @@ package io.apibuilder.api.v0.mock { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Subscription] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeSubscription() } @@ -681,14 +725,16 @@ package io.apibuilder.api.v0.mock { */ def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Subscription] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeSubscription() } def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = fs2.Task.now { // unit type } @@ -708,7 +754,8 @@ package io.apibuilder.api.v0.mock { guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Token]] = fs2.Task.now { Nil } @@ -718,7 +765,8 @@ package io.apibuilder.api.v0.mock { */ def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.CleartextToken] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeCleartextToken() } @@ -728,14 +776,16 @@ package io.apibuilder.api.v0.mock { */ def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Token] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeToken() } def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = fs2.Task.now { // unit type } @@ -758,7 +808,8 @@ package io.apibuilder.api.v0.mock { guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.User]] = fs2.Task.now { Nil } @@ -768,7 +819,8 @@ package io.apibuilder.api.v0.mock { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.User] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeUser() } @@ -781,7 +833,8 @@ package io.apibuilder.api.v0.mock { def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.User] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeUser() } @@ -791,7 +844,8 @@ package io.apibuilder.api.v0.mock { */ def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.User] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeUser() } @@ -802,7 +856,8 @@ package io.apibuilder.api.v0.mock { def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.User] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeUser() } @@ -815,7 +870,8 @@ package io.apibuilder.api.v0.mock { def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Validation] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeValidation() } @@ -839,7 +895,8 @@ package io.apibuilder.api.v0.mock { applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Version]] = fs2.Task.now { Nil } @@ -854,7 +911,8 @@ package io.apibuilder.api.v0.mock { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Version] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeVersion() } @@ -866,7 +924,8 @@ package io.apibuilder.api.v0.mock { orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Version] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeVersion() } @@ -879,7 +938,8 @@ package io.apibuilder.api.v0.mock { applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Version] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeVersion() } @@ -891,7 +951,8 @@ package io.apibuilder.api.v0.mock { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = fs2.Task.now { // unit type } @@ -919,7 +980,8 @@ package io.apibuilder.api.v0.mock { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Seq[io.apibuilder.api.v0.models.Watch]] = fs2.Task.now { Nil } @@ -929,7 +991,8 @@ package io.apibuilder.api.v0.mock { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Watch] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeWatch() } @@ -944,7 +1007,8 @@ package io.apibuilder.api.v0.mock { userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Boolean] = fs2.Task.now { true } @@ -954,14 +1018,16 @@ package io.apibuilder.api.v0.mock { */ def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[io.apibuilder.api.v0.models.Watch] = fs2.Task.now { io.apibuilder.api.v0.mock.Factories.makeWatch() } def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request => org.http4s.Request = identity ): fs2.Task[Unit] = fs2.Task.now { // unit type } diff --git a/lib/src/test/resources/http4s/apidoc-api/018/BryzekApidocApiV0Client.scala.txt b/lib/src/test/resources/http4s/apidoc-api/018/BryzekApidocApiV0Client.scala.txt index 8a4ff3c6f..c5ffc845c 100644 --- a/lib/src/test/resources/http4s/apidoc-api/018/BryzekApidocApiV0Client.scala.txt +++ b/lib/src/test/resources/http4s/apidoc-api/018/BryzekApidocApiV0Client.scala.txt @@ -1884,7 +1884,8 @@ import scala.language.higherKinds hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Application]] = { val urlPath = Seq(orgKey) @@ -1897,7 +1898,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Application]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Application]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Application]]("Seq[io.apibuilder.api.v0.models.Application]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1906,13 +1907,14 @@ import scala.language.higherKinds override def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey) val (payload, formPayload) = (Some(applicationForm), None) - _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1923,13 +1925,14 @@ import scala.language.higherKinds orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey, applicationKey) val (payload, formPayload) = (Some(applicationForm), None) - _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1939,11 +1942,12 @@ import scala.language.higherKinds override def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq(orgKey, applicationKey) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -1953,13 +1957,14 @@ import scala.language.higherKinds orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey, applicationKey, "move") val (payload, formPayload) = (Some(moveForm), None) - _executeRequest[io.apibuilder.api.v0.models.MoveForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.MoveForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1973,7 +1978,8 @@ import scala.language.higherKinds name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Attribute]] = { val urlPath = Seq("attributes") @@ -1984,7 +1990,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Attribute]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Attribute]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Attribute]]("Seq[io.apibuilder.api.v0.models.Attribute]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1992,11 +1998,12 @@ import scala.language.higherKinds override def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Attribute] = { val urlPath = Seq("attributes", name) - _executeRequest[Unit, io.apibuilder.api.v0.models.Attribute]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Attribute]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Attribute]("io.apibuilder.api.v0.models.Attribute", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2005,13 +2012,14 @@ import scala.language.higherKinds override def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Attribute] = { val urlPath = Seq("attributes") val (payload, formPayload) = (Some(attributeForm), None) - _executeRequest[io.apibuilder.api.v0.models.AttributeForm, io.apibuilder.api.v0.models.Attribute]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.AttributeForm, io.apibuilder.api.v0.models.Attribute]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Attribute]("io.apibuilder.api.v0.models.Attribute", r) case r if r.status.code == 401 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) @@ -2021,11 +2029,12 @@ import scala.language.higherKinds override def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("attributes", name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 401 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -2040,7 +2049,8 @@ import scala.language.higherKinds applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Change]] = { val urlPath = Seq("changes") @@ -2051,7 +2061,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Change]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Change]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Change]]("Seq[io.apibuilder.api.v0.models.Change]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2064,11 +2074,12 @@ import scala.language.higherKinds applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Code] = { val urlPath = Seq(orgKey, applicationKey, version, generatorKey) - _executeRequest[Unit, io.apibuilder.api.v0.models.Code]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Code]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Code]("io.apibuilder.api.v0.models.Code", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) @@ -2081,13 +2092,14 @@ import scala.language.higherKinds override def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Domain] = { val urlPath = Seq("domains", orgKey) val (payload, formPayload) = (Some(domain), None) - _executeRequest[io.apibuilder.api.v0.models.Domain, io.apibuilder.api.v0.models.Domain]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.Domain, io.apibuilder.api.v0.models.Domain]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Domain]("io.apibuilder.api.v0.models.Domain", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2097,11 +2109,12 @@ import scala.language.higherKinds override def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("domains", orgKey, name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2111,13 +2124,14 @@ import scala.language.higherKinds object EmailVerificationConfirmationForms extends EmailVerificationConfirmationForms[F] { override def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("email_verification_confirmations") val (payload, formPayload) = (Some(emailVerificationConfirmationForm), None) - _executeRequest[io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -2132,7 +2146,8 @@ import scala.language.higherKinds generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.GeneratorService]] = { val urlPath = Seq("generator_services") @@ -2144,7 +2159,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.GeneratorService]]("Seq[io.apibuilder.api.v0.models.GeneratorService]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2152,11 +2167,12 @@ import scala.language.higherKinds override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorService] = { val urlPath = Seq("generator_services", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorService]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorService]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.GeneratorService]("io.apibuilder.api.v0.models.GeneratorService", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2165,13 +2181,14 @@ import scala.language.higherKinds override def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorService] = { val urlPath = Seq("generator_services") val (payload, formPayload) = (Some(generatorServiceForm), None) - _executeRequest[io.apibuilder.api.v0.models.GeneratorServiceForm, io.apibuilder.api.v0.models.GeneratorService]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.GeneratorServiceForm, io.apibuilder.api.v0.models.GeneratorService]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.GeneratorService]("io.apibuilder.api.v0.models.GeneratorService", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2180,11 +2197,12 @@ import scala.language.higherKinds override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("generator_services", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 403 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -2202,7 +2220,8 @@ import scala.language.higherKinds key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] = { val urlPath = Seq("generators") @@ -2216,7 +2235,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("Seq[io.apibuilder.api.v0.models.GeneratorWithService]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2224,11 +2243,12 @@ import scala.language.higherKinds override def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorWithService] = { val urlPath = Seq("generators", key) - _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorWithService]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorWithService]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.GeneratorWithService]("io.apibuilder.api.v0.models.GeneratorWithService", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2238,22 +2258,24 @@ import scala.language.higherKinds object Healthchecks extends Healthchecks[F] { override def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.generator.v0.models.Healthcheck] = { val urlPath = Seq("_internal_", "healthcheck") - _executeRequest[Unit, io.apibuilder.generator.v0.models.Healthcheck]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.generator.v0.models.Healthcheck]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.generator.v0.models.Healthcheck]("io.apibuilder.generator.v0.models.Healthcheck", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } } override def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Map[String, String]] = { val urlPath = Seq("_internal_", "migrate") - _executeRequest[Unit, Map[String, String]]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Map[String, String]]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Map[String, String]]("Map[String, String]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2265,7 +2287,8 @@ import scala.language.higherKinds q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Item]] = { val urlPath = Seq("items") @@ -2275,7 +2298,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Item]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Item]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Item]]("Seq[io.apibuilder.api.v0.models.Item]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2283,11 +2306,12 @@ import scala.language.higherKinds override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Item] = { val urlPath = Seq("items", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Item]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Item]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Item]("io.apibuilder.api.v0.models.Item", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2303,7 +2327,8 @@ import scala.language.higherKinds role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.MembershipRequest]] = { val urlPath = Seq("membership_requests") @@ -2316,7 +2341,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.MembershipRequest]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.MembershipRequest]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.MembershipRequest]]("Seq[io.apibuilder.api.v0.models.MembershipRequest]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2326,7 +2351,8 @@ import scala.language.higherKinds orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.MembershipRequest] = { val urlPath = Seq("membership_requests") @@ -2337,7 +2363,7 @@ import scala.language.higherKinds "role" -> role )) - _executeRequest[Unit, io.apibuilder.api.v0.models.MembershipRequest]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.MembershipRequest]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.MembershipRequest]("io.apibuilder.api.v0.models.MembershipRequest", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2346,11 +2372,12 @@ import scala.language.higherKinds override def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("membership_requests", guid.toString, "accept") - _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -2359,11 +2386,12 @@ import scala.language.higherKinds override def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("membership_requests", guid.toString, "decline") - _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -2379,7 +2407,8 @@ import scala.language.higherKinds role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Membership]] = { val urlPath = Seq("memberships") @@ -2392,7 +2421,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Membership]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Membership]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Membership]]("Seq[io.apibuilder.api.v0.models.Membership]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2400,11 +2429,12 @@ import scala.language.higherKinds override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Membership] = { val urlPath = Seq("memberships", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Membership]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Membership]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Membership]("io.apibuilder.api.v0.models.Membership", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2413,11 +2443,12 @@ import scala.language.higherKinds override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("memberships", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2433,7 +2464,8 @@ import scala.language.higherKinds namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Organization]] = { val urlPath = Seq("organizations") @@ -2447,7 +2479,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Organization]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Organization]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Organization]]("Seq[io.apibuilder.api.v0.models.Organization]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2455,11 +2487,12 @@ import scala.language.higherKinds override def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations", key) - _executeRequest[Unit, io.apibuilder.api.v0.models.Organization]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Organization]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2468,13 +2501,14 @@ import scala.language.higherKinds override def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations") val (payload, formPayload) = (Some(organizationForm), None) - _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2484,13 +2518,14 @@ import scala.language.higherKinds override def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations", key) val (payload, formPayload) = (Some(organizationForm), None) - _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2499,11 +2534,12 @@ import scala.language.higherKinds override def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("organizations", key) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2514,7 +2550,8 @@ import scala.language.higherKinds name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.AttributeValue]] = { val urlPath = Seq("organizations", key, "attributes") @@ -2524,7 +2561,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.AttributeValue]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.AttributeValue]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.AttributeValue]]("Seq[io.apibuilder.api.v0.models.AttributeValue]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2533,11 +2570,12 @@ import scala.language.higherKinds override def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.AttributeValue] = { val urlPath = Seq("organizations", key, "attributes", name) - _executeRequest[Unit, io.apibuilder.api.v0.models.AttributeValue]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.AttributeValue]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2548,13 +2586,14 @@ import scala.language.higherKinds key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.AttributeValue] = { val urlPath = Seq("organizations", key, "attributes", name) val (payload, formPayload) = (Some(attributeValueForm), None) - _executeRequest[io.apibuilder.api.v0.models.AttributeValueForm, io.apibuilder.api.v0.models.AttributeValue]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.AttributeValueForm, io.apibuilder.api.v0.models.AttributeValue]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -2566,11 +2605,12 @@ import scala.language.higherKinds override def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("organizations", key, "attributes", name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 401 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -2582,13 +2622,14 @@ import scala.language.higherKinds object PasswordResetRequests extends PasswordResetRequests[F] { override def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("password_reset_requests") val (payload, formPayload) = (Some(passwordResetRequest), None) - _executeRequest[io.apibuilder.api.v0.models.PasswordResetRequest, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.PasswordResetRequest, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -2599,13 +2640,14 @@ import scala.language.higherKinds object PasswordResets extends PasswordResets[F] { override def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.PasswordResetSuccess] = { val urlPath = Seq("password_resets") val (payload, formPayload) = (Some(passwordReset), None) - _executeRequest[io.apibuilder.api.v0.models.PasswordReset, io.apibuilder.api.v0.models.PasswordResetSuccess]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.PasswordReset, io.apibuilder.api.v0.models.PasswordResetSuccess]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.PasswordResetSuccess]("io.apibuilder.api.v0.models.PasswordResetSuccess", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2621,7 +2663,8 @@ import scala.language.higherKinds publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Subscription]] = { val urlPath = Seq("subscriptions") @@ -2634,7 +2677,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Subscription]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Subscription]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Subscription]]("Seq[io.apibuilder.api.v0.models.Subscription]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2642,11 +2685,12 @@ import scala.language.higherKinds override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Subscription] = { val urlPath = Seq("subscriptions", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Subscription]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Subscription]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Subscription]("io.apibuilder.api.v0.models.Subscription", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2655,13 +2699,14 @@ import scala.language.higherKinds override def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Subscription] = { val urlPath = Seq("subscriptions") val (payload, formPayload) = (Some(subscriptionForm), None) - _executeRequest[io.apibuilder.api.v0.models.SubscriptionForm, io.apibuilder.api.v0.models.Subscription]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.SubscriptionForm, io.apibuilder.api.v0.models.Subscription]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Subscription]("io.apibuilder.api.v0.models.Subscription", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -2670,11 +2715,12 @@ import scala.language.higherKinds override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("subscriptions", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2687,7 +2733,8 @@ import scala.language.higherKinds guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Token]] = { val urlPath = Seq("tokens", "users", userGuid.toString) @@ -2697,7 +2744,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Token]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Token]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Token]]("Seq[io.apibuilder.api.v0.models.Token]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2705,11 +2752,12 @@ import scala.language.higherKinds override def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.CleartextToken] = { val urlPath = Seq("tokens", guid.toString, "cleartext") - _executeRequest[Unit, io.apibuilder.api.v0.models.CleartextToken]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.CleartextToken]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.CleartextToken]("io.apibuilder.api.v0.models.CleartextToken", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2718,13 +2766,14 @@ import scala.language.higherKinds override def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Token] = { val urlPath = Seq("tokens") val (payload, formPayload) = (Some(tokenForm), None) - _executeRequest[io.apibuilder.api.v0.models.TokenForm, io.apibuilder.api.v0.models.Token]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.TokenForm, io.apibuilder.api.v0.models.Token]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Token]("io.apibuilder.api.v0.models.Token", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -2733,11 +2782,12 @@ import scala.language.higherKinds override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("tokens", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2749,7 +2799,8 @@ import scala.language.higherKinds guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.User]] = { val urlPath = Seq("users") @@ -2759,7 +2810,7 @@ import scala.language.higherKinds token.map("token" -> _) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.User]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.User]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.User]]("Seq[io.apibuilder.api.v0.models.User]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2767,11 +2818,12 @@ import scala.language.higherKinds override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.User]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.User]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2781,7 +2833,8 @@ import scala.language.higherKinds override def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", "authenticate") @@ -2791,7 +2844,7 @@ import scala.language.higherKinds "password" -> password )) - _executeRequest[Unit, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2800,13 +2853,14 @@ import scala.language.higherKinds override def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users") val (payload, formPayload) = (Some(userForm), None) - _executeRequest[io.apibuilder.api.v0.models.UserForm, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.UserForm, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2816,13 +2870,14 @@ import scala.language.higherKinds override def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", guid.toString) val (payload, formPayload) = (Some(userUpdateForm), None) - _executeRequest[io.apibuilder.api.v0.models.UserUpdateForm, io.apibuilder.api.v0.models.User]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.UserUpdateForm, io.apibuilder.api.v0.models.User]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2833,13 +2888,14 @@ import scala.language.higherKinds object Validations extends Validations[F] { override def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Validation] = { val urlPath = Seq("validations") val (payload, formPayload) = (Some(value), None) - _executeRequest[String, io.apibuilder.api.v0.models.Validation]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[String, io.apibuilder.api.v0.models.Validation]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Validation]("io.apibuilder.api.v0.models.Validation", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2852,7 +2908,8 @@ import scala.language.higherKinds applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Version]] = { val urlPath = Seq(orgKey, applicationKey) @@ -2861,7 +2918,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Version]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Version]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Version]]("Seq[io.apibuilder.api.v0.models.Version]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2871,11 +2928,12 @@ import scala.language.higherKinds orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, applicationKey, version) - _executeRequest[Unit, io.apibuilder.api.v0.models.Version]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Version]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2886,13 +2944,14 @@ import scala.language.higherKinds orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, version) val (payload, formPayload) = (Some(versionForm), None) - _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2904,13 +2963,14 @@ import scala.language.higherKinds applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, applicationKey, version) val (payload, formPayload) = (Some(versionForm), None) - _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2921,11 +2981,12 @@ import scala.language.higherKinds orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq(orgKey, applicationKey, version) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2940,7 +3001,8 @@ import scala.language.higherKinds applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Watch]] = { val urlPath = Seq("watches") @@ -2953,7 +3015,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Watch]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Watch]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Watch]]("Seq[io.apibuilder.api.v0.models.Watch]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2961,11 +3023,12 @@ import scala.language.higherKinds override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Watch] = { val urlPath = Seq("watches", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Watch]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Watch]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Watch]("io.apibuilder.api.v0.models.Watch", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2976,7 +3039,8 @@ import scala.language.higherKinds userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Boolean] = { val urlPath = Seq("watches", "check") @@ -2986,7 +3050,7 @@ import scala.language.higherKinds Some("application_key" -> applicationKey) ).flatten - _executeRequest[Unit, Boolean]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Boolean]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Boolean]("Boolean", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2994,13 +3058,14 @@ import scala.language.higherKinds override def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Watch] = { val urlPath = Seq("watches") val (payload, formPayload) = (Some(watchForm), None) - _executeRequest[io.apibuilder.api.v0.models.WatchForm, io.apibuilder.api.v0.models.Watch]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.WatchForm, io.apibuilder.api.v0.models.Watch]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Watch]("io.apibuilder.api.v0.models.Watch", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -3009,11 +3074,12 @@ import scala.language.higherKinds override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("watches", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -3038,7 +3104,8 @@ import scala.language.higherKinds queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, body: Option[T] = None, - formBody : Option[org.http4s.UrlForm] = None + formBody: Option[org.http4s.UrlForm] = None, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity )(handler: org.http4s.Response[F] => F[U] )(implicit encoder: io.circe.Encoder[T]): F[U] = { import org.http4s.QueryParamEncoder._ @@ -3057,9 +3124,7 @@ import scala.language.higherKinds val queryMap = queryParameters.groupBy(_._1).map { case (k, v) => k -> v.map(_._2) } val uri = path.foldLeft(baseUrl){ case (uri, segment) => uri / segment }.setQueryParams(queryMap) - val request = org.http4s.Request[F](method = m, - uri = uri, - headers = headers) + val request = org.http4s.Request[F](method = m, uri = uri, headers = headers) val reqAndMaybeAuth = auth.fold(request) { case Authorization.Basic(username, passwordOpt) => { @@ -3070,9 +3135,10 @@ import scala.language.higherKinds case a => sys.error("Invalid authorization scheme[" + a.getClass + "]") } + val decoratedRequest = requestModifier(reqAndMaybeAuth) val reqAndMaybeAuthAndBody = - if (formBody.nonEmpty) formBody.fold(Sync[F].pure(reqAndMaybeAuth))(reqAndMaybeAuth.withBody) - else body.fold(Sync[F].pure(reqAndMaybeAuth))(reqAndMaybeAuth.withBody) + if (formBody.nonEmpty) formBody.fold(Sync[F].pure(decoratedRequest))(decoratedRequest.withBody) + else body.fold(Sync[F].pure(decoratedRequest))(decoratedRequest.withBody) httpClient.fetch(modifyRequest(reqAndMaybeAuthAndBody))(handler) } @@ -3147,7 +3213,8 @@ import scala.language.higherKinds hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Application]] /** @@ -3156,7 +3223,8 @@ import scala.language.higherKinds def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] /** @@ -3166,7 +3234,8 @@ import scala.language.higherKinds orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] /** @@ -3175,7 +3244,8 @@ import scala.language.higherKinds def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] /** @@ -3185,7 +3255,8 @@ import scala.language.higherKinds orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] } @@ -3203,7 +3274,8 @@ import scala.language.higherKinds name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Attribute]] /** @@ -3211,7 +3283,8 @@ import scala.language.higherKinds */ def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Attribute] /** @@ -3219,7 +3292,8 @@ import scala.language.higherKinds */ def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Attribute] /** @@ -3228,7 +3302,8 @@ import scala.language.higherKinds */ def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3244,7 +3319,8 @@ import scala.language.higherKinds applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Change]] } @@ -3262,7 +3338,8 @@ import scala.language.higherKinds applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Code] } @@ -3273,7 +3350,8 @@ import scala.language.higherKinds def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Domain] /** @@ -3282,7 +3360,8 @@ import scala.language.higherKinds def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3292,7 +3371,8 @@ import scala.language.higherKinds */ def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3309,17 +3389,20 @@ import scala.language.higherKinds generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.GeneratorService]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorService] def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorService] /** @@ -3327,7 +3410,8 @@ import scala.language.higherKinds */ def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3351,22 +3435,26 @@ import scala.language.higherKinds key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorWithService] } trait Healthchecks[F[_]] { def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.generator.v0.models.Healthcheck] def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Map[String, String]] } @@ -3380,12 +3468,14 @@ import scala.language.higherKinds q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Item]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Item] } @@ -3403,7 +3493,8 @@ import scala.language.higherKinds role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.MembershipRequest]] /** @@ -3413,7 +3504,8 @@ import scala.language.higherKinds orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.MembershipRequest] /** @@ -3422,7 +3514,8 @@ import scala.language.higherKinds */ def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] /** @@ -3431,7 +3524,8 @@ import scala.language.higherKinds */ def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3449,17 +3543,20 @@ import scala.language.higherKinds role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Membership]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Membership] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3485,7 +3582,8 @@ import scala.language.higherKinds namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Organization]] /** @@ -3493,7 +3591,8 @@ import scala.language.higherKinds */ def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] /** @@ -3501,7 +3600,8 @@ import scala.language.higherKinds */ def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] /** @@ -3510,7 +3610,8 @@ import scala.language.higherKinds def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] /** @@ -3518,7 +3619,8 @@ import scala.language.higherKinds */ def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] /** @@ -3534,7 +3636,8 @@ import scala.language.higherKinds name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.AttributeValue]] /** @@ -3543,7 +3646,8 @@ import scala.language.higherKinds def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.AttributeValue] /** @@ -3553,7 +3657,8 @@ import scala.language.higherKinds key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.AttributeValue] /** @@ -3563,7 +3668,8 @@ import scala.language.higherKinds def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3574,7 +3680,8 @@ import scala.language.higherKinds */ def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3586,7 +3693,8 @@ import scala.language.higherKinds */ def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.PasswordResetSuccess] } @@ -3608,7 +3716,8 @@ import scala.language.higherKinds publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Subscription]] /** @@ -3616,7 +3725,8 @@ import scala.language.higherKinds */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Subscription] /** @@ -3624,12 +3734,14 @@ import scala.language.higherKinds */ def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Subscription] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3643,7 +3755,8 @@ import scala.language.higherKinds guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Token]] /** @@ -3651,7 +3764,8 @@ import scala.language.higherKinds */ def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.CleartextToken] /** @@ -3659,12 +3773,14 @@ import scala.language.higherKinds */ def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Token] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3681,7 +3797,8 @@ import scala.language.higherKinds guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.User]] /** @@ -3689,7 +3806,8 @@ import scala.language.higherKinds */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] /** @@ -3700,7 +3818,8 @@ import scala.language.higherKinds def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] /** @@ -3708,7 +3827,8 @@ import scala.language.higherKinds */ def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] /** @@ -3717,14 +3837,16 @@ import scala.language.higherKinds def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] } trait Validations[F[_]] { def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Validation] } @@ -3742,7 +3864,8 @@ import scala.language.higherKinds applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Version]] /** @@ -3755,7 +3878,8 @@ import scala.language.higherKinds orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] /** @@ -3765,7 +3889,8 @@ import scala.language.higherKinds orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] /** @@ -3776,7 +3901,8 @@ import scala.language.higherKinds applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] /** @@ -3786,7 +3912,8 @@ import scala.language.higherKinds orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3808,7 +3935,8 @@ import scala.language.higherKinds applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Watch]] /** @@ -3816,7 +3944,8 @@ import scala.language.higherKinds */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Watch] /** @@ -3829,7 +3958,8 @@ import scala.language.higherKinds userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Boolean] /** @@ -3837,12 +3967,14 @@ import scala.language.higherKinds */ def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Watch] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } diff --git a/lib/src/test/resources/http4s/apidoc-api/018/BryzekApidocApiV0ClientOnly.scala.txt b/lib/src/test/resources/http4s/apidoc-api/018/BryzekApidocApiV0ClientOnly.scala.txt index b0eb63f4d..ed96595cc 100644 --- a/lib/src/test/resources/http4s/apidoc-api/018/BryzekApidocApiV0ClientOnly.scala.txt +++ b/lib/src/test/resources/http4s/apidoc-api/018/BryzekApidocApiV0ClientOnly.scala.txt @@ -82,7 +82,8 @@ import scala.language.higherKinds hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Application]] = { val urlPath = Seq(orgKey) @@ -95,7 +96,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Application]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Application]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Application]]("Seq[io.apibuilder.api.v0.models.Application]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -104,13 +105,14 @@ import scala.language.higherKinds override def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey) val (payload, formPayload) = (Some(applicationForm), None) - _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -121,13 +123,14 @@ import scala.language.higherKinds orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey, applicationKey) val (payload, formPayload) = (Some(applicationForm), None) - _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -137,11 +140,12 @@ import scala.language.higherKinds override def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq(orgKey, applicationKey) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -151,13 +155,14 @@ import scala.language.higherKinds orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey, applicationKey, "move") val (payload, formPayload) = (Some(moveForm), None) - _executeRequest[io.apibuilder.api.v0.models.MoveForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.MoveForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -171,7 +176,8 @@ import scala.language.higherKinds name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Attribute]] = { val urlPath = Seq("attributes") @@ -182,7 +188,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Attribute]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Attribute]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Attribute]]("Seq[io.apibuilder.api.v0.models.Attribute]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -190,11 +196,12 @@ import scala.language.higherKinds override def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Attribute] = { val urlPath = Seq("attributes", name) - _executeRequest[Unit, io.apibuilder.api.v0.models.Attribute]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Attribute]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Attribute]("io.apibuilder.api.v0.models.Attribute", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -203,13 +210,14 @@ import scala.language.higherKinds override def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Attribute] = { val urlPath = Seq("attributes") val (payload, formPayload) = (Some(attributeForm), None) - _executeRequest[io.apibuilder.api.v0.models.AttributeForm, io.apibuilder.api.v0.models.Attribute]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.AttributeForm, io.apibuilder.api.v0.models.Attribute]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Attribute]("io.apibuilder.api.v0.models.Attribute", r) case r if r.status.code == 401 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) @@ -219,11 +227,12 @@ import scala.language.higherKinds override def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("attributes", name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 401 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -238,7 +247,8 @@ import scala.language.higherKinds applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Change]] = { val urlPath = Seq("changes") @@ -249,7 +259,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Change]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Change]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Change]]("Seq[io.apibuilder.api.v0.models.Change]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -262,11 +272,12 @@ import scala.language.higherKinds applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Code] = { val urlPath = Seq(orgKey, applicationKey, version, generatorKey) - _executeRequest[Unit, io.apibuilder.api.v0.models.Code]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Code]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Code]("io.apibuilder.api.v0.models.Code", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) @@ -279,13 +290,14 @@ import scala.language.higherKinds override def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Domain] = { val urlPath = Seq("domains", orgKey) val (payload, formPayload) = (Some(domain), None) - _executeRequest[io.apibuilder.api.v0.models.Domain, io.apibuilder.api.v0.models.Domain]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.Domain, io.apibuilder.api.v0.models.Domain]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Domain]("io.apibuilder.api.v0.models.Domain", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -295,11 +307,12 @@ import scala.language.higherKinds override def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("domains", orgKey, name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -309,13 +322,14 @@ import scala.language.higherKinds object EmailVerificationConfirmationForms extends EmailVerificationConfirmationForms[F] { override def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("email_verification_confirmations") val (payload, formPayload) = (Some(emailVerificationConfirmationForm), None) - _executeRequest[io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -330,7 +344,8 @@ import scala.language.higherKinds generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.GeneratorService]] = { val urlPath = Seq("generator_services") @@ -342,7 +357,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.GeneratorService]]("Seq[io.apibuilder.api.v0.models.GeneratorService]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -350,11 +365,12 @@ import scala.language.higherKinds override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorService] = { val urlPath = Seq("generator_services", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorService]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorService]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.GeneratorService]("io.apibuilder.api.v0.models.GeneratorService", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -363,13 +379,14 @@ import scala.language.higherKinds override def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorService] = { val urlPath = Seq("generator_services") val (payload, formPayload) = (Some(generatorServiceForm), None) - _executeRequest[io.apibuilder.api.v0.models.GeneratorServiceForm, io.apibuilder.api.v0.models.GeneratorService]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.GeneratorServiceForm, io.apibuilder.api.v0.models.GeneratorService]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.GeneratorService]("io.apibuilder.api.v0.models.GeneratorService", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -378,11 +395,12 @@ import scala.language.higherKinds override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("generator_services", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 403 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -400,7 +418,8 @@ import scala.language.higherKinds key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] = { val urlPath = Seq("generators") @@ -414,7 +433,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("Seq[io.apibuilder.api.v0.models.GeneratorWithService]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -422,11 +441,12 @@ import scala.language.higherKinds override def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorWithService] = { val urlPath = Seq("generators", key) - _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorWithService]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorWithService]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.GeneratorWithService]("io.apibuilder.api.v0.models.GeneratorWithService", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -436,22 +456,24 @@ import scala.language.higherKinds object Healthchecks extends Healthchecks[F] { override def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.generator.v0.models.Healthcheck] = { val urlPath = Seq("_internal_", "healthcheck") - _executeRequest[Unit, io.apibuilder.generator.v0.models.Healthcheck]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.generator.v0.models.Healthcheck]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.generator.v0.models.Healthcheck]("io.apibuilder.generator.v0.models.Healthcheck", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } } override def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Map[String, String]] = { val urlPath = Seq("_internal_", "migrate") - _executeRequest[Unit, Map[String, String]]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Map[String, String]]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Map[String, String]]("Map[String, String]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -463,7 +485,8 @@ import scala.language.higherKinds q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Item]] = { val urlPath = Seq("items") @@ -473,7 +496,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Item]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Item]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Item]]("Seq[io.apibuilder.api.v0.models.Item]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -481,11 +504,12 @@ import scala.language.higherKinds override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Item] = { val urlPath = Seq("items", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Item]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Item]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Item]("io.apibuilder.api.v0.models.Item", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -501,7 +525,8 @@ import scala.language.higherKinds role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.MembershipRequest]] = { val urlPath = Seq("membership_requests") @@ -514,7 +539,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.MembershipRequest]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.MembershipRequest]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.MembershipRequest]]("Seq[io.apibuilder.api.v0.models.MembershipRequest]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -524,7 +549,8 @@ import scala.language.higherKinds orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.MembershipRequest] = { val urlPath = Seq("membership_requests") @@ -535,7 +561,7 @@ import scala.language.higherKinds "role" -> role )) - _executeRequest[Unit, io.apibuilder.api.v0.models.MembershipRequest]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.MembershipRequest]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.MembershipRequest]("io.apibuilder.api.v0.models.MembershipRequest", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -544,11 +570,12 @@ import scala.language.higherKinds override def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("membership_requests", guid.toString, "accept") - _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -557,11 +584,12 @@ import scala.language.higherKinds override def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("membership_requests", guid.toString, "decline") - _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -577,7 +605,8 @@ import scala.language.higherKinds role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Membership]] = { val urlPath = Seq("memberships") @@ -590,7 +619,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Membership]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Membership]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Membership]]("Seq[io.apibuilder.api.v0.models.Membership]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -598,11 +627,12 @@ import scala.language.higherKinds override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Membership] = { val urlPath = Seq("memberships", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Membership]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Membership]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Membership]("io.apibuilder.api.v0.models.Membership", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -611,11 +641,12 @@ import scala.language.higherKinds override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("memberships", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -631,7 +662,8 @@ import scala.language.higherKinds namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Organization]] = { val urlPath = Seq("organizations") @@ -645,7 +677,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Organization]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Organization]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Organization]]("Seq[io.apibuilder.api.v0.models.Organization]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -653,11 +685,12 @@ import scala.language.higherKinds override def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations", key) - _executeRequest[Unit, io.apibuilder.api.v0.models.Organization]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Organization]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -666,13 +699,14 @@ import scala.language.higherKinds override def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations") val (payload, formPayload) = (Some(organizationForm), None) - _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -682,13 +716,14 @@ import scala.language.higherKinds override def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations", key) val (payload, formPayload) = (Some(organizationForm), None) - _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -697,11 +732,12 @@ import scala.language.higherKinds override def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("organizations", key) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -712,7 +748,8 @@ import scala.language.higherKinds name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.AttributeValue]] = { val urlPath = Seq("organizations", key, "attributes") @@ -722,7 +759,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.AttributeValue]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.AttributeValue]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.AttributeValue]]("Seq[io.apibuilder.api.v0.models.AttributeValue]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -731,11 +768,12 @@ import scala.language.higherKinds override def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.AttributeValue] = { val urlPath = Seq("organizations", key, "attributes", name) - _executeRequest[Unit, io.apibuilder.api.v0.models.AttributeValue]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.AttributeValue]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -746,13 +784,14 @@ import scala.language.higherKinds key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.AttributeValue] = { val urlPath = Seq("organizations", key, "attributes", name) val (payload, formPayload) = (Some(attributeValueForm), None) - _executeRequest[io.apibuilder.api.v0.models.AttributeValueForm, io.apibuilder.api.v0.models.AttributeValue]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.AttributeValueForm, io.apibuilder.api.v0.models.AttributeValue]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -764,11 +803,12 @@ import scala.language.higherKinds override def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("organizations", key, "attributes", name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 401 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -780,13 +820,14 @@ import scala.language.higherKinds object PasswordResetRequests extends PasswordResetRequests[F] { override def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("password_reset_requests") val (payload, formPayload) = (Some(passwordResetRequest), None) - _executeRequest[io.apibuilder.api.v0.models.PasswordResetRequest, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.PasswordResetRequest, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -797,13 +838,14 @@ import scala.language.higherKinds object PasswordResets extends PasswordResets[F] { override def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.PasswordResetSuccess] = { val urlPath = Seq("password_resets") val (payload, formPayload) = (Some(passwordReset), None) - _executeRequest[io.apibuilder.api.v0.models.PasswordReset, io.apibuilder.api.v0.models.PasswordResetSuccess]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.PasswordReset, io.apibuilder.api.v0.models.PasswordResetSuccess]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.PasswordResetSuccess]("io.apibuilder.api.v0.models.PasswordResetSuccess", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -819,7 +861,8 @@ import scala.language.higherKinds publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Subscription]] = { val urlPath = Seq("subscriptions") @@ -832,7 +875,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Subscription]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Subscription]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Subscription]]("Seq[io.apibuilder.api.v0.models.Subscription]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -840,11 +883,12 @@ import scala.language.higherKinds override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Subscription] = { val urlPath = Seq("subscriptions", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Subscription]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Subscription]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Subscription]("io.apibuilder.api.v0.models.Subscription", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -853,13 +897,14 @@ import scala.language.higherKinds override def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Subscription] = { val urlPath = Seq("subscriptions") val (payload, formPayload) = (Some(subscriptionForm), None) - _executeRequest[io.apibuilder.api.v0.models.SubscriptionForm, io.apibuilder.api.v0.models.Subscription]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.SubscriptionForm, io.apibuilder.api.v0.models.Subscription]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Subscription]("io.apibuilder.api.v0.models.Subscription", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -868,11 +913,12 @@ import scala.language.higherKinds override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("subscriptions", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -885,7 +931,8 @@ import scala.language.higherKinds guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Token]] = { val urlPath = Seq("tokens", "users", userGuid.toString) @@ -895,7 +942,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Token]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Token]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Token]]("Seq[io.apibuilder.api.v0.models.Token]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -903,11 +950,12 @@ import scala.language.higherKinds override def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.CleartextToken] = { val urlPath = Seq("tokens", guid.toString, "cleartext") - _executeRequest[Unit, io.apibuilder.api.v0.models.CleartextToken]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.CleartextToken]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.CleartextToken]("io.apibuilder.api.v0.models.CleartextToken", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -916,13 +964,14 @@ import scala.language.higherKinds override def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Token] = { val urlPath = Seq("tokens") val (payload, formPayload) = (Some(tokenForm), None) - _executeRequest[io.apibuilder.api.v0.models.TokenForm, io.apibuilder.api.v0.models.Token]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.TokenForm, io.apibuilder.api.v0.models.Token]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Token]("io.apibuilder.api.v0.models.Token", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -931,11 +980,12 @@ import scala.language.higherKinds override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("tokens", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -947,7 +997,8 @@ import scala.language.higherKinds guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.User]] = { val urlPath = Seq("users") @@ -957,7 +1008,7 @@ import scala.language.higherKinds token.map("token" -> _) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.User]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.User]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.User]]("Seq[io.apibuilder.api.v0.models.User]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -965,11 +1016,12 @@ import scala.language.higherKinds override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.User]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.User]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -979,7 +1031,8 @@ import scala.language.higherKinds override def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", "authenticate") @@ -989,7 +1042,7 @@ import scala.language.higherKinds "password" -> password )) - _executeRequest[Unit, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -998,13 +1051,14 @@ import scala.language.higherKinds override def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users") val (payload, formPayload) = (Some(userForm), None) - _executeRequest[io.apibuilder.api.v0.models.UserForm, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.UserForm, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1014,13 +1068,14 @@ import scala.language.higherKinds override def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", guid.toString) val (payload, formPayload) = (Some(userUpdateForm), None) - _executeRequest[io.apibuilder.api.v0.models.UserUpdateForm, io.apibuilder.api.v0.models.User]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.UserUpdateForm, io.apibuilder.api.v0.models.User]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1031,13 +1086,14 @@ import scala.language.higherKinds object Validations extends Validations[F] { override def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Validation] = { val urlPath = Seq("validations") val (payload, formPayload) = (Some(value), None) - _executeRequest[String, io.apibuilder.api.v0.models.Validation]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[String, io.apibuilder.api.v0.models.Validation]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Validation]("io.apibuilder.api.v0.models.Validation", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1050,7 +1106,8 @@ import scala.language.higherKinds applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Version]] = { val urlPath = Seq(orgKey, applicationKey) @@ -1059,7 +1116,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Version]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Version]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Version]]("Seq[io.apibuilder.api.v0.models.Version]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1069,11 +1126,12 @@ import scala.language.higherKinds orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, applicationKey, version) - _executeRequest[Unit, io.apibuilder.api.v0.models.Version]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Version]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -1084,13 +1142,14 @@ import scala.language.higherKinds orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, version) val (payload, formPayload) = (Some(versionForm), None) - _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1102,13 +1161,14 @@ import scala.language.higherKinds applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, applicationKey, version) val (payload, formPayload) = (Some(versionForm), None) - _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1119,11 +1179,12 @@ import scala.language.higherKinds orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq(orgKey, applicationKey, version) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -1138,7 +1199,8 @@ import scala.language.higherKinds applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Watch]] = { val urlPath = Seq("watches") @@ -1151,7 +1213,7 @@ import scala.language.higherKinds Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Watch]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Watch]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Watch]]("Seq[io.apibuilder.api.v0.models.Watch]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1159,11 +1221,12 @@ import scala.language.higherKinds override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Watch] = { val urlPath = Seq("watches", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Watch]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Watch]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Watch]("io.apibuilder.api.v0.models.Watch", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -1174,7 +1237,8 @@ import scala.language.higherKinds userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Boolean] = { val urlPath = Seq("watches", "check") @@ -1184,7 +1248,7 @@ import scala.language.higherKinds Some("application_key" -> applicationKey) ).flatten - _executeRequest[Unit, Boolean]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Boolean]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Boolean]("Boolean", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1192,13 +1256,14 @@ import scala.language.higherKinds override def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Watch] = { val urlPath = Seq("watches") val (payload, formPayload) = (Some(watchForm), None) - _executeRequest[io.apibuilder.api.v0.models.WatchForm, io.apibuilder.api.v0.models.Watch]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.WatchForm, io.apibuilder.api.v0.models.Watch]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Watch]("io.apibuilder.api.v0.models.Watch", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -1207,11 +1272,12 @@ import scala.language.higherKinds override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("watches", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -1236,7 +1302,8 @@ import scala.language.higherKinds queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, body: Option[T] = None, - formBody : Option[org.http4s.UrlForm] = None + formBody: Option[org.http4s.UrlForm] = None, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity )(handler: org.http4s.Response[F] => F[U] )(implicit encoder: io.circe.Encoder[T]): F[U] = { import org.http4s.QueryParamEncoder._ @@ -1255,9 +1322,7 @@ import scala.language.higherKinds val queryMap = queryParameters.groupBy(_._1).map { case (k, v) => k -> v.map(_._2) } val uri = path.foldLeft(baseUrl){ case (uri, segment) => uri / segment }.setQueryParams(queryMap) - val request = org.http4s.Request[F](method = m, - uri = uri, - headers = headers) + val request = org.http4s.Request[F](method = m, uri = uri, headers = headers) val reqAndMaybeAuth = auth.fold(request) { case Authorization.Basic(username, passwordOpt) => { @@ -1268,9 +1333,10 @@ import scala.language.higherKinds case a => sys.error("Invalid authorization scheme[" + a.getClass + "]") } + val decoratedRequest = requestModifier(reqAndMaybeAuth) val reqAndMaybeAuthAndBody = - if (formBody.nonEmpty) formBody.fold(Sync[F].pure(reqAndMaybeAuth))(reqAndMaybeAuth.withBody) - else body.fold(Sync[F].pure(reqAndMaybeAuth))(reqAndMaybeAuth.withBody) + if (formBody.nonEmpty) formBody.fold(Sync[F].pure(decoratedRequest))(decoratedRequest.withBody) + else body.fold(Sync[F].pure(decoratedRequest))(decoratedRequest.withBody) httpClient.fetch(modifyRequest(reqAndMaybeAuthAndBody))(handler) } @@ -1345,7 +1411,8 @@ import scala.language.higherKinds hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Application]] /** @@ -1354,7 +1421,8 @@ import scala.language.higherKinds def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] /** @@ -1364,7 +1432,8 @@ import scala.language.higherKinds orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] /** @@ -1373,7 +1442,8 @@ import scala.language.higherKinds def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] /** @@ -1383,7 +1453,8 @@ import scala.language.higherKinds orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] } @@ -1401,7 +1472,8 @@ import scala.language.higherKinds name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Attribute]] /** @@ -1409,7 +1481,8 @@ import scala.language.higherKinds */ def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Attribute] /** @@ -1417,7 +1490,8 @@ import scala.language.higherKinds */ def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Attribute] /** @@ -1426,7 +1500,8 @@ import scala.language.higherKinds */ def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -1442,7 +1517,8 @@ import scala.language.higherKinds applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Change]] } @@ -1460,7 +1536,8 @@ import scala.language.higherKinds applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Code] } @@ -1471,7 +1548,8 @@ import scala.language.higherKinds def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Domain] /** @@ -1480,7 +1558,8 @@ import scala.language.higherKinds def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -1490,7 +1569,8 @@ import scala.language.higherKinds */ def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -1507,17 +1587,20 @@ import scala.language.higherKinds generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.GeneratorService]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorService] def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorService] /** @@ -1525,7 +1608,8 @@ import scala.language.higherKinds */ def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -1549,22 +1633,26 @@ import scala.language.higherKinds key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorWithService] } trait Healthchecks[F[_]] { def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.generator.v0.models.Healthcheck] def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Map[String, String]] } @@ -1578,12 +1666,14 @@ import scala.language.higherKinds q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Item]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Item] } @@ -1601,7 +1691,8 @@ import scala.language.higherKinds role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.MembershipRequest]] /** @@ -1611,7 +1702,8 @@ import scala.language.higherKinds orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.MembershipRequest] /** @@ -1620,7 +1712,8 @@ import scala.language.higherKinds */ def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] /** @@ -1629,7 +1722,8 @@ import scala.language.higherKinds */ def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -1647,17 +1741,20 @@ import scala.language.higherKinds role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Membership]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Membership] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -1683,7 +1780,8 @@ import scala.language.higherKinds namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Organization]] /** @@ -1691,7 +1789,8 @@ import scala.language.higherKinds */ def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] /** @@ -1699,7 +1798,8 @@ import scala.language.higherKinds */ def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] /** @@ -1708,7 +1808,8 @@ import scala.language.higherKinds def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] /** @@ -1716,7 +1817,8 @@ import scala.language.higherKinds */ def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] /** @@ -1732,7 +1834,8 @@ import scala.language.higherKinds name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.AttributeValue]] /** @@ -1741,7 +1844,8 @@ import scala.language.higherKinds def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.AttributeValue] /** @@ -1751,7 +1855,8 @@ import scala.language.higherKinds key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.AttributeValue] /** @@ -1761,7 +1866,8 @@ import scala.language.higherKinds def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -1772,7 +1878,8 @@ import scala.language.higherKinds */ def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -1784,7 +1891,8 @@ import scala.language.higherKinds */ def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.PasswordResetSuccess] } @@ -1806,7 +1914,8 @@ import scala.language.higherKinds publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Subscription]] /** @@ -1814,7 +1923,8 @@ import scala.language.higherKinds */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Subscription] /** @@ -1822,12 +1932,14 @@ import scala.language.higherKinds */ def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Subscription] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -1841,7 +1953,8 @@ import scala.language.higherKinds guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Token]] /** @@ -1849,7 +1962,8 @@ import scala.language.higherKinds */ def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.CleartextToken] /** @@ -1857,12 +1971,14 @@ import scala.language.higherKinds */ def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Token] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -1879,7 +1995,8 @@ import scala.language.higherKinds guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.User]] /** @@ -1887,7 +2004,8 @@ import scala.language.higherKinds */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] /** @@ -1898,7 +2016,8 @@ import scala.language.higherKinds def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] /** @@ -1906,7 +2025,8 @@ import scala.language.higherKinds */ def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] /** @@ -1915,14 +2035,16 @@ import scala.language.higherKinds def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] } trait Validations[F[_]] { def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Validation] } @@ -1940,7 +2062,8 @@ import scala.language.higherKinds applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Version]] /** @@ -1953,7 +2076,8 @@ import scala.language.higherKinds orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] /** @@ -1963,7 +2087,8 @@ import scala.language.higherKinds orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] /** @@ -1974,7 +2099,8 @@ import scala.language.higherKinds applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] /** @@ -1984,7 +2110,8 @@ import scala.language.higherKinds orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -2006,7 +2133,8 @@ import scala.language.higherKinds applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Watch]] /** @@ -2014,7 +2142,8 @@ import scala.language.higherKinds */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Watch] /** @@ -2027,7 +2156,8 @@ import scala.language.higherKinds userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Boolean] /** @@ -2035,12 +2165,14 @@ import scala.language.higherKinds */ def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Watch] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } diff --git a/lib/src/test/resources/http4s/apidoc-api/018/BryzekApidocApiV0MockClient.scala.txt b/lib/src/test/resources/http4s/apidoc-api/018/BryzekApidocApiV0MockClient.scala.txt index 44b1670df..50cbdb262 100644 --- a/lib/src/test/resources/http4s/apidoc-api/018/BryzekApidocApiV0MockClient.scala.txt +++ b/lib/src/test/resources/http4s/apidoc-api/018/BryzekApidocApiV0MockClient.scala.txt @@ -54,7 +54,8 @@ package io.apibuilder.api.v0.mock { hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Application]] = cats.Applicative[F].pure { Nil } @@ -65,7 +66,8 @@ package io.apibuilder.api.v0.mock { def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeApplication() } @@ -77,7 +79,8 @@ package io.apibuilder.api.v0.mock { orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeApplication() } @@ -88,7 +91,8 @@ package io.apibuilder.api.v0.mock { def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -100,7 +104,8 @@ package io.apibuilder.api.v0.mock { orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeApplication() } @@ -122,7 +127,8 @@ package io.apibuilder.api.v0.mock { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Attribute]] = cats.Applicative[F].pure { Nil } @@ -132,7 +138,8 @@ package io.apibuilder.api.v0.mock { */ def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Attribute] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeAttribute() } @@ -142,7 +149,8 @@ package io.apibuilder.api.v0.mock { */ def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Attribute] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeAttribute() } @@ -153,7 +161,8 @@ package io.apibuilder.api.v0.mock { */ def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -173,7 +182,8 @@ package io.apibuilder.api.v0.mock { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Change]] = cats.Applicative[F].pure { Nil } @@ -195,7 +205,8 @@ package io.apibuilder.api.v0.mock { applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Code] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeCode() } @@ -205,13 +216,15 @@ package io.apibuilder.api.v0.mock { class MockHealthchecks[F[_]: cats.Applicative] extends io.apibuilder.api.v0.Healthchecks[F] { def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.generator.v0.models.Healthcheck] = cats.Applicative[F].pure { io.apibuilder.generator.v0.mock.Factories.makeHealthcheck() } def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Map[String, String]] = cats.Applicative[F].pure { Map() } @@ -226,7 +239,8 @@ package io.apibuilder.api.v0.mock { def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Domain] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeDomain() } @@ -237,7 +251,8 @@ package io.apibuilder.api.v0.mock { def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -251,7 +266,8 @@ package io.apibuilder.api.v0.mock { */ def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -272,21 +288,24 @@ package io.apibuilder.api.v0.mock { generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.GeneratorService]] = cats.Applicative[F].pure { Nil } def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorService] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeGeneratorService() } def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorService] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeGeneratorService() } @@ -296,7 +315,8 @@ package io.apibuilder.api.v0.mock { */ def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -324,14 +344,16 @@ package io.apibuilder.api.v0.mock { key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] = cats.Applicative[F].pure { Nil } def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorWithService] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeGeneratorWithService() } @@ -349,14 +371,16 @@ package io.apibuilder.api.v0.mock { q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Item]] = cats.Applicative[F].pure { Nil } def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Item] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeItem() } @@ -378,21 +402,24 @@ package io.apibuilder.api.v0.mock { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Membership]] = cats.Applicative[F].pure { Nil } def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Membership] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeMembership() } def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -414,7 +441,8 @@ package io.apibuilder.api.v0.mock { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.MembershipRequest]] = cats.Applicative[F].pure { Nil } @@ -426,7 +454,8 @@ package io.apibuilder.api.v0.mock { orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.MembershipRequest] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeMembershipRequest() } @@ -437,7 +466,8 @@ package io.apibuilder.api.v0.mock { */ def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -448,7 +478,8 @@ package io.apibuilder.api.v0.mock { */ def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -478,7 +509,8 @@ package io.apibuilder.api.v0.mock { namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Organization]] = cats.Applicative[F].pure { Nil } @@ -488,7 +520,8 @@ package io.apibuilder.api.v0.mock { */ def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeOrganization() } @@ -498,7 +531,8 @@ package io.apibuilder.api.v0.mock { */ def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeOrganization() } @@ -509,7 +543,8 @@ package io.apibuilder.api.v0.mock { def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeOrganization() } @@ -519,7 +554,8 @@ package io.apibuilder.api.v0.mock { */ def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -537,7 +573,8 @@ package io.apibuilder.api.v0.mock { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.AttributeValue]] = cats.Applicative[F].pure { Nil } @@ -548,7 +585,8 @@ package io.apibuilder.api.v0.mock { def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.AttributeValue] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeAttributeValue() } @@ -560,7 +598,8 @@ package io.apibuilder.api.v0.mock { key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.AttributeValue] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeAttributeValue() } @@ -572,7 +611,8 @@ package io.apibuilder.api.v0.mock { def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -588,7 +628,8 @@ package io.apibuilder.api.v0.mock { */ def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.PasswordResetSuccess] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makePasswordResetSuccess() } @@ -603,7 +644,8 @@ package io.apibuilder.api.v0.mock { */ def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -629,7 +671,8 @@ package io.apibuilder.api.v0.mock { publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Subscription]] = cats.Applicative[F].pure { Nil } @@ -639,7 +682,8 @@ package io.apibuilder.api.v0.mock { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Subscription] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeSubscription() } @@ -649,14 +693,16 @@ package io.apibuilder.api.v0.mock { */ def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Subscription] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeSubscription() } def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -674,7 +720,8 @@ package io.apibuilder.api.v0.mock { guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Token]] = cats.Applicative[F].pure { Nil } @@ -684,7 +731,8 @@ package io.apibuilder.api.v0.mock { */ def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.CleartextToken] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeCleartextToken() } @@ -694,14 +742,16 @@ package io.apibuilder.api.v0.mock { */ def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Token] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeToken() } def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -722,7 +772,8 @@ package io.apibuilder.api.v0.mock { guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.User]] = cats.Applicative[F].pure { Nil } @@ -732,7 +783,8 @@ package io.apibuilder.api.v0.mock { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeUser() } @@ -745,7 +797,8 @@ package io.apibuilder.api.v0.mock { def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeUser() } @@ -755,7 +808,8 @@ package io.apibuilder.api.v0.mock { */ def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeUser() } @@ -766,7 +820,8 @@ package io.apibuilder.api.v0.mock { def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeUser() } @@ -777,7 +832,8 @@ package io.apibuilder.api.v0.mock { def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Validation] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeValidation() } @@ -799,7 +855,8 @@ package io.apibuilder.api.v0.mock { applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Version]] = cats.Applicative[F].pure { Nil } @@ -814,7 +871,8 @@ package io.apibuilder.api.v0.mock { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeVersion() } @@ -826,7 +884,8 @@ package io.apibuilder.api.v0.mock { orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeVersion() } @@ -839,7 +898,8 @@ package io.apibuilder.api.v0.mock { applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeVersion() } @@ -851,7 +911,8 @@ package io.apibuilder.api.v0.mock { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -877,7 +938,8 @@ package io.apibuilder.api.v0.mock { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Watch]] = cats.Applicative[F].pure { Nil } @@ -887,7 +949,8 @@ package io.apibuilder.api.v0.mock { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Watch] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeWatch() } @@ -902,7 +965,8 @@ package io.apibuilder.api.v0.mock { userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Boolean] = cats.Applicative[F].pure { true } @@ -912,14 +976,16 @@ package io.apibuilder.api.v0.mock { */ def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Watch] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeWatch() } def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } diff --git a/lib/src/test/resources/http4s/apidoc-api/020_instant/BryzekApidocApiV0Client.scala.txt b/lib/src/test/resources/http4s/apidoc-api/020_instant/BryzekApidocApiV0Client.scala.txt index f4ca855b0..721ee339a 100644 --- a/lib/src/test/resources/http4s/apidoc-api/020_instant/BryzekApidocApiV0Client.scala.txt +++ b/lib/src/test/resources/http4s/apidoc-api/020_instant/BryzekApidocApiV0Client.scala.txt @@ -1883,7 +1883,8 @@ import io.circe.syntax._ hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Application]] = { val urlPath = Seq(orgKey) @@ -1896,7 +1897,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Application]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Application]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Application]]("Seq[io.apibuilder.api.v0.models.Application]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1905,13 +1906,14 @@ import io.circe.syntax._ override def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey) val (payload, formPayload) = (Some(applicationForm), None) - _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1922,13 +1924,14 @@ import io.circe.syntax._ orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey, applicationKey) val (payload, formPayload) = (Some(applicationForm), None) - _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1938,11 +1941,12 @@ import io.circe.syntax._ override def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq(orgKey, applicationKey) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -1952,13 +1956,14 @@ import io.circe.syntax._ orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey, applicationKey, "move") val (payload, formPayload) = (Some(moveForm), None) - _executeRequest[io.apibuilder.api.v0.models.MoveForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.MoveForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1972,7 +1977,8 @@ import io.circe.syntax._ name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Attribute]] = { val urlPath = Seq("attributes") @@ -1983,7 +1989,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Attribute]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Attribute]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Attribute]]("Seq[io.apibuilder.api.v0.models.Attribute]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1991,11 +1997,12 @@ import io.circe.syntax._ override def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Attribute] = { val urlPath = Seq("attributes", name) - _executeRequest[Unit, io.apibuilder.api.v0.models.Attribute]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Attribute]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Attribute]("io.apibuilder.api.v0.models.Attribute", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2004,13 +2011,14 @@ import io.circe.syntax._ override def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Attribute] = { val urlPath = Seq("attributes") val (payload, formPayload) = (Some(attributeForm), None) - _executeRequest[io.apibuilder.api.v0.models.AttributeForm, io.apibuilder.api.v0.models.Attribute]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.AttributeForm, io.apibuilder.api.v0.models.Attribute]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Attribute]("io.apibuilder.api.v0.models.Attribute", r) case r if r.status.code == 401 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) @@ -2020,11 +2028,12 @@ import io.circe.syntax._ override def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("attributes", name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 401 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -2039,7 +2048,8 @@ import io.circe.syntax._ applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Change]] = { val urlPath = Seq("changes") @@ -2050,7 +2060,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Change]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Change]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Change]]("Seq[io.apibuilder.api.v0.models.Change]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2063,11 +2073,12 @@ import io.circe.syntax._ applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Code] = { val urlPath = Seq(orgKey, applicationKey, version, generatorKey) - _executeRequest[Unit, io.apibuilder.api.v0.models.Code]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Code]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Code]("io.apibuilder.api.v0.models.Code", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) @@ -2080,13 +2091,14 @@ import io.circe.syntax._ override def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Domain] = { val urlPath = Seq("domains", orgKey) val (payload, formPayload) = (Some(domain), None) - _executeRequest[io.apibuilder.api.v0.models.Domain, io.apibuilder.api.v0.models.Domain]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.Domain, io.apibuilder.api.v0.models.Domain]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Domain]("io.apibuilder.api.v0.models.Domain", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2096,11 +2108,12 @@ import io.circe.syntax._ override def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("domains", orgKey, name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2110,13 +2123,14 @@ import io.circe.syntax._ object EmailVerificationConfirmationForms extends EmailVerificationConfirmationForms[F] { override def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("email_verification_confirmations") val (payload, formPayload) = (Some(emailVerificationConfirmationForm), None) - _executeRequest[io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -2131,7 +2145,8 @@ import io.circe.syntax._ generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.GeneratorService]] = { val urlPath = Seq("generator_services") @@ -2143,7 +2158,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.GeneratorService]]("Seq[io.apibuilder.api.v0.models.GeneratorService]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2151,11 +2166,12 @@ import io.circe.syntax._ override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorService] = { val urlPath = Seq("generator_services", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorService]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorService]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.GeneratorService]("io.apibuilder.api.v0.models.GeneratorService", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2164,13 +2180,14 @@ import io.circe.syntax._ override def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorService] = { val urlPath = Seq("generator_services") val (payload, formPayload) = (Some(generatorServiceForm), None) - _executeRequest[io.apibuilder.api.v0.models.GeneratorServiceForm, io.apibuilder.api.v0.models.GeneratorService]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.GeneratorServiceForm, io.apibuilder.api.v0.models.GeneratorService]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.GeneratorService]("io.apibuilder.api.v0.models.GeneratorService", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2179,11 +2196,12 @@ import io.circe.syntax._ override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("generator_services", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 403 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -2201,7 +2219,8 @@ import io.circe.syntax._ key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] = { val urlPath = Seq("generators") @@ -2215,7 +2234,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("Seq[io.apibuilder.api.v0.models.GeneratorWithService]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2223,11 +2242,12 @@ import io.circe.syntax._ override def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorWithService] = { val urlPath = Seq("generators", key) - _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorWithService]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorWithService]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.GeneratorWithService]("io.apibuilder.api.v0.models.GeneratorWithService", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2237,22 +2257,24 @@ import io.circe.syntax._ object Healthchecks extends Healthchecks[F] { override def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.generator.v0.models.Healthcheck] = { val urlPath = Seq("_internal_", "healthcheck") - _executeRequest[Unit, io.apibuilder.generator.v0.models.Healthcheck]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.generator.v0.models.Healthcheck]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.generator.v0.models.Healthcheck]("io.apibuilder.generator.v0.models.Healthcheck", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } } override def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Map[String, String]] = { val urlPath = Seq("_internal_", "migrate") - _executeRequest[Unit, Map[String, String]]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Map[String, String]]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Map[String, String]]("Map[String, String]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2264,7 +2286,8 @@ import io.circe.syntax._ q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Item]] = { val urlPath = Seq("items") @@ -2274,7 +2297,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Item]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Item]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Item]]("Seq[io.apibuilder.api.v0.models.Item]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2282,11 +2305,12 @@ import io.circe.syntax._ override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Item] = { val urlPath = Seq("items", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Item]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Item]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Item]("io.apibuilder.api.v0.models.Item", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2302,7 +2326,8 @@ import io.circe.syntax._ role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.MembershipRequest]] = { val urlPath = Seq("membership_requests") @@ -2315,7 +2340,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.MembershipRequest]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.MembershipRequest]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.MembershipRequest]]("Seq[io.apibuilder.api.v0.models.MembershipRequest]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2325,7 +2350,8 @@ import io.circe.syntax._ orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.MembershipRequest] = { val urlPath = Seq("membership_requests") @@ -2336,7 +2362,7 @@ import io.circe.syntax._ "role" -> role )) - _executeRequest[Unit, io.apibuilder.api.v0.models.MembershipRequest]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.MembershipRequest]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.MembershipRequest]("io.apibuilder.api.v0.models.MembershipRequest", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2345,11 +2371,12 @@ import io.circe.syntax._ override def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("membership_requests", guid.toString, "accept") - _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -2358,11 +2385,12 @@ import io.circe.syntax._ override def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("membership_requests", guid.toString, "decline") - _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -2378,7 +2406,8 @@ import io.circe.syntax._ role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Membership]] = { val urlPath = Seq("memberships") @@ -2391,7 +2420,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Membership]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Membership]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Membership]]("Seq[io.apibuilder.api.v0.models.Membership]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2399,11 +2428,12 @@ import io.circe.syntax._ override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Membership] = { val urlPath = Seq("memberships", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Membership]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Membership]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Membership]("io.apibuilder.api.v0.models.Membership", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2412,11 +2442,12 @@ import io.circe.syntax._ override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("memberships", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2432,7 +2463,8 @@ import io.circe.syntax._ namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Organization]] = { val urlPath = Seq("organizations") @@ -2446,7 +2478,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Organization]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Organization]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Organization]]("Seq[io.apibuilder.api.v0.models.Organization]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2454,11 +2486,12 @@ import io.circe.syntax._ override def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations", key) - _executeRequest[Unit, io.apibuilder.api.v0.models.Organization]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Organization]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2467,13 +2500,14 @@ import io.circe.syntax._ override def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations") val (payload, formPayload) = (Some(organizationForm), None) - _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2483,13 +2517,14 @@ import io.circe.syntax._ override def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations", key) val (payload, formPayload) = (Some(organizationForm), None) - _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2498,11 +2533,12 @@ import io.circe.syntax._ override def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("organizations", key) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2513,7 +2549,8 @@ import io.circe.syntax._ name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.AttributeValue]] = { val urlPath = Seq("organizations", key, "attributes") @@ -2523,7 +2560,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.AttributeValue]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.AttributeValue]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.AttributeValue]]("Seq[io.apibuilder.api.v0.models.AttributeValue]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2532,11 +2569,12 @@ import io.circe.syntax._ override def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.AttributeValue] = { val urlPath = Seq("organizations", key, "attributes", name) - _executeRequest[Unit, io.apibuilder.api.v0.models.AttributeValue]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.AttributeValue]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2547,13 +2585,14 @@ import io.circe.syntax._ key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.AttributeValue] = { val urlPath = Seq("organizations", key, "attributes", name) val (payload, formPayload) = (Some(attributeValueForm), None) - _executeRequest[io.apibuilder.api.v0.models.AttributeValueForm, io.apibuilder.api.v0.models.AttributeValue]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.AttributeValueForm, io.apibuilder.api.v0.models.AttributeValue]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -2565,11 +2604,12 @@ import io.circe.syntax._ override def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("organizations", key, "attributes", name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 401 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -2581,13 +2621,14 @@ import io.circe.syntax._ object PasswordResetRequests extends PasswordResetRequests[F] { override def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("password_reset_requests") val (payload, formPayload) = (Some(passwordResetRequest), None) - _executeRequest[io.apibuilder.api.v0.models.PasswordResetRequest, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.PasswordResetRequest, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -2598,13 +2639,14 @@ import io.circe.syntax._ object PasswordResets extends PasswordResets[F] { override def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.PasswordResetSuccess] = { val urlPath = Seq("password_resets") val (payload, formPayload) = (Some(passwordReset), None) - _executeRequest[io.apibuilder.api.v0.models.PasswordReset, io.apibuilder.api.v0.models.PasswordResetSuccess]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.PasswordReset, io.apibuilder.api.v0.models.PasswordResetSuccess]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.PasswordResetSuccess]("io.apibuilder.api.v0.models.PasswordResetSuccess", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2620,7 +2662,8 @@ import io.circe.syntax._ publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Subscription]] = { val urlPath = Seq("subscriptions") @@ -2633,7 +2676,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Subscription]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Subscription]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Subscription]]("Seq[io.apibuilder.api.v0.models.Subscription]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2641,11 +2684,12 @@ import io.circe.syntax._ override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Subscription] = { val urlPath = Seq("subscriptions", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Subscription]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Subscription]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Subscription]("io.apibuilder.api.v0.models.Subscription", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2654,13 +2698,14 @@ import io.circe.syntax._ override def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Subscription] = { val urlPath = Seq("subscriptions") val (payload, formPayload) = (Some(subscriptionForm), None) - _executeRequest[io.apibuilder.api.v0.models.SubscriptionForm, io.apibuilder.api.v0.models.Subscription]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.SubscriptionForm, io.apibuilder.api.v0.models.Subscription]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Subscription]("io.apibuilder.api.v0.models.Subscription", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -2669,11 +2714,12 @@ import io.circe.syntax._ override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("subscriptions", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2686,7 +2732,8 @@ import io.circe.syntax._ guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Token]] = { val urlPath = Seq("tokens", "users", userGuid.toString) @@ -2696,7 +2743,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Token]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Token]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Token]]("Seq[io.apibuilder.api.v0.models.Token]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2704,11 +2751,12 @@ import io.circe.syntax._ override def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.CleartextToken] = { val urlPath = Seq("tokens", guid.toString, "cleartext") - _executeRequest[Unit, io.apibuilder.api.v0.models.CleartextToken]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.CleartextToken]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.CleartextToken]("io.apibuilder.api.v0.models.CleartextToken", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2717,13 +2765,14 @@ import io.circe.syntax._ override def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Token] = { val urlPath = Seq("tokens") val (payload, formPayload) = (Some(tokenForm), None) - _executeRequest[io.apibuilder.api.v0.models.TokenForm, io.apibuilder.api.v0.models.Token]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.TokenForm, io.apibuilder.api.v0.models.Token]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Token]("io.apibuilder.api.v0.models.Token", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -2732,11 +2781,12 @@ import io.circe.syntax._ override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("tokens", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2748,7 +2798,8 @@ import io.circe.syntax._ guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.User]] = { val urlPath = Seq("users") @@ -2758,7 +2809,7 @@ import io.circe.syntax._ token.map("token" -> _) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.User]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.User]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.User]]("Seq[io.apibuilder.api.v0.models.User]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2766,11 +2817,12 @@ import io.circe.syntax._ override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.User]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.User]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2780,7 +2832,8 @@ import io.circe.syntax._ override def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", "authenticate") @@ -2790,7 +2843,7 @@ import io.circe.syntax._ "password" -> password )) - _executeRequest[Unit, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2799,13 +2852,14 @@ import io.circe.syntax._ override def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users") val (payload, formPayload) = (Some(userForm), None) - _executeRequest[io.apibuilder.api.v0.models.UserForm, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.UserForm, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2815,13 +2869,14 @@ import io.circe.syntax._ override def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", guid.toString) val (payload, formPayload) = (Some(userUpdateForm), None) - _executeRequest[io.apibuilder.api.v0.models.UserUpdateForm, io.apibuilder.api.v0.models.User]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.UserUpdateForm, io.apibuilder.api.v0.models.User]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2832,13 +2887,14 @@ import io.circe.syntax._ object Validations extends Validations[F] { override def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Validation] = { val urlPath = Seq("validations") val (payload, formPayload) = (Some(value), None) - _executeRequest[String, io.apibuilder.api.v0.models.Validation]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[String, io.apibuilder.api.v0.models.Validation]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Validation]("io.apibuilder.api.v0.models.Validation", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2851,7 +2907,8 @@ import io.circe.syntax._ applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Version]] = { val urlPath = Seq(orgKey, applicationKey) @@ -2860,7 +2917,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Version]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Version]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Version]]("Seq[io.apibuilder.api.v0.models.Version]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2870,11 +2927,12 @@ import io.circe.syntax._ orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, applicationKey, version) - _executeRequest[Unit, io.apibuilder.api.v0.models.Version]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Version]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2885,13 +2943,14 @@ import io.circe.syntax._ orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, version) val (payload, formPayload) = (Some(versionForm), None) - _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2903,13 +2962,14 @@ import io.circe.syntax._ applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, applicationKey, version) val (payload, formPayload) = (Some(versionForm), None) - _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -2920,11 +2980,12 @@ import io.circe.syntax._ orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq(orgKey, applicationKey, version) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -2939,7 +3000,8 @@ import io.circe.syntax._ applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Watch]] = { val urlPath = Seq("watches") @@ -2952,7 +3014,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Watch]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Watch]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Watch]]("Seq[io.apibuilder.api.v0.models.Watch]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2960,11 +3022,12 @@ import io.circe.syntax._ override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Watch] = { val urlPath = Seq("watches", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Watch]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Watch]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Watch]("io.apibuilder.api.v0.models.Watch", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -2975,7 +3038,8 @@ import io.circe.syntax._ userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Boolean] = { val urlPath = Seq("watches", "check") @@ -2985,7 +3049,7 @@ import io.circe.syntax._ Some("application_key" -> applicationKey) ).flatten - _executeRequest[Unit, Boolean]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Boolean]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Boolean]("Boolean", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -2993,13 +3057,14 @@ import io.circe.syntax._ override def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Watch] = { val urlPath = Seq("watches") val (payload, formPayload) = (Some(watchForm), None) - _executeRequest[io.apibuilder.api.v0.models.WatchForm, io.apibuilder.api.v0.models.Watch]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.WatchForm, io.apibuilder.api.v0.models.Watch]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Watch]("io.apibuilder.api.v0.models.Watch", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -3008,11 +3073,12 @@ import io.circe.syntax._ override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("watches", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -3037,7 +3103,8 @@ import io.circe.syntax._ queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, body: Option[T] = None, - formBody : Option[org.http4s.UrlForm] = None + formBody: Option[org.http4s.UrlForm] = None, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity )(handler: org.http4s.Response[F] => F[U] )(implicit encoder: io.circe.Encoder[T]): F[U] = { import org.http4s.QueryParamEncoder._ @@ -3056,9 +3123,7 @@ import io.circe.syntax._ val queryMap = queryParameters.groupBy(_._1).map { case (k, v) => k -> v.map(_._2) } val uri = path.foldLeft(baseUrl){ case (uri, segment) => uri / segment }.setQueryParams(queryMap) - val request = org.http4s.Request[F](method = m, - uri = uri, - headers = headers) + val request = org.http4s.Request[F](method = m, uri = uri, headers = headers) val reqAndMaybeAuth = auth.fold(request) { case Authorization.Basic(username, passwordOpt) => { @@ -3146,7 +3211,8 @@ import io.circe.syntax._ hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Application]] /** @@ -3155,7 +3221,8 @@ import io.circe.syntax._ def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] /** @@ -3165,7 +3232,8 @@ import io.circe.syntax._ orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] /** @@ -3174,7 +3242,8 @@ import io.circe.syntax._ def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] /** @@ -3184,7 +3253,8 @@ import io.circe.syntax._ orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] } @@ -3202,7 +3272,8 @@ import io.circe.syntax._ name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Attribute]] /** @@ -3210,7 +3281,8 @@ import io.circe.syntax._ */ def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Attribute] /** @@ -3218,7 +3290,8 @@ import io.circe.syntax._ */ def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Attribute] /** @@ -3227,7 +3300,8 @@ import io.circe.syntax._ */ def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3243,7 +3317,8 @@ import io.circe.syntax._ applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Change]] } @@ -3261,7 +3336,8 @@ import io.circe.syntax._ applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Code] } @@ -3272,7 +3348,8 @@ import io.circe.syntax._ def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Domain] /** @@ -3281,7 +3358,8 @@ import io.circe.syntax._ def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3291,7 +3369,8 @@ import io.circe.syntax._ */ def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3308,17 +3387,20 @@ import io.circe.syntax._ generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.GeneratorService]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorService] def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorService] /** @@ -3326,7 +3408,8 @@ import io.circe.syntax._ */ def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3350,22 +3433,26 @@ import io.circe.syntax._ key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorWithService] } trait Healthchecks[F[_]] { def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.generator.v0.models.Healthcheck] def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Map[String, String]] } @@ -3379,12 +3466,14 @@ import io.circe.syntax._ q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Item]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Item] } @@ -3402,7 +3491,8 @@ import io.circe.syntax._ role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.MembershipRequest]] /** @@ -3412,7 +3502,8 @@ import io.circe.syntax._ orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.MembershipRequest] /** @@ -3421,7 +3512,8 @@ import io.circe.syntax._ */ def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] /** @@ -3430,7 +3522,8 @@ import io.circe.syntax._ */ def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3448,17 +3541,20 @@ import io.circe.syntax._ role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Membership]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Membership] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3484,7 +3580,8 @@ import io.circe.syntax._ namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Organization]] /** @@ -3492,7 +3589,8 @@ import io.circe.syntax._ */ def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] /** @@ -3500,7 +3598,8 @@ import io.circe.syntax._ */ def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] /** @@ -3509,7 +3608,8 @@ import io.circe.syntax._ def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] /** @@ -3517,7 +3617,8 @@ import io.circe.syntax._ */ def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] /** @@ -3533,7 +3634,8 @@ import io.circe.syntax._ name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.AttributeValue]] /** @@ -3542,7 +3644,8 @@ import io.circe.syntax._ def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.AttributeValue] /** @@ -3552,7 +3655,8 @@ import io.circe.syntax._ key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.AttributeValue] /** @@ -3562,7 +3666,8 @@ import io.circe.syntax._ def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3573,7 +3678,8 @@ import io.circe.syntax._ */ def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3585,7 +3691,8 @@ import io.circe.syntax._ */ def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.PasswordResetSuccess] } @@ -3607,7 +3714,8 @@ import io.circe.syntax._ publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Subscription]] /** @@ -3615,7 +3723,8 @@ import io.circe.syntax._ */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Subscription] /** @@ -3623,12 +3732,14 @@ import io.circe.syntax._ */ def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Subscription] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3642,7 +3753,8 @@ import io.circe.syntax._ guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Token]] /** @@ -3650,7 +3762,8 @@ import io.circe.syntax._ */ def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.CleartextToken] /** @@ -3658,12 +3771,14 @@ import io.circe.syntax._ */ def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Token] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3680,7 +3795,8 @@ import io.circe.syntax._ guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.User]] /** @@ -3688,7 +3804,8 @@ import io.circe.syntax._ */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] /** @@ -3699,7 +3816,8 @@ import io.circe.syntax._ def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] /** @@ -3707,7 +3825,8 @@ import io.circe.syntax._ */ def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] /** @@ -3716,14 +3835,16 @@ import io.circe.syntax._ def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] } trait Validations[F[_]] { def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Validation] } @@ -3741,7 +3862,8 @@ import io.circe.syntax._ applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Version]] /** @@ -3754,7 +3876,8 @@ import io.circe.syntax._ orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] /** @@ -3764,7 +3887,8 @@ import io.circe.syntax._ orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] /** @@ -3775,7 +3899,8 @@ import io.circe.syntax._ applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] /** @@ -3785,7 +3910,8 @@ import io.circe.syntax._ orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -3807,7 +3933,8 @@ import io.circe.syntax._ applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Watch]] /** @@ -3815,7 +3942,8 @@ import io.circe.syntax._ */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Watch] /** @@ -3828,7 +3956,8 @@ import io.circe.syntax._ userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Boolean] /** @@ -3836,12 +3965,14 @@ import io.circe.syntax._ */ def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Watch] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } diff --git a/lib/src/test/resources/http4s/apidoc-api/020_instant/BryzekApidocApiV0ClientOnly.scala.txt b/lib/src/test/resources/http4s/apidoc-api/020_instant/BryzekApidocApiV0ClientOnly.scala.txt index 9c96ea857..80cf9cef6 100644 --- a/lib/src/test/resources/http4s/apidoc-api/020_instant/BryzekApidocApiV0ClientOnly.scala.txt +++ b/lib/src/test/resources/http4s/apidoc-api/020_instant/BryzekApidocApiV0ClientOnly.scala.txt @@ -81,7 +81,8 @@ import io.circe.syntax._ hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Application]] = { val urlPath = Seq(orgKey) @@ -94,7 +95,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Application]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Application]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Application]]("Seq[io.apibuilder.api.v0.models.Application]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -103,13 +104,14 @@ import io.circe.syntax._ override def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey) val (payload, formPayload) = (Some(applicationForm), None) - _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -120,13 +122,14 @@ import io.circe.syntax._ orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey, applicationKey) val (payload, formPayload) = (Some(applicationForm), None) - _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.ApplicationForm, io.apibuilder.api.v0.models.Application]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -136,11 +139,12 @@ import io.circe.syntax._ override def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq(orgKey, applicationKey) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -150,13 +154,14 @@ import io.circe.syntax._ orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] = { val urlPath = Seq(orgKey, applicationKey, "move") val (payload, formPayload) = (Some(moveForm), None) - _executeRequest[io.apibuilder.api.v0.models.MoveForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.MoveForm, io.apibuilder.api.v0.models.Application]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Application]("io.apibuilder.api.v0.models.Application", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -170,7 +175,8 @@ import io.circe.syntax._ name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Attribute]] = { val urlPath = Seq("attributes") @@ -181,7 +187,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Attribute]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Attribute]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Attribute]]("Seq[io.apibuilder.api.v0.models.Attribute]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -189,11 +195,12 @@ import io.circe.syntax._ override def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Attribute] = { val urlPath = Seq("attributes", name) - _executeRequest[Unit, io.apibuilder.api.v0.models.Attribute]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Attribute]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Attribute]("io.apibuilder.api.v0.models.Attribute", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -202,13 +209,14 @@ import io.circe.syntax._ override def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Attribute] = { val urlPath = Seq("attributes") val (payload, formPayload) = (Some(attributeForm), None) - _executeRequest[io.apibuilder.api.v0.models.AttributeForm, io.apibuilder.api.v0.models.Attribute]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.AttributeForm, io.apibuilder.api.v0.models.Attribute]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Attribute]("io.apibuilder.api.v0.models.Attribute", r) case r if r.status.code == 401 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) @@ -218,11 +226,12 @@ import io.circe.syntax._ override def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("attributes", name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 401 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -237,7 +246,8 @@ import io.circe.syntax._ applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Change]] = { val urlPath = Seq("changes") @@ -248,7 +258,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Change]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Change]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Change]]("Seq[io.apibuilder.api.v0.models.Change]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -261,11 +271,12 @@ import io.circe.syntax._ applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Code] = { val urlPath = Seq(orgKey, applicationKey, version, generatorKey) - _executeRequest[Unit, io.apibuilder.api.v0.models.Code]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Code]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Code]("io.apibuilder.api.v0.models.Code", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) @@ -278,13 +289,14 @@ import io.circe.syntax._ override def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Domain] = { val urlPath = Seq("domains", orgKey) val (payload, formPayload) = (Some(domain), None) - _executeRequest[io.apibuilder.api.v0.models.Domain, io.apibuilder.api.v0.models.Domain]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.Domain, io.apibuilder.api.v0.models.Domain]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Domain]("io.apibuilder.api.v0.models.Domain", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -294,11 +306,12 @@ import io.circe.syntax._ override def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("domains", orgKey, name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -308,13 +321,14 @@ import io.circe.syntax._ object EmailVerificationConfirmationForms extends EmailVerificationConfirmationForms[F] { override def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("email_verification_confirmations") val (payload, formPayload) = (Some(emailVerificationConfirmationForm), None) - _executeRequest[io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -329,7 +343,8 @@ import io.circe.syntax._ generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.GeneratorService]] = { val urlPath = Seq("generator_services") @@ -341,7 +356,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.GeneratorService]]("Seq[io.apibuilder.api.v0.models.GeneratorService]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -349,11 +364,12 @@ import io.circe.syntax._ override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorService] = { val urlPath = Seq("generator_services", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorService]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorService]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.GeneratorService]("io.apibuilder.api.v0.models.GeneratorService", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -362,13 +378,14 @@ import io.circe.syntax._ override def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorService] = { val urlPath = Seq("generator_services") val (payload, formPayload) = (Some(generatorServiceForm), None) - _executeRequest[io.apibuilder.api.v0.models.GeneratorServiceForm, io.apibuilder.api.v0.models.GeneratorService]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.GeneratorServiceForm, io.apibuilder.api.v0.models.GeneratorService]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.GeneratorService]("io.apibuilder.api.v0.models.GeneratorService", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -377,11 +394,12 @@ import io.circe.syntax._ override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("generator_services", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 403 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -399,7 +417,8 @@ import io.circe.syntax._ key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] = { val urlPath = Seq("generators") @@ -413,7 +432,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.GeneratorWithService]]("Seq[io.apibuilder.api.v0.models.GeneratorWithService]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -421,11 +440,12 @@ import io.circe.syntax._ override def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorWithService] = { val urlPath = Seq("generators", key) - _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorWithService]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.GeneratorWithService]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.GeneratorWithService]("io.apibuilder.api.v0.models.GeneratorWithService", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -435,22 +455,24 @@ import io.circe.syntax._ object Healthchecks extends Healthchecks[F] { override def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.generator.v0.models.Healthcheck] = { val urlPath = Seq("_internal_", "healthcheck") - _executeRequest[Unit, io.apibuilder.generator.v0.models.Healthcheck]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.generator.v0.models.Healthcheck]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.generator.v0.models.Healthcheck]("io.apibuilder.generator.v0.models.Healthcheck", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } } override def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Map[String, String]] = { val urlPath = Seq("_internal_", "migrate") - _executeRequest[Unit, Map[String, String]]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Map[String, String]]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Map[String, String]]("Map[String, String]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -462,7 +484,8 @@ import io.circe.syntax._ q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Item]] = { val urlPath = Seq("items") @@ -472,7 +495,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Item]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Item]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Item]]("Seq[io.apibuilder.api.v0.models.Item]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -480,11 +503,12 @@ import io.circe.syntax._ override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Item] = { val urlPath = Seq("items", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Item]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Item]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Item]("io.apibuilder.api.v0.models.Item", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -500,7 +524,8 @@ import io.circe.syntax._ role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.MembershipRequest]] = { val urlPath = Seq("membership_requests") @@ -513,7 +538,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.MembershipRequest]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.MembershipRequest]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.MembershipRequest]]("Seq[io.apibuilder.api.v0.models.MembershipRequest]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -523,7 +548,8 @@ import io.circe.syntax._ orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.MembershipRequest] = { val urlPath = Seq("membership_requests") @@ -534,7 +560,7 @@ import io.circe.syntax._ "role" -> role )) - _executeRequest[Unit, io.apibuilder.api.v0.models.MembershipRequest]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.MembershipRequest]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.MembershipRequest]("io.apibuilder.api.v0.models.MembershipRequest", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -543,11 +569,12 @@ import io.circe.syntax._ override def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("membership_requests", guid.toString, "accept") - _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -556,11 +583,12 @@ import io.circe.syntax._ override def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("membership_requests", guid.toString, "decline") - _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("POST", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -576,7 +604,8 @@ import io.circe.syntax._ role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Membership]] = { val urlPath = Seq("memberships") @@ -589,7 +618,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Membership]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Membership]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Membership]]("Seq[io.apibuilder.api.v0.models.Membership]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -597,11 +626,12 @@ import io.circe.syntax._ override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Membership] = { val urlPath = Seq("memberships", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Membership]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Membership]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Membership]("io.apibuilder.api.v0.models.Membership", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -610,11 +640,12 @@ import io.circe.syntax._ override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("memberships", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -630,7 +661,8 @@ import io.circe.syntax._ namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Organization]] = { val urlPath = Seq("organizations") @@ -644,7 +676,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Organization]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Organization]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Organization]]("Seq[io.apibuilder.api.v0.models.Organization]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -652,11 +684,12 @@ import io.circe.syntax._ override def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations", key) - _executeRequest[Unit, io.apibuilder.api.v0.models.Organization]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Organization]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -665,13 +698,14 @@ import io.circe.syntax._ override def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations") val (payload, formPayload) = (Some(organizationForm), None) - _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -681,13 +715,14 @@ import io.circe.syntax._ override def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] = { val urlPath = Seq("organizations", key) val (payload, formPayload) = (Some(organizationForm), None) - _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.OrganizationForm, io.apibuilder.api.v0.models.Organization]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Organization]("io.apibuilder.api.v0.models.Organization", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -696,11 +731,12 @@ import io.circe.syntax._ override def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("organizations", key) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -711,7 +747,8 @@ import io.circe.syntax._ name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.AttributeValue]] = { val urlPath = Seq("organizations", key, "attributes") @@ -721,7 +758,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.AttributeValue]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.AttributeValue]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.AttributeValue]]("Seq[io.apibuilder.api.v0.models.AttributeValue]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -730,11 +767,12 @@ import io.circe.syntax._ override def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.AttributeValue] = { val urlPath = Seq("organizations", key, "attributes", name) - _executeRequest[Unit, io.apibuilder.api.v0.models.AttributeValue]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.AttributeValue]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -745,13 +783,14 @@ import io.circe.syntax._ key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.AttributeValue] = { val urlPath = Seq("organizations", key, "attributes", name) val (payload, formPayload) = (Some(attributeValueForm), None) - _executeRequest[io.apibuilder.api.v0.models.AttributeValueForm, io.apibuilder.api.v0.models.AttributeValue]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.AttributeValueForm, io.apibuilder.api.v0.models.AttributeValue]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.AttributeValue]("io.apibuilder.api.v0.models.AttributeValue", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -763,11 +802,12 @@ import io.circe.syntax._ override def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("organizations", key, "attributes", name) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 401 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) @@ -779,13 +819,14 @@ import io.circe.syntax._ object PasswordResetRequests extends PasswordResetRequests[F] { override def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("password_reset_requests") val (payload, formPayload) = (Some(passwordResetRequest), None) - _executeRequest[io.apibuilder.api.v0.models.PasswordResetRequest, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.PasswordResetRequest, Unit]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204, 409")) @@ -796,13 +837,14 @@ import io.circe.syntax._ object PasswordResets extends PasswordResets[F] { override def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.PasswordResetSuccess] = { val urlPath = Seq("password_resets") val (payload, formPayload) = (Some(passwordReset), None) - _executeRequest[io.apibuilder.api.v0.models.PasswordReset, io.apibuilder.api.v0.models.PasswordResetSuccess]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.PasswordReset, io.apibuilder.api.v0.models.PasswordResetSuccess]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.PasswordResetSuccess]("io.apibuilder.api.v0.models.PasswordResetSuccess", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -818,7 +860,8 @@ import io.circe.syntax._ publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Subscription]] = { val urlPath = Seq("subscriptions") @@ -831,7 +874,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Subscription]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Subscription]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Subscription]]("Seq[io.apibuilder.api.v0.models.Subscription]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -839,11 +882,12 @@ import io.circe.syntax._ override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Subscription] = { val urlPath = Seq("subscriptions", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Subscription]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Subscription]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Subscription]("io.apibuilder.api.v0.models.Subscription", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -852,13 +896,14 @@ import io.circe.syntax._ override def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Subscription] = { val urlPath = Seq("subscriptions") val (payload, formPayload) = (Some(subscriptionForm), None) - _executeRequest[io.apibuilder.api.v0.models.SubscriptionForm, io.apibuilder.api.v0.models.Subscription]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.SubscriptionForm, io.apibuilder.api.v0.models.Subscription]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Subscription]("io.apibuilder.api.v0.models.Subscription", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -867,11 +912,12 @@ import io.circe.syntax._ override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("subscriptions", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -884,7 +930,8 @@ import io.circe.syntax._ guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Token]] = { val urlPath = Seq("tokens", "users", userGuid.toString) @@ -894,7 +941,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Token]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Token]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Token]]("Seq[io.apibuilder.api.v0.models.Token]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -902,11 +949,12 @@ import io.circe.syntax._ override def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.CleartextToken] = { val urlPath = Seq("tokens", guid.toString, "cleartext") - _executeRequest[Unit, io.apibuilder.api.v0.models.CleartextToken]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.CleartextToken]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.CleartextToken]("io.apibuilder.api.v0.models.CleartextToken", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -915,13 +963,14 @@ import io.circe.syntax._ override def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Token] = { val urlPath = Seq("tokens") val (payload, formPayload) = (Some(tokenForm), None) - _executeRequest[io.apibuilder.api.v0.models.TokenForm, io.apibuilder.api.v0.models.Token]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.TokenForm, io.apibuilder.api.v0.models.Token]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Token]("io.apibuilder.api.v0.models.Token", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -930,11 +979,12 @@ import io.circe.syntax._ override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("tokens", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -946,7 +996,8 @@ import io.circe.syntax._ guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.User]] = { val urlPath = Seq("users") @@ -956,7 +1007,7 @@ import io.circe.syntax._ token.map("token" -> _) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.User]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.User]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.User]]("Seq[io.apibuilder.api.v0.models.User]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -964,11 +1015,12 @@ import io.circe.syntax._ override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.User]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.User]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -978,7 +1030,8 @@ import io.circe.syntax._ override def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", "authenticate") @@ -988,7 +1041,7 @@ import io.circe.syntax._ "password" -> password )) - _executeRequest[Unit, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -997,13 +1050,14 @@ import io.circe.syntax._ override def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users") val (payload, formPayload) = (Some(userForm), None) - _executeRequest[io.apibuilder.api.v0.models.UserForm, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.UserForm, io.apibuilder.api.v0.models.User]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1013,13 +1067,14 @@ import io.circe.syntax._ override def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = { val urlPath = Seq("users", guid.toString) val (payload, formPayload) = (Some(userUpdateForm), None) - _executeRequest[io.apibuilder.api.v0.models.UserUpdateForm, io.apibuilder.api.v0.models.User]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.UserUpdateForm, io.apibuilder.api.v0.models.User]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.User]("io.apibuilder.api.v0.models.User", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1030,13 +1085,14 @@ import io.circe.syntax._ object Validations extends Validations[F] { override def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Validation] = { val urlPath = Seq("validations") val (payload, formPayload) = (Some(value), None) - _executeRequest[String, io.apibuilder.api.v0.models.Validation]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[String, io.apibuilder.api.v0.models.Validation]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Validation]("io.apibuilder.api.v0.models.Validation", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1049,7 +1105,8 @@ import io.circe.syntax._ applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Version]] = { val urlPath = Seq(orgKey, applicationKey) @@ -1058,7 +1115,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Version]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Version]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Version]]("Seq[io.apibuilder.api.v0.models.Version]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1068,11 +1125,12 @@ import io.circe.syntax._ orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, applicationKey, version) - _executeRequest[Unit, io.apibuilder.api.v0.models.Version]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Version]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -1083,13 +1141,14 @@ import io.circe.syntax._ orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, version) val (payload, formPayload) = (Some(versionForm), None) - _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1101,13 +1160,14 @@ import io.circe.syntax._ applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] = { val urlPath = Seq(orgKey, applicationKey, version) val (payload, formPayload) = (Some(versionForm), None) - _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.VersionForm, io.apibuilder.api.v0.models.Version]("PUT", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Version]("io.apibuilder.api.v0.models.Version", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 409")) @@ -1118,11 +1178,12 @@ import io.circe.syntax._ orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq(orgKey, applicationKey, version) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -1137,7 +1198,8 @@ import io.circe.syntax._ applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Watch]] = { val urlPath = Seq("watches") @@ -1150,7 +1212,7 @@ import io.circe.syntax._ Some("offset" -> offset.toString) ).flatten - _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Watch]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Seq[io.apibuilder.api.v0.models.Watch]]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Watch]]("Seq[io.apibuilder.api.v0.models.Watch]", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1158,11 +1220,12 @@ import io.circe.syntax._ override def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Watch] = { val urlPath = Seq("watches", guid.toString) - _executeRequest[Unit, io.apibuilder.api.v0.models.Watch]("GET", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, io.apibuilder.api.v0.models.Watch]("GET", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Watch]("io.apibuilder.api.v0.models.Watch", r) case r if r.status.code == 404 => Sync[F].raiseError(new io.apibuilder.api.v0.errors.UnitResponse(r.status.code)) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200, 404")) @@ -1173,7 +1236,8 @@ import io.circe.syntax._ userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Boolean] = { val urlPath = Seq("watches", "check") @@ -1183,7 +1247,7 @@ import io.circe.syntax._ Some("application_key" -> applicationKey) ).flatten - _executeRequest[Unit, Boolean]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[Unit, Boolean]("GET", path = urlPath, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Boolean]("Boolean", r) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -1191,13 +1255,14 @@ import io.circe.syntax._ override def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Watch] = { val urlPath = Seq("watches") val (payload, formPayload) = (Some(watchForm), None) - _executeRequest[io.apibuilder.api.v0.models.WatchForm, io.apibuilder.api.v0.models.Watch]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders) { + _executeRequest[io.apibuilder.api.v0.models.WatchForm, io.apibuilder.api.v0.models.Watch]("POST", path = urlPath, body = payload, formBody = formPayload, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 201 => _root_.io.apibuilder.api.v0.Client.parseJson[F, io.apibuilder.api.v0.models.Watch]("io.apibuilder.api.v0.models.Watch", r) case r if r.status.code == 409 => _root_.io.apibuilder.api.v0.Client.parseJson[F, Seq[io.apibuilder.api.v0.models.Error]]("Seq[io.apibuilder.api.v0.models.Error]", r).flatMap(body => Sync[F].raiseError(new io.apibuilder.api.v0.errors.ErrorsResponse(r.headers, r.status.code, None, body))) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 201, 409")) @@ -1206,11 +1271,12 @@ import io.circe.syntax._ override def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = { val urlPath = Seq("watches", guid.toString) - _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders) { + _executeRequest[Unit, Unit]("DELETE", path = urlPath, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 204 => Sync[F].pure(()) case r => Sync[F].raiseError(new io.apibuilder.api.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 204")) } @@ -1235,7 +1301,8 @@ import io.circe.syntax._ queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, body: Option[T] = None, - formBody : Option[org.http4s.UrlForm] = None + formBody: Option[org.http4s.UrlForm] = None, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity )(handler: org.http4s.Response[F] => F[U] )(implicit encoder: io.circe.Encoder[T]): F[U] = { import org.http4s.QueryParamEncoder._ @@ -1254,9 +1321,7 @@ import io.circe.syntax._ val queryMap = queryParameters.groupBy(_._1).map { case (k, v) => k -> v.map(_._2) } val uri = path.foldLeft(baseUrl){ case (uri, segment) => uri / segment }.setQueryParams(queryMap) - val request = org.http4s.Request[F](method = m, - uri = uri, - headers = headers) + val request = org.http4s.Request[F](method = m, uri = uri, headers = headers) val reqAndMaybeAuth = auth.fold(request) { case Authorization.Basic(username, passwordOpt) => { @@ -1344,7 +1409,8 @@ import io.circe.syntax._ hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Application]] /** @@ -1353,7 +1419,8 @@ import io.circe.syntax._ def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] /** @@ -1363,7 +1430,8 @@ import io.circe.syntax._ orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] /** @@ -1372,7 +1440,8 @@ import io.circe.syntax._ def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] /** @@ -1382,7 +1451,8 @@ import io.circe.syntax._ orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] } @@ -1400,7 +1470,8 @@ import io.circe.syntax._ name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Attribute]] /** @@ -1408,7 +1479,8 @@ import io.circe.syntax._ */ def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Attribute] /** @@ -1416,7 +1488,8 @@ import io.circe.syntax._ */ def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Attribute] /** @@ -1425,7 +1498,8 @@ import io.circe.syntax._ */ def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -1441,7 +1515,8 @@ import io.circe.syntax._ applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Change]] } @@ -1459,7 +1534,8 @@ import io.circe.syntax._ applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Code] } @@ -1470,7 +1546,8 @@ import io.circe.syntax._ def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Domain] /** @@ -1479,7 +1556,8 @@ import io.circe.syntax._ def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -1489,7 +1567,8 @@ import io.circe.syntax._ */ def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -1506,17 +1585,20 @@ import io.circe.syntax._ generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.GeneratorService]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorService] def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorService] /** @@ -1524,7 +1606,8 @@ import io.circe.syntax._ */ def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -1548,22 +1631,26 @@ import io.circe.syntax._ key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorWithService] } trait Healthchecks[F[_]] { def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.generator.v0.models.Healthcheck] def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Map[String, String]] } @@ -1577,12 +1664,14 @@ import io.circe.syntax._ q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Item]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Item] } @@ -1600,7 +1689,8 @@ import io.circe.syntax._ role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.MembershipRequest]] /** @@ -1610,7 +1700,8 @@ import io.circe.syntax._ orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.MembershipRequest] /** @@ -1619,7 +1710,8 @@ import io.circe.syntax._ */ def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] /** @@ -1628,7 +1720,8 @@ import io.circe.syntax._ */ def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -1646,17 +1739,20 @@ import io.circe.syntax._ role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Membership]] def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Membership] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -1682,7 +1778,8 @@ import io.circe.syntax._ namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Organization]] /** @@ -1690,7 +1787,8 @@ import io.circe.syntax._ */ def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] /** @@ -1698,7 +1796,8 @@ import io.circe.syntax._ */ def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] /** @@ -1707,7 +1806,8 @@ import io.circe.syntax._ def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] /** @@ -1715,7 +1815,8 @@ import io.circe.syntax._ */ def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] /** @@ -1731,7 +1832,8 @@ import io.circe.syntax._ name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.AttributeValue]] /** @@ -1740,7 +1842,8 @@ import io.circe.syntax._ def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.AttributeValue] /** @@ -1750,7 +1853,8 @@ import io.circe.syntax._ key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.AttributeValue] /** @@ -1760,7 +1864,8 @@ import io.circe.syntax._ def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -1771,7 +1876,8 @@ import io.circe.syntax._ */ def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -1783,7 +1889,8 @@ import io.circe.syntax._ */ def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.PasswordResetSuccess] } @@ -1805,7 +1912,8 @@ import io.circe.syntax._ publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Subscription]] /** @@ -1813,7 +1921,8 @@ import io.circe.syntax._ */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Subscription] /** @@ -1821,12 +1930,14 @@ import io.circe.syntax._ */ def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Subscription] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -1840,7 +1951,8 @@ import io.circe.syntax._ guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Token]] /** @@ -1848,7 +1960,8 @@ import io.circe.syntax._ */ def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.CleartextToken] /** @@ -1856,12 +1969,14 @@ import io.circe.syntax._ */ def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Token] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -1878,7 +1993,8 @@ import io.circe.syntax._ guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.User]] /** @@ -1886,7 +2002,8 @@ import io.circe.syntax._ */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] /** @@ -1897,7 +2014,8 @@ import io.circe.syntax._ def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] /** @@ -1905,7 +2023,8 @@ import io.circe.syntax._ */ def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] /** @@ -1914,14 +2033,16 @@ import io.circe.syntax._ def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] } trait Validations[F[_]] { def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Validation] } @@ -1939,7 +2060,8 @@ import io.circe.syntax._ applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Version]] /** @@ -1952,7 +2074,8 @@ import io.circe.syntax._ orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] /** @@ -1962,7 +2085,8 @@ import io.circe.syntax._ orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] /** @@ -1973,7 +2097,8 @@ import io.circe.syntax._ applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] /** @@ -1983,7 +2108,8 @@ import io.circe.syntax._ orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } @@ -2005,7 +2131,8 @@ import io.circe.syntax._ applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Watch]] /** @@ -2013,7 +2140,8 @@ import io.circe.syntax._ */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Watch] /** @@ -2026,7 +2154,8 @@ import io.circe.syntax._ userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Boolean] /** @@ -2034,12 +2163,14 @@ import io.circe.syntax._ */ def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Watch] def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] } diff --git a/lib/src/test/resources/http4s/apidoc-api/020_instant/BryzekApidocApiV0MockClient.scala.txt b/lib/src/test/resources/http4s/apidoc-api/020_instant/BryzekApidocApiV0MockClient.scala.txt index 44b1670df..50cbdb262 100644 --- a/lib/src/test/resources/http4s/apidoc-api/020_instant/BryzekApidocApiV0MockClient.scala.txt +++ b/lib/src/test/resources/http4s/apidoc-api/020_instant/BryzekApidocApiV0MockClient.scala.txt @@ -54,7 +54,8 @@ package io.apibuilder.api.v0.mock { hasVersion: _root_.scala.Option[Boolean] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Application]] = cats.Applicative[F].pure { Nil } @@ -65,7 +66,8 @@ package io.apibuilder.api.v0.mock { def post( orgKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeApplication() } @@ -77,7 +79,8 @@ package io.apibuilder.api.v0.mock { orgKey: String, applicationKey: String, applicationForm: io.apibuilder.api.v0.models.ApplicationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeApplication() } @@ -88,7 +91,8 @@ package io.apibuilder.api.v0.mock { def deleteByApplicationKey( orgKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -100,7 +104,8 @@ package io.apibuilder.api.v0.mock { orgKey: String, applicationKey: String, moveForm: io.apibuilder.api.v0.models.MoveForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Application] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeApplication() } @@ -122,7 +127,8 @@ package io.apibuilder.api.v0.mock { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Attribute]] = cats.Applicative[F].pure { Nil } @@ -132,7 +138,8 @@ package io.apibuilder.api.v0.mock { */ def getByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Attribute] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeAttribute() } @@ -142,7 +149,8 @@ package io.apibuilder.api.v0.mock { */ def post( attributeForm: io.apibuilder.api.v0.models.AttributeForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Attribute] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeAttribute() } @@ -153,7 +161,8 @@ package io.apibuilder.api.v0.mock { */ def deleteByName( name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -173,7 +182,8 @@ package io.apibuilder.api.v0.mock { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Change]] = cats.Applicative[F].pure { Nil } @@ -195,7 +205,8 @@ package io.apibuilder.api.v0.mock { applicationKey: String, version: String, generatorKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Code] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeCode() } @@ -205,13 +216,15 @@ package io.apibuilder.api.v0.mock { class MockHealthchecks[F[_]: cats.Applicative] extends io.apibuilder.api.v0.Healthchecks[F] { def getHealthcheck( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.generator.v0.models.Healthcheck] = cats.Applicative[F].pure { io.apibuilder.generator.v0.mock.Factories.makeHealthcheck() } def getMigrate( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Map[String, String]] = cats.Applicative[F].pure { Map() } @@ -226,7 +239,8 @@ package io.apibuilder.api.v0.mock { def post( orgKey: String, domain: io.apibuilder.api.v0.models.Domain, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Domain] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeDomain() } @@ -237,7 +251,8 @@ package io.apibuilder.api.v0.mock { def deleteByName( orgKey: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -251,7 +266,8 @@ package io.apibuilder.api.v0.mock { */ def post( emailVerificationConfirmationForm: io.apibuilder.api.v0.models.EmailVerificationConfirmationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -272,21 +288,24 @@ package io.apibuilder.api.v0.mock { generatorKey: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.GeneratorService]] = cats.Applicative[F].pure { Nil } def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorService] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeGeneratorService() } def post( generatorServiceForm: io.apibuilder.api.v0.models.GeneratorServiceForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorService] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeGeneratorService() } @@ -296,7 +315,8 @@ package io.apibuilder.api.v0.mock { */ def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -324,14 +344,16 @@ package io.apibuilder.api.v0.mock { key: _root_.scala.Option[String] = None, limit: Long = 100L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.GeneratorWithService]] = cats.Applicative[F].pure { Nil } def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.GeneratorWithService] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeGeneratorWithService() } @@ -349,14 +371,16 @@ package io.apibuilder.api.v0.mock { q: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Item]] = cats.Applicative[F].pure { Nil } def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Item] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeItem() } @@ -378,21 +402,24 @@ package io.apibuilder.api.v0.mock { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Membership]] = cats.Applicative[F].pure { Nil } def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Membership] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeMembership() } def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -414,7 +441,8 @@ package io.apibuilder.api.v0.mock { role: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.MembershipRequest]] = cats.Applicative[F].pure { Nil } @@ -426,7 +454,8 @@ package io.apibuilder.api.v0.mock { orgGuid: _root_.java.util.UUID, userGuid: _root_.java.util.UUID, role: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.MembershipRequest] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeMembershipRequest() } @@ -437,7 +466,8 @@ package io.apibuilder.api.v0.mock { */ def postAcceptByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -448,7 +478,8 @@ package io.apibuilder.api.v0.mock { */ def postDeclineByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -478,7 +509,8 @@ package io.apibuilder.api.v0.mock { namespace: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Organization]] = cats.Applicative[F].pure { Nil } @@ -488,7 +520,8 @@ package io.apibuilder.api.v0.mock { */ def getByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeOrganization() } @@ -498,7 +531,8 @@ package io.apibuilder.api.v0.mock { */ def post( organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeOrganization() } @@ -509,7 +543,8 @@ package io.apibuilder.api.v0.mock { def putByKey( key: String, organizationForm: io.apibuilder.api.v0.models.OrganizationForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Organization] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeOrganization() } @@ -519,7 +554,8 @@ package io.apibuilder.api.v0.mock { */ def deleteByKey( key: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -537,7 +573,8 @@ package io.apibuilder.api.v0.mock { name: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.AttributeValue]] = cats.Applicative[F].pure { Nil } @@ -548,7 +585,8 @@ package io.apibuilder.api.v0.mock { def getAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.AttributeValue] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeAttributeValue() } @@ -560,7 +598,8 @@ package io.apibuilder.api.v0.mock { key: String, name: String, attributeValueForm: io.apibuilder.api.v0.models.AttributeValueForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.AttributeValue] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeAttributeValue() } @@ -572,7 +611,8 @@ package io.apibuilder.api.v0.mock { def deleteAttributesByKeyAndName( key: String, name: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -588,7 +628,8 @@ package io.apibuilder.api.v0.mock { */ def post( passwordReset: io.apibuilder.api.v0.models.PasswordReset, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.PasswordResetSuccess] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makePasswordResetSuccess() } @@ -603,7 +644,8 @@ package io.apibuilder.api.v0.mock { */ def post( passwordResetRequest: io.apibuilder.api.v0.models.PasswordResetRequest, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -629,7 +671,8 @@ package io.apibuilder.api.v0.mock { publication: _root_.scala.Option[io.apibuilder.api.v0.models.Publication] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Subscription]] = cats.Applicative[F].pure { Nil } @@ -639,7 +682,8 @@ package io.apibuilder.api.v0.mock { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Subscription] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeSubscription() } @@ -649,14 +693,16 @@ package io.apibuilder.api.v0.mock { */ def post( subscriptionForm: io.apibuilder.api.v0.models.SubscriptionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Subscription] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeSubscription() } def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -674,7 +720,8 @@ package io.apibuilder.api.v0.mock { guid: _root_.scala.Option[_root_.java.util.UUID] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Token]] = cats.Applicative[F].pure { Nil } @@ -684,7 +731,8 @@ package io.apibuilder.api.v0.mock { */ def getCleartextByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.CleartextToken] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeCleartextToken() } @@ -694,14 +742,16 @@ package io.apibuilder.api.v0.mock { */ def post( tokenForm: io.apibuilder.api.v0.models.TokenForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Token] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeToken() } def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -722,7 +772,8 @@ package io.apibuilder.api.v0.mock { guid: _root_.scala.Option[_root_.java.util.UUID] = None, email: _root_.scala.Option[String] = None, token: _root_.scala.Option[String] = None, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.User]] = cats.Applicative[F].pure { Nil } @@ -732,7 +783,8 @@ package io.apibuilder.api.v0.mock { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeUser() } @@ -745,7 +797,8 @@ package io.apibuilder.api.v0.mock { def postAuthenticate( email: String, password: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeUser() } @@ -755,7 +808,8 @@ package io.apibuilder.api.v0.mock { */ def post( userForm: io.apibuilder.api.v0.models.UserForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeUser() } @@ -766,7 +820,8 @@ package io.apibuilder.api.v0.mock { def putByGuid( guid: _root_.java.util.UUID, userUpdateForm: io.apibuilder.api.v0.models.UserUpdateForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.User] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeUser() } @@ -777,7 +832,8 @@ package io.apibuilder.api.v0.mock { def post( value: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Validation] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeValidation() } @@ -799,7 +855,8 @@ package io.apibuilder.api.v0.mock { applicationKey: String, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Version]] = cats.Applicative[F].pure { Nil } @@ -814,7 +871,8 @@ package io.apibuilder.api.v0.mock { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeVersion() } @@ -826,7 +884,8 @@ package io.apibuilder.api.v0.mock { orgKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeVersion() } @@ -839,7 +898,8 @@ package io.apibuilder.api.v0.mock { applicationKey: String, version: String, versionForm: io.apibuilder.api.v0.models.VersionForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Version] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeVersion() } @@ -851,7 +911,8 @@ package io.apibuilder.api.v0.mock { orgKey: String, applicationKey: String, version: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } @@ -877,7 +938,8 @@ package io.apibuilder.api.v0.mock { applicationKey: _root_.scala.Option[String] = None, limit: Long = 25L, offset: Long = 0L, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Seq[io.apibuilder.api.v0.models.Watch]] = cats.Applicative[F].pure { Nil } @@ -887,7 +949,8 @@ package io.apibuilder.api.v0.mock { */ def getByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Watch] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeWatch() } @@ -902,7 +965,8 @@ package io.apibuilder.api.v0.mock { userGuid: _root_.scala.Option[_root_.java.util.UUID] = None, organizationKey: String, applicationKey: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Boolean] = cats.Applicative[F].pure { true } @@ -912,14 +976,16 @@ package io.apibuilder.api.v0.mock { */ def post( watchForm: io.apibuilder.api.v0.models.WatchForm, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.apibuilder.api.v0.models.Watch] = cats.Applicative[F].pure { io.apibuilder.api.v0.mock.Factories.makeWatch() } def deleteByGuid( guid: _root_.java.util.UUID, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[Unit] = cats.Applicative[F].pure { // unit type } diff --git a/lib/src/test/resources/http4s/date-time/020_instant/ApibuilderTimeTypesV0Client.scala.txt b/lib/src/test/resources/http4s/date-time/020_instant/ApibuilderTimeTypesV0Client.scala.txt index d70c1a793..038a9c333 100644 --- a/lib/src/test/resources/http4s/date-time/020_instant/ApibuilderTimeTypesV0Client.scala.txt +++ b/lib/src/test/resources/http4s/date-time/020_instant/ApibuilderTimeTypesV0Client.scala.txt @@ -196,7 +196,8 @@ import io.circe.syntax._ queryDate: _root_.java.time.LocalDate, queryTime: _root_.java.time.Instant, dateTimeModel: io.gregor.time.types.v0.models.DateTimeModel, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.gregor.time.types.v0.models.DateTimeModel] = { val urlPath = Seq("date_time_models", pathDate.toString, pathTime.toString) @@ -207,7 +208,7 @@ import io.circe.syntax._ Some("query_time" -> queryTime.toString) ).flatten - _executeRequest[io.gregor.time.types.v0.models.DateTimeModel, io.gregor.time.types.v0.models.DateTimeModel]("POST", path = urlPath, body = payload, formBody = formPayload, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[io.gregor.time.types.v0.models.DateTimeModel, io.gregor.time.types.v0.models.DateTimeModel]("POST", path = urlPath, body = payload, formBody = formPayload, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.gregor.time.types.v0.Client.parseJson[F, io.gregor.time.types.v0.models.DateTimeModel]("io.gregor.time.types.v0.models.DateTimeModel", r) case r => Sync[F].raiseError(new io.gregor.time.types.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -232,7 +233,8 @@ import io.circe.syntax._ queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, body: Option[T] = None, - formBody : Option[org.http4s.UrlForm] = None + formBody: Option[org.http4s.UrlForm] = None, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity )(handler: org.http4s.Response[F] => F[U] )(implicit encoder: io.circe.Encoder[T]): F[U] = { import org.http4s.QueryParamEncoder._ @@ -251,9 +253,7 @@ import io.circe.syntax._ val queryMap = queryParameters.groupBy(_._1).map { case (k, v) => k -> v.map(_._2) } val uri = path.foldLeft(baseUrl){ case (uri, segment) => uri / segment }.setQueryParams(queryMap) - val request = org.http4s.Request[F](method = m, - uri = uri, - headers = headers) + val request = org.http4s.Request[F](method = m, uri = uri, headers = headers) val reqAndMaybeAuth = auth.fold(request) { case Authorization.Basic(username, passwordOpt) => { @@ -307,7 +307,8 @@ import io.circe.syntax._ queryDate: _root_.java.time.LocalDate, queryTime: _root_.java.time.Instant, dateTimeModel: io.gregor.time.types.v0.models.DateTimeModel, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.gregor.time.types.v0.models.DateTimeModel] } diff --git a/lib/src/test/resources/http4s/date-time/020_joda/ApibuilderTimeTypesV0Client.scala.txt b/lib/src/test/resources/http4s/date-time/020_joda/ApibuilderTimeTypesV0Client.scala.txt index 1f5f2c373..2e71a475f 100644 --- a/lib/src/test/resources/http4s/date-time/020_joda/ApibuilderTimeTypesV0Client.scala.txt +++ b/lib/src/test/resources/http4s/date-time/020_joda/ApibuilderTimeTypesV0Client.scala.txt @@ -196,7 +196,8 @@ import io.circe.syntax._ queryDate: _root_.org.joda.time.LocalDate, queryTime: _root_.org.joda.time.DateTime, dateTimeModel: io.gregor.time.types.v0.models.DateTimeModel, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.gregor.time.types.v0.models.DateTimeModel] = { val urlPath = Seq("date_time_models", _root_.org.joda.time.format.ISODateTimeFormat.date.print(pathDate), _root_.org.joda.time.format.ISODateTimeFormat.dateTime.print(pathTime)) @@ -207,7 +208,7 @@ import io.circe.syntax._ Some("query_time" -> _root_.org.joda.time.format.ISODateTimeFormat.dateTime.print(queryTime)) ).flatten - _executeRequest[io.gregor.time.types.v0.models.DateTimeModel, io.gregor.time.types.v0.models.DateTimeModel]("POST", path = urlPath, body = payload, formBody = formPayload, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[io.gregor.time.types.v0.models.DateTimeModel, io.gregor.time.types.v0.models.DateTimeModel]("POST", path = urlPath, body = payload, formBody = formPayload, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.gregor.time.types.v0.Client.parseJson[F, io.gregor.time.types.v0.models.DateTimeModel]("io.gregor.time.types.v0.models.DateTimeModel", r) case r => Sync[F].raiseError(new io.gregor.time.types.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -232,7 +233,8 @@ import io.circe.syntax._ queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, body: Option[T] = None, - formBody : Option[org.http4s.UrlForm] = None + formBody: Option[org.http4s.UrlForm] = None, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity )(handler: org.http4s.Response[F] => F[U] )(implicit encoder: io.circe.Encoder[T]): F[U] = { import org.http4s.QueryParamEncoder._ @@ -251,9 +253,7 @@ import io.circe.syntax._ val queryMap = queryParameters.groupBy(_._1).map { case (k, v) => k -> v.map(_._2) } val uri = path.foldLeft(baseUrl){ case (uri, segment) => uri / segment }.setQueryParams(queryMap) - val request = org.http4s.Request[F](method = m, - uri = uri, - headers = headers) + val request = org.http4s.Request[F](method = m, uri = uri, headers = headers) val reqAndMaybeAuth = auth.fold(request) { case Authorization.Basic(username, passwordOpt) => { @@ -307,7 +307,8 @@ import io.circe.syntax._ queryDate: _root_.org.joda.time.LocalDate, queryTime: _root_.org.joda.time.DateTime, dateTimeModel: io.gregor.time.types.v0.models.DateTimeModel, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.gregor.time.types.v0.models.DateTimeModel] } diff --git a/lib/src/test/resources/http4s/date-time/020_offsetdatetime/ApibuilderTimeTypesV0Client.scala.txt b/lib/src/test/resources/http4s/date-time/020_offsetdatetime/ApibuilderTimeTypesV0Client.scala.txt index f17383dc9..7cdf044df 100644 --- a/lib/src/test/resources/http4s/date-time/020_offsetdatetime/ApibuilderTimeTypesV0Client.scala.txt +++ b/lib/src/test/resources/http4s/date-time/020_offsetdatetime/ApibuilderTimeTypesV0Client.scala.txt @@ -196,7 +196,8 @@ import io.circe.syntax._ queryDate: _root_.java.time.LocalDate, queryTime: _root_.java.time.OffsetDateTime, dateTimeModel: io.gregor.time.types.v0.models.DateTimeModel, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.gregor.time.types.v0.models.DateTimeModel] = { val urlPath = Seq("date_time_models", pathDate.toString, pathTime.toString) @@ -207,7 +208,7 @@ import io.circe.syntax._ Some("query_time" -> queryTime.toString) ).flatten - _executeRequest[io.gregor.time.types.v0.models.DateTimeModel, io.gregor.time.types.v0.models.DateTimeModel]("POST", path = urlPath, body = payload, formBody = formPayload, queryParameters = queryParameters, requestHeaders = requestHeaders) { + _executeRequest[io.gregor.time.types.v0.models.DateTimeModel, io.gregor.time.types.v0.models.DateTimeModel]("POST", path = urlPath, body = payload, formBody = formPayload, queryParameters = queryParameters, requestHeaders = requestHeaders, requestModifier = requestModifier) { case r if r.status.code == 200 => _root_.io.gregor.time.types.v0.Client.parseJson[F, io.gregor.time.types.v0.models.DateTimeModel]("io.gregor.time.types.v0.models.DateTimeModel", r) case r => Sync[F].raiseError(new io.gregor.time.types.v0.errors.FailedRequest(r.status.code, s"Unsupported response code[${r.status.code}]. Expected: 200")) } @@ -232,7 +233,8 @@ import io.circe.syntax._ queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, body: Option[T] = None, - formBody : Option[org.http4s.UrlForm] = None + formBody: Option[org.http4s.UrlForm] = None, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity )(handler: org.http4s.Response[F] => F[U] )(implicit encoder: io.circe.Encoder[T]): F[U] = { import org.http4s.QueryParamEncoder._ @@ -251,9 +253,7 @@ import io.circe.syntax._ val queryMap = queryParameters.groupBy(_._1).map { case (k, v) => k -> v.map(_._2) } val uri = path.foldLeft(baseUrl){ case (uri, segment) => uri / segment }.setQueryParams(queryMap) - val request = org.http4s.Request[F](method = m, - uri = uri, - headers = headers) + val request = org.http4s.Request[F](method = m, uri = uri, headers = headers) val reqAndMaybeAuth = auth.fold(request) { case Authorization.Basic(username, passwordOpt) => { @@ -307,7 +307,8 @@ import io.circe.syntax._ queryDate: _root_.java.time.LocalDate, queryTime: _root_.java.time.OffsetDateTime, dateTimeModel: io.gregor.time.types.v0.models.DateTimeModel, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.gregor.time.types.v0.models.DateTimeModel] } diff --git a/lib/src/test/resources/http4s/mock-client/http4s_020_date-time-instant.txt b/lib/src/test/resources/http4s/mock-client/http4s_020_date-time-instant.txt index 8fb06a9ee..c1b10565d 100644 --- a/lib/src/test/resources/http4s/mock-client/http4s_020_date-time-instant.txt +++ b/lib/src/test/resources/http4s/mock-client/http4s_020_date-time-instant.txt @@ -16,7 +16,8 @@ package io.gregor.time.types.v0.mock { queryDate: _root_.java.time.LocalDate, queryTime: _root_.java.time.Instant, dateTimeModel: io.gregor.time.types.v0.models.DateTimeModel, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.gregor.time.types.v0.models.DateTimeModel] = cats.Applicative[F].pure { io.gregor.time.types.v0.mock.Factories.makeDateTimeModel() } diff --git a/lib/src/test/resources/http4s/mock-client/http4s_020_date-time-joda.txt b/lib/src/test/resources/http4s/mock-client/http4s_020_date-time-joda.txt index 152bce776..7ad924336 100644 --- a/lib/src/test/resources/http4s/mock-client/http4s_020_date-time-joda.txt +++ b/lib/src/test/resources/http4s/mock-client/http4s_020_date-time-joda.txt @@ -16,7 +16,8 @@ package io.gregor.time.types.v0.mock { queryDate: _root_.org.joda.time.LocalDate, queryTime: _root_.org.joda.time.DateTime, dateTimeModel: io.gregor.time.types.v0.models.DateTimeModel, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.gregor.time.types.v0.models.DateTimeModel] = cats.Applicative[F].pure { io.gregor.time.types.v0.mock.Factories.makeDateTimeModel() } diff --git a/lib/src/test/resources/http4s/mock-client/http4s_020_date-time-offsetdatetime.txt b/lib/src/test/resources/http4s/mock-client/http4s_020_date-time-offsetdatetime.txt index 9bd5dad99..c3c71fb5e 100644 --- a/lib/src/test/resources/http4s/mock-client/http4s_020_date-time-offsetdatetime.txt +++ b/lib/src/test/resources/http4s/mock-client/http4s_020_date-time-offsetdatetime.txt @@ -16,7 +16,8 @@ package io.gregor.time.types.v0.mock { queryDate: _root_.java.time.LocalDate, queryTime: _root_.java.time.OffsetDateTime, dateTimeModel: io.gregor.time.types.v0.models.DateTimeModel, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: org.http4s.Request[F] => org.http4s.Request[F] = identity ): F[io.gregor.time.types.v0.models.DateTimeModel] = cats.Applicative[F].pure { io.gregor.time.types.v0.mock.Factories.makeDateTimeModel() } diff --git a/lib/src/test/resources/play2/mock-client/play27_date-time-instant.txt b/lib/src/test/resources/play2/mock-client/play27_date-time-instant.txt index 2f3f94a50..a78d589f7 100644 --- a/lib/src/test/resources/play2/mock-client/play27_date-time-instant.txt +++ b/lib/src/test/resources/play2/mock-client/play27_date-time-instant.txt @@ -18,7 +18,8 @@ package io.gregor.time.types.v0.mock { queryDate: _root_.java.time.LocalDate, queryTime: _root_.java.time.Instant, dateTimeModel: io.gregor.time.types.v0.models.DateTimeModel, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.gregor.time.types.v0.models.DateTimeModel] = scala.concurrent.Future.successful { io.gregor.time.types.v0.mock.Factories.makeDateTimeModel() } diff --git a/lib/src/test/resources/play2/mock-client/play27_date-time-joda.txt b/lib/src/test/resources/play2/mock-client/play27_date-time-joda.txt index 4c6a09519..7d72c6950 100644 --- a/lib/src/test/resources/play2/mock-client/play27_date-time-joda.txt +++ b/lib/src/test/resources/play2/mock-client/play27_date-time-joda.txt @@ -18,7 +18,8 @@ package io.gregor.time.types.v0.mock { queryDate: _root_.org.joda.time.LocalDate, queryTime: _root_.org.joda.time.DateTime, dateTimeModel: io.gregor.time.types.v0.models.DateTimeModel, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.gregor.time.types.v0.models.DateTimeModel] = scala.concurrent.Future.successful { io.gregor.time.types.v0.mock.Factories.makeDateTimeModel() } diff --git a/lib/src/test/resources/play2/mock-client/play27_date-time-offsetdatetime.txt b/lib/src/test/resources/play2/mock-client/play27_date-time-offsetdatetime.txt index 408928538..d8eefc43d 100644 --- a/lib/src/test/resources/play2/mock-client/play27_date-time-offsetdatetime.txt +++ b/lib/src/test/resources/play2/mock-client/play27_date-time-offsetdatetime.txt @@ -18,7 +18,8 @@ package io.gregor.time.types.v0.mock { queryDate: _root_.java.time.LocalDate, queryTime: _root_.java.time.OffsetDateTime, dateTimeModel: io.gregor.time.types.v0.models.DateTimeModel, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.gregor.time.types.v0.models.DateTimeModel] = scala.concurrent.Future.successful { io.gregor.time.types.v0.mock.Factories.makeDateTimeModel() } diff --git a/lib/src/test/resources/union-types-discriminator-service-play-24.txt b/lib/src/test/resources/union-types-discriminator-service-play-24.txt index 709a8d18f..3f75083db 100644 --- a/lib/src/test/resources/union-types-discriminator-service-play-24.txt +++ b/lib/src/test/resources/union-types-discriminator-service-play-24.txt @@ -373,9 +373,10 @@ package io.apibuilder.example.union.types.discriminator.v0 { object Users extends Users { override def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.example.union.types.discriminator.v0.models.User]] = { - _executeRequest("GET", s"/users", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/users", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.example.union.types.discriminator.v0.Client.parseJson("Seq[io.apibuilder.example.union.types.discriminator.v0.models.User]", r, _.validate[Seq[io.apibuilder.example.union.types.discriminator.v0.models.User]]) case r => throw io.apibuilder.example.union.types.discriminator.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200") } @@ -383,9 +384,10 @@ package io.apibuilder.example.union.types.discriminator.v0 { override def getById( id: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.example.union.types.discriminator.v0.models.User] = { - _executeRequest("GET", s"/users/${play.utils.UriEncoding.encodePathSegment(id, "UTF-8")}", requestHeaders = requestHeaders).map { + _executeRequest("GET", s"/users/${play.utils.UriEncoding.encodePathSegment(id, "UTF-8")}", requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 200 => _root_.io.apibuilder.example.union.types.discriminator.v0.Client.parseJson("io.apibuilder.example.union.types.discriminator.v0.models.User", r, _.validate[io.apibuilder.example.union.types.discriminator.v0.models.User]) case r if r.status == 404 => throw io.apibuilder.example.union.types.discriminator.v0.errors.UnitResponse(r.status) case r => throw io.apibuilder.example.union.types.discriminator.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 200, 404") @@ -394,11 +396,12 @@ package io.apibuilder.example.union.types.discriminator.v0 { override def post( user: io.apibuilder.example.union.types.discriminator.v0.models.User, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.example.union.types.discriminator.v0.models.User] = { val payload = play.api.libs.json.Json.toJson(user) - _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders).map { + _executeRequest("POST", s"/users", body = Some(payload), requestHeaders = requestHeaders, requestModifier = requestModifier).map { case r if r.status == 201 => _root_.io.apibuilder.example.union.types.discriminator.v0.Client.parseJson("io.apibuilder.example.union.types.discriminator.v0.models.User", r, _.validate[io.apibuilder.example.union.types.discriminator.v0.models.User]) case r => throw io.apibuilder.example.union.types.discriminator.v0.errors.FailedRequest(r.status, s"Unsupported response code[${r.status}]. Expected: 201") } @@ -438,32 +441,41 @@ package io.apibuilder.example.union.types.discriminator.v0 { path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity ): scala.concurrent.Future[play.api.libs.ws.WSResponse] = { method.toUpperCase match { case "GET" => { - _logRequest("GET", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).get() + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("GET", request).get() } case "POST" => { - _logRequest("POST", _requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)).post(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)) + _logRequest("POST", request).post(body.getOrElse(play.api.libs.json.Json.obj())) } case "PUT" => { - _logRequest("PUT", _requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)).put(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(_withJsonContentType(requestHeaders):_*).withQueryString(queryParameters:_*)) + _logRequest("PUT", request).put(body.getOrElse(play.api.libs.json.Json.obj())) } case "PATCH" => { - _logRequest("PATCH", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).patch(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("PATCH", request).patch(body.getOrElse(play.api.libs.json.Json.obj())) } case "DELETE" => { - _logRequest("DELETE", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).delete() + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("DELETE", request).delete() } - case "HEAD" => { - _logRequest("HEAD", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).head() + case "HEAD" => { + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("HEAD", request).head() } - case "OPTIONS" => { - _logRequest("OPTIONS", _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)).options() + case "OPTIONS" => { + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest("OPTIONS", request).options() } case _ => { - _logRequest(method, _requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + val request = requestModifier(_requestHolder(path).withHeaders(requestHeaders:_*).withQueryString(queryParameters:_*)) + _logRequest(method, request) sys.error("Unsupported method[%s]".format(method)) } } @@ -515,17 +527,20 @@ package io.apibuilder.example.union.types.discriminator.v0 { trait Users { def get( - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[Seq[io.apibuilder.example.union.types.discriminator.v0.models.User]] def getById( id: String, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.example.union.types.discriminator.v0.models.User] def post( user: io.apibuilder.example.union.types.discriminator.v0.models.User, - requestHeaders: Seq[(String, String)] = Nil + requestHeaders: Seq[(String, String)] = Nil, + requestModifier: play.api.libs.ws.WSRequest => play.api.libs.ws.WSRequest = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[io.apibuilder.example.union.types.discriminator.v0.models.User] } diff --git a/scala-generator/src/main/scala/models/Play2ClientGenerator.scala b/scala-generator/src/main/scala/models/Play2ClientGenerator.scala index 9d06fbac7..98b271cf1 100644 --- a/scala-generator/src/main/scala/models/Play2ClientGenerator.scala +++ b/scala-generator/src/main/scala/models/Play2ClientGenerator.scala @@ -10,7 +10,6 @@ import generator.ServiceFileNames case class PlayFrameworkVersion( name: String, config: ScalaClientMethodConfig, - requestHolderClass: String, authSchemeClass: String, supportsHttpPatch: Boolean, useSpecificAddMethods: Boolean, @@ -21,7 +20,6 @@ object Play22ClientGenerator extends CodeGenerator { def config(form: InvocationForm) = PlayFrameworkVersion( name = "2.2.x", config = ScalaClientMethodConfigs.Play22(Namespaces.quote(form.service.namespace), Attributes.PlayDefaultConfig.withAttributes(form.attributes), form.service.baseUrl), - requestHolderClass = "play.api.libs.ws.WS.WSRequestHolder", authSchemeClass = "com.ning.http.client.Realm.AuthScheme", supportsHttpPatch = false, useSpecificAddMethods = false, @@ -37,7 +35,6 @@ object Play23ClientGenerator extends CodeGenerator { def config(form: InvocationForm) = PlayFrameworkVersion( name = "2.3.x", config = ScalaClientMethodConfigs.Play23(Namespaces.quote(form.service.namespace), Attributes.PlayDefaultConfig.withAttributes(form.attributes), form.service.baseUrl), - requestHolderClass = "play.api.libs.ws.WSRequestHolder", authSchemeClass = "play.api.libs.ws.WSAuthScheme", supportsHttpPatch = true, useSpecificAddMethods = false, @@ -53,7 +50,6 @@ object Play24ClientGenerator extends CodeGenerator { def config(form: InvocationForm) = PlayFrameworkVersion( name = "2.4.x", config = ScalaClientMethodConfigs.Play24(Namespaces.quote(form.service.namespace), Attributes.PlayDefaultConfig.withAttributes(form.attributes),form.service.baseUrl), - requestHolderClass = "play.api.libs.ws.WSRequest", authSchemeClass = "play.api.libs.ws.WSAuthScheme", supportsHttpPatch = true, useSpecificAddMethods = false, @@ -69,7 +65,6 @@ object Play25ClientGenerator extends CodeGenerator { def config(form: InvocationForm) = PlayFrameworkVersion( name = "2.5.x", config = ScalaClientMethodConfigs.Play25(Namespaces.quote(form.service.namespace), Attributes.PlayDefaultConfig.withAttributes(form.attributes), form.service.baseUrl), - requestHolderClass = "play.api.libs.ws.WSRequest", authSchemeClass = "play.api.libs.ws.WSAuthScheme", supportsHttpPatch = true, useSpecificAddMethods = false, @@ -85,7 +80,6 @@ object Play26ClientGenerator extends CodeGenerator { def config(form: InvocationForm) = PlayFrameworkVersion( name = "2.6.x", config = ScalaClientMethodConfigs.Play26(Namespaces.quote(form.service.namespace), Attributes.PlayDefaultConfig.withAttributes(form.attributes), form.service.baseUrl), - requestHolderClass = "play.api.libs.ws.WSRequest", authSchemeClass = "play.api.libs.ws.WSAuthScheme", supportsHttpPatch = true, useSpecificAddMethods = true, @@ -101,7 +95,6 @@ object Play26EnvelopeClientGenerator extends CodeGenerator { def config(form: InvocationForm) = PlayFrameworkVersion( name = "2.6.x", config = ScalaClientMethodConfigs.Play26Envelope(Namespaces.quote(form.service.namespace), Attributes.PlayDefaultConfig.withAttributes(form.attributes), form.service.baseUrl), - requestHolderClass = "play.api.libs.ws.WSRequest", authSchemeClass = "play.api.libs.ws.WSAuthScheme", supportsHttpPatch = true, useSpecificAddMethods = true, @@ -117,7 +110,6 @@ object Play27ClientGenerator extends CodeGenerator { def config(form: InvocationForm) = PlayFrameworkVersion( name = "2.7.x", config = ScalaClientMethodConfigs.Play27(Namespaces.quote(form.service.namespace), Attributes.PlayDefaultConfig.withAttributes(form.attributes), form.service.baseUrl), - requestHolderClass = "play.api.libs.ws.WSRequest", authSchemeClass = "play.api.libs.ws.WSAuthScheme", supportsHttpPatch = true, useSpecificAddMethods = true, @@ -172,7 +164,10 @@ case class Play2ClientGenerator( } val patchMethod = version.supportsHttpPatch match { - case true => s"""_logRequest("PATCH", _requestHolder(path).$addHeadersMethod(requestHeaders:_*).$addQueryStringMethod(queryParameters:_*)).patch(body.getOrElse(play.api.libs.json.Json.obj()))""" + case true => + s"""|val request = requestModifier(_requestHolder(path).$addHeadersMethod(requestHeaders:_*).$addQueryStringMethod(queryParameters:_*)) + |_logRequest("PATCH", request).patch(body.getOrElse(play.api.libs.json.Json.obj())) + |""".stripMargin case false => s"""sys.error("PATCH method is not supported in Play Framework Version ${version.name}")""" } @@ -200,7 +195,7 @@ ${methodGenerator.accessors().indent(4)} ${methodGenerator.objects().indent(4)} - def _requestHolder(path: String): ${version.requestHolderClass} = { + def _requestHolder(path: String): ${version.config.requestBuilderClass} = { ${if (version.config.expectsInjectedWsClient) "" else " import play.api.Play.current\n"} val holder = ${if (version.config.expectsInjectedWsClient) "ws" else "play.api.libs.ws.WS"}.url(baseUrl + path)$headerString auth.fold(holder) { @@ -211,7 +206,7 @@ ${if (version.config.expectsInjectedWsClient) "" else " import play.api.Pla } } - def _logRequest(method: String, req: ${version.requestHolderClass}): ${version.requestHolderClass} = { + def _logRequest(method: String, req: ${version.config.requestBuilderClass}): ${version.config.requestBuilderClass} = { val queryComponents = for { (name, values) <- req.queryString value <- values @@ -228,32 +223,40 @@ ${if (version.config.expectsInjectedWsClient) "" else " import play.api.Pla path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: ${version.config.requestBuilderClass} => ${version.config.requestBuilderClass} = identity ): scala.concurrent.Future[${version.config.responseClass}] = { method.toUpperCase match { case "GET" => { - _logRequest("GET", _requestHolder(path).$addHeadersMethod(requestHeaders:_*).$addQueryStringMethod(queryParameters:_*)).get() + val request = requestModifier(_requestHolder(path).$addHeadersMethod(requestHeaders:_*).$addQueryStringMethod(queryParameters:_*)) + _logRequest("GET", request).get() } case "POST" => { - _logRequest("POST", _requestHolder(path).$addHeadersMethod(_withJsonContentType(requestHeaders):_*).$addQueryStringMethod(queryParameters:_*)).post(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).$addHeadersMethod(_withJsonContentType(requestHeaders):_*).$addQueryStringMethod(queryParameters:_*)) + _logRequest("POST", request).post(body.getOrElse(play.api.libs.json.Json.obj())) } case "PUT" => { - _logRequest("PUT", _requestHolder(path).$addHeadersMethod(_withJsonContentType(requestHeaders):_*).$addQueryStringMethod(queryParameters:_*)).put(body.getOrElse(play.api.libs.json.Json.obj())) + val request = requestModifier(_requestHolder(path).$addHeadersMethod(_withJsonContentType(requestHeaders):_*).$addQueryStringMethod(queryParameters:_*)) + _logRequest("PUT", request).put(body.getOrElse(play.api.libs.json.Json.obj())) } case "PATCH" => { - $patchMethod +${patchMethod.indent(10)} } case "DELETE" => { - _logRequest("DELETE", _requestHolder(path).$addHeadersMethod(requestHeaders:_*).$addQueryStringMethod(queryParameters:_*)).delete() + val request = requestModifier(_requestHolder(path).$addHeadersMethod(requestHeaders:_*).$addQueryStringMethod(queryParameters:_*)) + _logRequest("DELETE", request).delete() } - case "HEAD" => { - _logRequest("HEAD", _requestHolder(path).$addHeadersMethod(requestHeaders:_*).$addQueryStringMethod(queryParameters:_*)).head() + case "HEAD" => { + val request = requestModifier(_requestHolder(path).$addHeadersMethod(requestHeaders:_*).$addQueryStringMethod(queryParameters:_*)) + _logRequest("HEAD", request).head() } - case "OPTIONS" => { - _logRequest("OPTIONS", _requestHolder(path).$addHeadersMethod(requestHeaders:_*).$addQueryStringMethod(queryParameters:_*)).options() + case "OPTIONS" => { + val request = requestModifier(_requestHolder(path).$addHeadersMethod(requestHeaders:_*).$addQueryStringMethod(queryParameters:_*)) + _logRequest("OPTIONS", request).options() } case _ => { - _logRequest(method, _requestHolder(path).$addHeadersMethod(requestHeaders:_*).$addQueryStringMethod(queryParameters:_*)) + val request = requestModifier(_requestHolder(path).$addHeadersMethod(requestHeaders:_*).$addQueryStringMethod(queryParameters:_*)) + _logRequest(method, request) sys.error("Unsupported method[%s]".format(method)) } } diff --git a/scala-generator/src/main/scala/models/generator/ScalaClientMethodConfig.scala b/scala-generator/src/main/scala/models/generator/ScalaClientMethodConfig.scala index bb5ce4087..39b3a8fbd 100644 --- a/scala-generator/src/main/scala/models/generator/ScalaClientMethodConfig.scala +++ b/scala-generator/src/main/scala/models/generator/ScalaClientMethodConfig.scala @@ -44,6 +44,11 @@ trait ScalaClientMethodConfig { */ def responseClass: String + /** + * The class name for building the Request object. + */ + def requestBuilderClass: String + /** Whether or not play.api.libs.ws.WS exists as a static object, or if * play.api.libs.ws.WSClient is expected to be passed in. */ @@ -133,6 +138,7 @@ object ScalaClientMethodConfigs { case class Play22(namespace: String, attributes: Attributes, baseUrl: Option[String]) extends Play { override val responseClass = "play.api.libs.ws.Response" + override val requestBuilderClass = "play.api.libs.ws.WS.WSRequestHolder" override val requestUriMethod = Some("ahcResponse.getUri") override val expectsInjectedWsClient = false override val canSerializeUuid = false @@ -140,6 +146,7 @@ object ScalaClientMethodConfigs { case class Play23(namespace: String, attributes: Attributes, baseUrl: Option[String]) extends Play { override val responseClass = "play.api.libs.ws.WSResponse" + override val requestBuilderClass = "play.api.libs.ws.WSRequestHolder" override val requestUriMethod: Option[String] = None override val expectsInjectedWsClient = false override val canSerializeUuid = true @@ -147,6 +154,7 @@ object ScalaClientMethodConfigs { case class Play24(namespace: String, attributes: Attributes, baseUrl: Option[String]) extends Play { override val responseClass = "play.api.libs.ws.WSResponse" + override val requestBuilderClass = "play.api.libs.ws.WSRequest" override val requestUriMethod: Option[String] = None override val expectsInjectedWsClient = false override val canSerializeUuid = true @@ -154,6 +162,7 @@ object ScalaClientMethodConfigs { case class Play25(namespace: String, attributes: Attributes, baseUrl: Option[String]) extends Play { override val responseClass = "play.api.libs.ws.WSResponse" + override val requestBuilderClass = "play.api.libs.ws.WSRequest" override val requestUriMethod: Option[String] = None override val expectsInjectedWsClient = true override val canSerializeUuid = true @@ -161,6 +170,7 @@ object ScalaClientMethodConfigs { case class Play26(namespace: String, attributes: Attributes, baseUrl: Option[String]) extends Play { override val responseClass = "play.api.libs.ws.WSResponse" + override val requestBuilderClass = "play.api.libs.ws.WSRequest" override val requestUriMethod: Option[String] = None override val expectsInjectedWsClient = true override val canSerializeUuid = true @@ -168,6 +178,7 @@ object ScalaClientMethodConfigs { case class Play26Envelope(namespace: String, attributes: Attributes, baseUrl: Option[String]) extends Play { override val responseClass = "play.api.libs.ws.WSResponse" + override val requestBuilderClass = "play.api.libs.ws.WSRequest" override val requestUriMethod: Option[String] = None override val expectsInjectedWsClient = true override val canSerializeUuid = true @@ -175,6 +186,7 @@ object ScalaClientMethodConfigs { case class Play27(namespace: String, attributes: Attributes, baseUrl: Option[String]) extends Play { override val responseClass = "play.api.libs.ws.WSResponse" + override val requestBuilderClass = "play.api.libs.ws.WSRequest" override val requestUriMethod: Option[String] = None override val expectsInjectedWsClient = true override val canSerializeUuid = true @@ -185,6 +197,7 @@ object ScalaClientMethodConfigs { override val responseStatusMethod = "getStatusCode" override val responseBodyMethod = """getResponseBody("UTF-8")""" override val responseClass = "_root_.com.ning.http.client.Response" + override val requestBuilderClass = "_root_.com.ning.http.client.RequestBuilder" override val extraClientCtorArgs = Some(",\n asyncHttpClient: AsyncHttpClient = Client.defaultAsyncHttpClient") override val extraClientObjectMethods = Some(""" private lazy val defaultAsyncHttpClient = { @@ -239,6 +252,7 @@ private lazy val defaultAsyncHttpClient = { override val responseStatusMethod = "status.code" override val responseBodyMethod = """body""" override val responseClass = "org.http4s.Response" + override val requestBuilderClass: String = "org.http4s.Request" override def extraClientCtorArgs: Option[String] = Some(",\n asyncHttpClient: org.http4s.client.Client = Client.defaultAsyncHttpClient") override val extraClientObjectMethods = Some(""" implicit def circeJsonDecoder[A](implicit decoder: io.circe.Decoder[A]) = org.http4s.circe.jsonOf[A] @@ -258,8 +272,7 @@ private lazy val defaultAsyncHttpClient = PooledHttp1Client() def rightType: String def monadTransformerInvoke: String def asyncFailure: String - def requestClass: String = "org.http4s.Request" - def requestType: String = s"$asyncType[$requestClass]" + def requestType: String = s"$asyncType[$requestBuilderClass]" def messageClass: String = "org.http4s.Message" def httpServiceClass: String = "org.http4s.HttpService" def generateDecodeResult(datatypeName: String): String = s"org.http4s.DecodeResult[$datatypeName]" @@ -278,9 +291,10 @@ private lazy val defaultAsyncHttpClient = PooledHttp1Client() | asyncHttpClient.shutdownNow() |}""".stripMargin) - def reqAndMaybeAuthAndBody: String = s"""val reqAndMaybeAuthAndBody = - | if (formBody.nonEmpty) formBody.fold($asyncSuccessInvoke(reqAndMaybeAuth))(reqAndMaybeAuth.withBody) - | else body.fold($asyncSuccessInvoke(reqAndMaybeAuth))(reqAndMaybeAuth.withBody)""".stripMargin + def reqAndMaybeAuthAndBody: String = s"""val decoratedRequest = requestModifier(reqAndMaybeAuth) + |val reqAndMaybeAuthAndBody = + | if (formBody.nonEmpty) formBody.fold($asyncSuccessInvoke(decoratedRequest))(decoratedRequest.withBody) + | else body.fold($asyncSuccessInvoke(decoratedRequest))(decoratedRequest.withBody)""".stripMargin def matchersImport: String def httpClient: String @@ -323,7 +337,7 @@ private lazy val defaultAsyncHttpClient = PooledHttp1Client() ) override val asyncSuccess: String = "pure" override def asyncFailure: String = "raiseError" - override def requestClass: String = s"org.http4s.Request[$asyncType]" + override val requestBuilderClass: String = s"org.http4s.Request[$asyncType]" override def generateDecodeResult(datatypeName: String): String = s"org.http4s.DecodeResult[$asyncType, $datatypeName]" override def messageClass: String = s"org.http4s.Message[$asyncType]" override def httpServiceClass: String = s"org.http4s.HttpService[$asyncType]" @@ -372,8 +386,8 @@ private lazy val defaultAsyncHttpClient = PooledHttp1Client() ) override val asyncSuccess: String = "pure" override def asyncFailure: String = "raiseError" - override def requestClass: String = s"org.http4s.Request[$asyncType]" - override def requestType: String = requestClass + override val requestBuilderClass: String = s"org.http4s.Request[$asyncType]" + override val requestType: String = requestBuilderClass override def generateDecodeResult(datatypeName: String): String = s"org.http4s.DecodeResult[$asyncType, $datatypeName]" override def messageClass: String = s"org.http4s.Message[$asyncType]" override def httpServiceClass: String = s"org.http4s.HttpRoutes.of[$asyncType]" diff --git a/scala-generator/src/main/scala/models/generator/ScalaClientMethodGenerator.scala b/scala-generator/src/main/scala/models/generator/ScalaClientMethodGenerator.scala index 702724f1b..f3bae0102 100644 --- a/scala-generator/src/main/scala/models/generator/ScalaClientMethodGenerator.scala +++ b/scala-generator/src/main/scala/models/generator/ScalaClientMethodGenerator.scala @@ -183,6 +183,8 @@ class ScalaClientMethodGenerator( args.append("requestHeaders = (requestHeaders ++ headerParameters)") } + args.append("requestModifier = requestModifier") + val methodCall = code.toList match { case Nil => s"""_executeRequest("${op.method}", $path, ${args.mkString(", ")})""" case v => s"""${v.mkString("\n\n")}\n\n_executeRequest("${op.method}", $path, ${args.mkString(", ")})""" @@ -268,11 +270,14 @@ class ScalaClientMethodGenerator( }.mkString("\n") } + hasOptionResult.getOrElse("") + s"\n$defaultResponse\n" + val extraArgs = Seq(s"requestModifier: ${config.requestBuilderClass} => ${config.requestBuilderClass} = identity") + new ScalaClientMethod( operation = op, returnType = s"${config.asyncType}[${withEnvelope(op.resultType, isOption = hasOptionResult.isDefined)}]", methodCall = methodCall, response = matchResponse, + extraArgs = extraArgs, implicitArgs = config.implicitArgs, responseEnvelopeName = config.responseEnvelopeClassName, ) @@ -305,15 +310,16 @@ class ScalaClientMethod( returnType: String, methodCall: String, response: String, + extraArgs: Seq[String], implicitArgs: Option[String], responseEnvelopeName: Option[String], ) { - val name: String = operation.name + protected val name: String = operation.name - val argList: Option[String] = operation.parameters.find(_.name.toLowerCase == "requestheaders") match { - case Some(_) => operation.argList() - case None => operation.argList(Seq("requestHeaders: Seq[(String, String)] = Nil")) + protected val argList: Option[String] = operation.parameters.find(_.name.toLowerCase == "requestheaders") match { + case Some(_) => operation.argList(extraArgs) + case None => operation.argList(Seq("requestHeaders: Seq[(String, String)] = Nil") ++ extraArgs) } protected[this] val commentString: Option[String] = toOption( diff --git a/scala-generator/src/main/scala/models/http4s/Http4sClient.scala b/scala-generator/src/main/scala/models/http4s/Http4sClient.scala index 0364e6b5a..bff15b8f1 100644 --- a/scala-generator/src/main/scala/models/http4s/Http4sClient.scala +++ b/scala-generator/src/main/scala/models/http4s/Http4sClient.scala @@ -51,7 +51,8 @@ ${headerString.indent(6)} queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, body: Option[T] = None, - formBody : Option[org.http4s.UrlForm] = None + formBody: Option[org.http4s.UrlForm] = None, + requestModifier: ${config.requestBuilderClass} => ${config.requestBuilderClass} = identity )(handler: ${config.responseClass} => ${config.asyncType}[U] )(implicit encoder: io.circe.Encoder[T]): ${config.asyncType}[U] = { import org.http4s.QueryParamEncoder._ @@ -70,9 +71,7 @@ ${headerString.indent(6)} val queryMap = queryParameters.groupBy(_._1).map { case (k, v) => k -> v.map(_._2) } val uri = path.foldLeft(baseUrl){ case (uri, segment) => uri / segment }.setQueryParams(queryMap) - val request = ${config.requestClass}(method = m, - uri = uri, - headers = headers) + val request = ${config.requestBuilderClass}(method = m, uri = uri, headers = headers) val reqAndMaybeAuth = auth.fold(request) { case Authorization.Basic(username, passwordOpt) => { diff --git a/scala-generator/src/main/scala/models/http4s/ScalaClientMethodGenerator.scala b/scala-generator/src/main/scala/models/http4s/ScalaClientMethodGenerator.scala index 375fe35ee..f7805bbec 100644 --- a/scala-generator/src/main/scala/models/http4s/ScalaClientMethodGenerator.scala +++ b/scala-generator/src/main/scala/models/http4s/ScalaClientMethodGenerator.scala @@ -63,6 +63,8 @@ class ScalaClientMethodGenerator ( args.append("requestHeaders = (requestHeaders ++ headerParameters)") } + args.append("requestModifier = requestModifier") + val reqType = op.body.fold("Unit")(b => b.datatype.name) val hasOptionResult = featureMigration.hasImplicit404s match { @@ -165,11 +167,14 @@ class ScalaClientMethodGenerator ( }.mkString("\n") } + hasOptionResult.getOrElse("") + s"\n$defaultResponse\n" + val extraArgs = Seq(s"requestModifier: ${config.requestBuilderClass} => ${config.requestBuilderClass} = identity") + new ScalaClientMethod( operation = op, returnType = s"${config.asyncType}[$resType]", methodCall = methodCall, response = matchResponse, + extraArgs = extraArgs, implicitArgs = config.implicitArgs, typeParam = config.asyncTypeParam() ) @@ -220,9 +225,10 @@ class ScalaClientMethod( returnType: String, methodCall: String, response: String, + extraArgs: Seq[String], implicitArgs: Option[String], typeParam: Option[String] -) extends scala.generator.ScalaClientMethod(operation, returnType, methodCall, response, implicitArgs, responseEnvelopeName = None) { +) extends scala.generator.ScalaClientMethod(operation, returnType, methodCall, response, extraArgs, implicitArgs, responseEnvelopeName = None) { import lib.Text._ override val interface: String = { diff --git a/scala-generator/src/main/scala/models/http4s/server/Route.scala b/scala-generator/src/main/scala/models/http4s/server/Route.scala index ce71566c3..cb8c85602 100644 --- a/scala-generator/src/main/scala/models/http4s/server/Route.scala +++ b/scala-generator/src/main/scala/models/http4s/server/Route.scala @@ -64,7 +64,7 @@ case class Route(ssd: ScalaService, resource: ScalaResource, op: ScalaOperation, ) val params = - Seq(Some(s"_req: ${config.requestClass}")) ++ + Seq(Some(s"_req: ${config.requestBuilderClass}")) ++ nonHeaderParameters ++ Seq(op.body.map(body => s"body: => ${config.generateDecodeResult(body.datatype.name)}")) diff --git a/scala-generator/src/main/scala/models/ning/NingClientGenerator.scala b/scala-generator/src/main/scala/models/ning/NingClientGenerator.scala index 4135e85c6..79d7c6287 100644 --- a/scala-generator/src/main/scala/models/ning/NingClientGenerator.scala +++ b/scala-generator/src/main/scala/models/ning/NingClientGenerator.scala @@ -99,8 +99,8 @@ ${methodGenerator.objects().indent(4)} } } - def _requestBuilder(method: String, path: String, requestHeaders: Seq[(String, String)]): RequestBuilder = { - val builder = new RequestBuilder(method) + def _requestBuilder(method: String, path: String, requestHeaders: Seq[(String, String)]): ${config.requestBuilderClass} = { + val builder = new ${config.requestBuilderClass}(method) .setUrl(baseUrl + path) ${headerString.indent(8)} @@ -125,7 +125,8 @@ ${config.realmBuilder("username", """passwordOpt.getOrElse("")""").indent(12)} path: String, queryParameters: Seq[(String, String)] = Nil, requestHeaders: Seq[(String, String)] = Nil, - body: Option[play.api.libs.json.JsValue] = None + body: Option[play.api.libs.json.JsValue] = None, + requestModifier: ${config.requestBuilderClass} => ${config.requestBuilderClass} = identity )(implicit ec: scala.concurrent.ExecutionContext): scala.concurrent.Future[${config.ningPackage}.Response] = { val allHeaders = body match { case None => requestHeaders @@ -143,7 +144,7 @@ ${config.realmBuilder("username", """passwordOpt.getOrElse("")""").indent(12)} request.setBody(serialized) } - val finalRequest = requestWithParamsAndBody.build() + val finalRequest = requestModifier(requestWithParamsAndBody).build() _logRequest(finalRequest) val result = scala.concurrent.Promise[${config.ningPackage}.Response]() @@ -177,7 +178,8 @@ ${PlayScalaClientCommon(config).indent(2)} ${methodGenerator.traitsAndErrors().indent(2)} ${PathSegment.definition.indent(2)} -}""" +} +""" } }