list method

Future<ThreadMessageFileListModel?> list(
  1. dynamic threadID,
  2. dynamic messageID,
  3. String order, {
  4. String? after,
  5. String? before,
  6. int? limit = 20,
})

LIST A THREAD MESSAGE FILES

Implementation

Future<ThreadMessageFileListModel?> list(threadID, messageID, String order, {String? after, String? before, int? limit = 20})async{
  Internet net = Internet();
  try{
    var res = await net.openAIAssitantGET("threads/$threadID/messages/$messageID/files?limit=$limit", apiKey);

    if(res.statusCode == 200){
      var r = ThreadMessageFileListModel.fromJson(jsonDecode(res.body));
      return r;
    }else{
      return null;
    }
  }catch(e){
    if (kDebugMode) {
      print(e.toString());
    }
    return null;
  }
}