ApiRenderClient class interface

A web-safe HTTP client for the Fluvie render API.

Works on web, mobile, and desktop (it depends only on package:http). The underlying http.Client is injectable so tests drive it with a mock and no socket. Declared an interface class so consumers can mock it. Call close when done.

Constructors

ApiRenderClient({required Uri baseUrl, String? apiToken, Client? httpClient})
Creates a client against baseUrl (e.g. https://render.example.com), authenticating with apiToken when set.

Properties

apiToken String?
The bearer token sent on create/status requests, or null for none.
final
baseUrl Uri
The API base URL.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → void
Closes the underlying HTTP client.
createRender(ApiRenderRequest request) Future<RenderJobView>
Creates a render job, returning its queued RenderJobView.
getJob(String id) Future<RenderJobView>
Fetches the current status of job id.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
renderAndWait(ApiRenderRequest request, {void onUpdate(RenderJobView job)?, Duration pollInterval = const Duration(seconds: 1), Duration timeout = const Duration(minutes: 10), Future<void> wait(Duration) = _realWait}) Future<RenderJobView>
Creates a render and polls until it succeeds or fails, calling onUpdate with each status. Throws ApiClientException on failure or when timeout elapses first.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited