getPreview method

Future<DynamiteResponse<Uint8List, void>> getPreview({
  1. int? fileId,
  2. int? x,
  3. int? y,
  4. PreviewGetPreviewA? a,
})

Get the preview for a 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:

  • fileId ID of the file. Defaults to -1.
  • x Width of the preview. Defaults to 32.
  • y Height of the preview. Defaults to 32.
  • a Whether to not crop the preview. Defaults to 0.

Status codes:

  • 200: Preview returned
  • 400: Getting preview is not possible
  • 404: Preview not found

See:

Implementation

Future<_i1.DynamiteResponse<Uint8List, void>> getPreview({
  int? fileId,
  int? x,
  int? y,
  PreviewGetPreviewA? a,
}) async {
  final _request = $getPreview_Request(
    fileId: fileId,
    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);
}