WSStreamRequestHelper

io.cequence.wsclient.service.ws.stream.WSStreamRequestHelper
trait WSStreamRequestHelper extends WSRequestHelper

Stream request support specifically tailored for OpenAI API.

Attributes

Since:

Feb 2023

Graph
Supertypes
trait WSRequestHelper
trait HasWSClient
trait CloseableService
class Object
trait Matchable
class Any

Members list

Concise view

Type members

Inherited types

protected type PEP

Attributes

Inherited from:
WSRequestHelperBase (hidden)
protected type PT

Attributes

Inherited from:
WSRequestHelperBase (hidden)
protected type RichJsResponse = RichResponse[JsValue]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
protected type RichResponse[T] = Either[T, (Int, String)]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
protected type RichSourceResponse = RichResponse[Source[ByteString, _]]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
protected type RichStringResponse = RichResponse[String]

Attributes

Inherited from:
WSRequestHelperBase (hidden)

Value members

Concrete methods

protected def execJsonStreamAux(endPoint: PEP, method: String, endPointParam: Option[String], params: Seq[(PT, Option[Any])], bodyParams: Seq[(PT, Option[JsValue])])(implicit materializer: Materializer): Source[JsValue, NotUsed]
protected def execStreamRequestAux[T](endPoint: PEP, method: String, endPointParam: Option[String], params: Seq[(PT, Option[Any])], bodyParams: Seq[(PT, Option[JsValue])], framing: Flow[ByteString, ByteString, NotUsed], recoverBlock: PartialFunction[Throwable, T])(implicit um: Unmarshaller[ByteString, T], materializer: Materializer): Source[T, NotUsed]

Inherited methods

protected def addHeaders(request: StandaloneWSRequest): StandaloneWSRequest

Attributes

Inherited from:
WSRequestHelperBase (hidden)
override def close(): Unit

Closes the underlying ws client, and releases all its resources.

Closes the underlying ws client, and releases all its resources.

Attributes

Definition Classes
HasWSClient -> CloseableService
Inherited from:
HasWSClient
def contentTypeByExtension: FilePart => String

Attributes

Inherited from:
WSRequestHelperBase (hidden)
protected def createUrl(endpoint: Option[PEP], value: Option[String]): String

Attributes

Inherited from:
WSRequestHelperBase (hidden)
def execDELETE(endPoint: PEP, endPointParam: Option[String], params: Seq[(PT, Option[Any])]): Future[JsValue]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
def execDELETEWithStatus(endPoint: PEP, endPointParam: Option[String], params: Seq[(PT, Option[Any])], acceptableStatusCodes: Seq[Int]): Future[RichJsResponse]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
def execGET(endPoint: PEP, endPointParam: Option[String], params: Seq[(PT, Option[Any])]): Future[JsValue]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
def execGETJsonAux(request: StandaloneWSRequest, endPointForLogging: Option[PEP], acceptableStatusCodes: Seq[Int]): Future[RichJsResponse]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
def execGETStringAux(request: StandaloneWSRequest, endPointForLogging: Option[PEP], acceptableStatusCodes: Seq[Int]): Future[RichStringResponse]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
def execGETWithStatus(endPoint: PEP, endPointParam: Option[String], params: Seq[(PT, Option[Any])], acceptableStatusCodes: Seq[Int]): Future[RichJsResponse]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
protected def execPATCH(endPoint: PEP, endPointParam: Option[String], params: Seq[(PT, Option[Any])], bodyParams: Seq[(PT, Option[JsValue])]): Future[JsValue]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
protected def execPATCHJsonAux[T : BodyWritable](request: StandaloneWSRequest, body: T, endPointForLogging: Option[PEP], acceptableStatusCodes: Seq[Int]): Future[RichJsResponse]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
protected def execPATCHStringAux[T : BodyWritable](request: StandaloneWSRequest, body: T, endPointForLogging: Option[PEP], acceptableStatusCodes: Seq[Int]): Future[RichStringResponse]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
protected def execPATCHWithStatus(endPoint: PEP, endPointParam: Option[String], params: Seq[(PT, Option[Any])], bodyParams: Seq[(PT, Option[JsValue])], acceptableStatusCodes: Seq[Int]): Future[RichJsResponse]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
def execPOST(endPoint: PEP, endPointParam: Option[String], params: Seq[(PT, Option[Any])], bodyParams: Seq[(PT, Option[JsValue])]): Future[JsValue]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
def execPOSTJsonAux[T : BodyWritable](request: StandaloneWSRequest, body: T, endPointForLogging: Option[PEP], acceptableStatusCodes: Seq[Int]): Future[RichJsResponse]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
def execPOSTMultipart(endPoint: PEP, endPointParam: Option[String], params: Seq[(PT, Option[Any])], fileParams: Seq[(PT, File, Option[String])], bodyParams: Seq[(PT, Option[Any])]): Future[JsValue]

Attributes

fileParams

the third param in a tuple is a display (header) file name

Inherited from:
WSRequestHelperBase (hidden)
def execPOSTMultipartWithStatus(endPoint: PEP, endPointParam: Option[String], params: Seq[(PT, Option[Any])], fileParams: Seq[(PT, File, Option[String])], bodyParams: Seq[(PT, Option[Any])], acceptableStatusCodes: Seq[Int])(implicit filePartToContent: FilePart => String): Future[RichJsResponse]

Attributes

fileParams

the third param in a tuple is a display (header) file name

Inherited from:
WSRequestHelperBase (hidden)
def execPOSTMultipartWithStatusString(endPoint: PEP, endPointParam: Option[String], params: Seq[(PT, Option[Any])], fileParams: Seq[(PT, File, Option[String])], bodyParams: Seq[(PT, Option[Any])], acceptableStatusCodes: Seq[Int])(implicit filePartToContent: FilePart => String): Future[RichStringResponse]

Attributes

fileParams

the third param in a tuple is a display (header) file name

Inherited from:
WSRequestHelperBase (hidden)
def execPOSTSource(endPoint: PEP, endPointParam: Option[String], params: Seq[(PT, Option[Any])], bodyParams: Seq[(PT, Option[JsValue])]): Future[Source[ByteString, _]]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
def execPOSTSourceAux[T : BodyWritable](request: StandaloneWSRequest, body: T, endPointForLogging: Option[PEP], acceptableStatusCodes: Seq[Int]): Future[RichSourceResponse]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
def execPOSTSourceWithStatus(endPoint: PEP, endPointParam: Option[String], params: Seq[(PT, Option[Any])], bodyParams: Seq[(PT, Option[JsValue])], acceptableStatusCodes: Seq[Int]): Future[RichSourceResponse]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
def execPOSTStringAux[T : BodyWritable](request: StandaloneWSRequest, body: T, endPointForLogging: Option[PEP], acceptableStatusCodes: Seq[Int]): Future[RichStringResponse]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
def execPOSTWithStatus(endPoint: PEP, endPointParam: Option[String], params: Seq[(PT, Option[Any])], bodyParams: Seq[(PT, Option[JsValue])], acceptableStatusCodes: Seq[Int]): Future[RichJsResponse]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
def execRequestJsonAux(request: StandaloneWSRequest, exec: StandaloneWSRequest => Future[Response], acceptableStatusCodes: Seq[Int], endPointForLogging: Option[PEP]): Future[RichJsResponse]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
def execRequestRaw(request: StandaloneWSRequest, exec: StandaloneWSRequest => Future[Response], acceptableStatusCodes: Seq[Int], endPointForLogging: Option[PEP]): Future[Either[Response, (Int, String)]]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
override protected def getWSRequest(endPoint: Option[PEP], endPointParam: Option[String], params: Seq[(String, Any)]): Self

Attributes

Definition Classes
WSRequestHelper -> WSRequestHelperBase
Inherited from:
WSRequestHelper
override protected def getWSRequestOptional(endPoint: Option[PEP], endPointParam: Option[String], params: Seq[(String, Option[Any])]): Self

Attributes

Definition Classes
WSRequestHelper -> WSRequestHelperBase
Inherited from:
WSRequestHelper
protected def handleErrorCodes(httpCode: Int, message: String): Nothing

Attributes

Inherited from:
WSRequestHelperBase (hidden)
protected def handleErrorResponse[T](response: RichResponse[T]): T

Attributes

Inherited from:
WSRequestHelperBase (hidden)
protected def handleNotFoundAndError[T](response: RichResponse[T]): Option[T]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
protected def jsonBodyParams[T](params: (T, Option[Any])*): Seq[(T, Option[JsValue])]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
protected def paramsAsString(params: Seq[(String, Any)]): String

Attributes

Inherited from:
WSRequestHelperBase (hidden)
protected def paramsOptionalAsString(params: Seq[(String, Option[Any])]): String

Attributes

Inherited from:
WSRequestHelperBase (hidden)
protected def recoverErrors(endPointForLogging: Option[PEP]): PartialFunction[Throwable, Either[Response, (Int, String)]]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
override protected def timeouts: Timeouts

Attributes

Definition Classes
WSRequestHelper -> HasWSClient
Inherited from:
WSRequestHelper
protected def toOptionalParams(params: Seq[(PT, Any)]): Seq[(PT, Some[Any])]

Attributes

Inherited from:
WSRequestHelperBase (hidden)
protected def toStringParams(params: Seq[(PT, Option[Any])]): Seq[(String, Option[Any])]

Attributes

Inherited from:
WSRequestHelperBase (hidden)

Inherited fields

protected val authHeaders: Seq[(String, String)]

Auth headers (HTTP headers) to be added to each request.

Auth headers (HTTP headers) to be added to each request.

Attributes

Inherited from:
WSRequestHelper
lazy protected val client: StandaloneWSClient

Attributes

Inherited from:
HasWSClient
protected val coreUrl: String

Attributes

Inherited from:
WSRequestHelperBase (hidden)
protected val defaultReadoutTimeout: Int

Attributes

Inherited from:
WSRequestHelper
protected val defaultRequestTimeout: Int

Attributes

Inherited from:
WSRequestHelper
protected val explTimeouts: Option[Timeouts]

Attributes

Inherited from:
WSRequestHelper
protected val extraParams: Seq[(String, String)]

Extra parameters to be added to each request.

Extra parameters to be added to each request.

Attributes

Inherited from:
WSRequestHelper
protected val serviceName: String

Attributes

Inherited from:
WSRequestHelperBase (hidden)

Implicits

Inherited implicits

implicit protected val ec: ExecutionContext

Attributes

Inherited from:
WSRequestHelperBase (hidden)
implicit protected val materializer: Materializer

Attributes

Inherited from:
HasWSClient