ApiClientFactory

works.iterative.tapir.ApiClientFactory
See theApiClientFactory companion object

Create effectful methods to perform the endpoint operation.

The factory takes an endpoint with correct type signature, and returns a function that can call the endpoint.

The resulting error channel is whatever the endpoint declares as the client error channel, eg. the type E of ApiError[E], which is what is reported in RequestFailure[E].

The other options - AuthenticationFailure, ServerFailure - are converted to defects to be handled at another level.

This way the client can deal only with what it can actually do something about.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def make[I, E, O](endpoint: Endpoint[AccessToken, I, ApiError[E], O, ZioStreams & WebSockets])(using b: BaseUriExtractor[O], e: ClientErrorConstructor[E]): I => IO[e.Error, O]