RemoteApiService

Provides ability to handle remote API requests that originate within lenses. Lifecycle of a RemoteApiService is scoped to a lifecycle of a single lens. To provide RemoteApiService instances, register a RemoteApiService.Factory via the Builder.remoteApiServiceFactory method.

Since

1.13.0

Types

Link copied to clipboard
sealed class Call

Represents all the possible outcomes when RemoteApiService processes a Request.

Link copied to clipboard
object Companion

Provides ability to attach utility functions to the RemoteApiService interface on implementation side.

Link copied to clipboard
interface Factory

Creates instances of RemoteApiService scoped to a lifecycle of a single lens.

Link copied to clipboard

Convenience implementation of RemoteApiService which ignores all requests.

Link copied to clipboard
class Request(val id: String, val apiSpecId: String, val endpointId: String, val parameters: Map<String, String>, val body: ByteArray)

Defines the data model for a request sent by a lens.

Link copied to clipboard

Defines the data model for a response to a request sent by a lens.

Functions

Link copied to clipboard
abstract override fun close()

Closes all resources allocated for this RemoteApiService. Overridden to indicate that calling close will not throw.

Link copied to clipboard

Attempts to process the request with one or multiple Responses sent back to the provided onResponse. The returned Call indicates how this RemoteApiService handled the request so that callers can act accordingly:

Inheritors

Link copied to clipboard