file method

Future<FileInfoEntity> file(
  1. String fileId, {
  2. FilesIncludeFields? include,
  3. @Deprecated('Due to the API stabilizing recognition feature moved to the [ApiAddons]') bool includeRecognitionInfo = false,
})

Retreive file by fileId

Implementation

Future<FileInfoEntity> file(
  String fileId, {
  /// Since v0.7
  /// Include additional fields to the file object, such as: appdata
  FilesIncludeFields? include,

  /// Only v0.6
  @Deprecated(
      'Due to the API stabilizing recognition feature moved to the [ApiAddons]')
  bool includeRecognitionInfo = false,
}) async {
  _ensureRightVersionForRecognitionApi(includeRecognitionInfo);

  if (include != null) _ensureRightVersionForApplicationData();

  return FileInfoEntity.fromJson(
    await resolveStreamedResponse(
      createRequest(
        'GET',
        buildUri('$apiUrl/files/$fileId/', {
          if (include != null) 'include': include.toString(),
          if (includeRecognitionInfo) 'add_fields': 'rekognition_info',
        }),
      ).send(),
    ),
  );
}