getPreview method
Future<DynamiteResponse<Uint8List, void> >
getPreview({
- required String token,
- String? file,
- int? x,
- int? y,
- PublicPreviewGetPreviewA? a,
Get a preview for a shared file.
Returns a Future containing a DynamiteResponse with the status code, deserialized body and headers.
Throws a DynamiteApiException if the API call does not return an expected status code.
Parameters:
tokenToken of the share.fileFile in the share. Defaults to"".xWidth of the preview. Defaults to32.yHeight of the preview. Defaults to32.aWhether to not crop the preview. Defaults to0.
Status codes:
- 200: Preview returned
- 400: Getting preview is not possible
- 403: Getting preview is not allowed
- 404: Share or preview not found
See:
- $getPreview_Request for the request send by this method.
- $getPreview_Serializer for a converter to parse the
Responsefrom an executed request.
Implementation
Future<_i1.DynamiteResponse<Uint8List, void>> getPreview({
required String token,
String? file,
int? x,
int? y,
PublicPreviewGetPreviewA? a,
}) async {
final _request = $getPreview_Request(
token: token,
file: file,
x: x,
y: y,
a: a,
);
final _streamedResponse = await _rootClient.httpClient.send(_request);
final _response = await _i3.Response.fromStream(_streamedResponse);
final _serializer = $getPreview_Serializer();
return _i1.ResponseConverter<Uint8List, void>(_serializer).convert(_response);
}