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 withapiTokenwhen set.
Properties
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
onUpdatewith each status. Throws ApiClientException on failure or whentimeoutelapses first. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited