WSRequestHelper

io.cequence.openaiscala.service.ws.WSRequestHelper

Base class for web services with handy GET, POST, and DELETE request builders, and response handling

Attributes

Since:

Jan 2023

Graph
Supertypes
trait WSHelper
class Object
trait Matchable
class Any

Members list

Concise view

Type members

Types

protected type PEP
protected type PT
protected type RichJsResponse = Either[JsValue, (Int, String)]
protected type RichStringResponse = Either[String, (Int, String)]

Value members

Concrete methods

protected def createUrl(endpoint: Option[PEP], value: Option[String]): String
protected def execDELETE(endPoint: PEP, endPointParam: Option[String], params: Seq[(PT, Option[Any])]): Future[JsValue]
protected def execDELETEWithStatus(endPoint: PEP, endPointParam: Option[String], params: Seq[(PT, Option[Any])], acceptableStatusCodes: Seq[Int]): Future[RichJsResponse]
protected def execGET(endPoint: PEP, endPointParam: Option[String], params: Seq[(PT, Option[Any])]): Future[JsValue]
protected def execGETJsonAux(request: StandaloneWSRequest, endPointForLogging: Option[PEP], acceptableStatusCodes: Seq[Int]): Future[RichJsResponse]
protected def execGETStringAux(request: StandaloneWSRequest, endPointForLogging: Option[PEP], acceptableStatusCodes: Seq[Int]): Future[RichStringResponse]
protected def execGETWithStatus(endPoint: PEP, endPointParam: Option[String], params: Seq[(PT, Option[Any])], acceptableStatusCodes: Seq[Int]): Future[RichJsResponse]
protected def execPOST(endPoint: PEP, endPointParam: Option[String], params: Seq[(PT, Option[Any])], bodyParams: Seq[(PT, Option[JsValue])]): Future[JsValue]
protected def execPOSTAux[T : BodyWritable](request: StandaloneWSRequest, body: T, endPointForLogging: Option[PEP], acceptableStatusCodes: Seq[Int]): Future[RichJsResponse]
protected def execPOSTMultipart(endPoint: PEP, endPointParam: Option[String], params: Seq[(PT, Option[Any])], fileParams: Seq[(PT, File)], bodyParams: Seq[(PT, Option[Any])]): Future[JsValue]
protected def execPOSTMultipartWithStatus(endPoint: PEP, endPointParam: Option[String], params: Seq[(PT, Option[Any])], fileParams: Seq[(PT, File)], bodyParams: Seq[(PT, Option[Any])], acceptableStatusCodes: Seq[Int]): Future[RichJsResponse]
protected def execPOSTWithStatus(endPoint: PEP, endPointParam: Option[String], params: Seq[(PT, Option[Any])], bodyParams: Seq[(PT, Option[JsValue])], acceptableStatusCodes: Seq[Int]): Future[RichJsResponse]
protected def getWSRequest(endPoint: Option[PEP], endPointParam: Option[String], params: Seq[(PT, Any)]): StandaloneWSRequest
protected def getWSRequestOptional(endPoint: Option[PEP], endPointParam: Option[String], params: Seq[(PT, Option[Any])]): StandaloneWSRequest
protected def handleErrorResponse(response: RichJsResponse): JsValue
protected def handleNotFoundAndError[T](response: Either[T, (Int, String)]): Option[T]
protected def jsonBodyParams(params: (PT, Option[Any])*): Seq[(PT, Option[JsValue])]
protected def paramsAsString(params: Seq[(PT, Any)]): String
protected def paramsOptionalAsString(params: Seq[(PT, Option[Any])]): String
protected def toOptionalParams(params: Seq[(PT, Any)]): Seq[(PT, Some[Any])]

Inherited methods

protected def timeouts: Timeouts

Attributes

Inherited from:
WSHelper

Abstract fields

protected val coreUrl: String

Concrete fields

protected val serviceName: String

Inherited fields

lazy protected val client: StandaloneWSClient

Attributes

Inherited from:
WSHelper

Implicits

Implicits

implicit protected val ec: ExecutionContext

Inherited implicits

implicit protected val materializer: Materializer

Attributes

Inherited from:
WSHelper