// ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast
//////////////////////////////////////////////////////////
// GENERATED BY FLUTTIFY. DO NOT EDIT IT.
//////////////////////////////////////////////////////////

import 'dart:typed_data';

import 'package:tencent_live_fluttify/src/android/android.export.g.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'package:foundation_fluttify/foundation_fluttify.dart';

class com_tencent_rtmp_downloader_TXVodDownloadManager extends java_lang_Object  {
  //region constants
  static const String name__ = 'com.tencent.rtmp.downloader.TXVodDownloadManager';

  static final int DOWNLOAD_SUCCESS = 0;
  static final int DOWNLOAD_AUTH_FAILED = -5001;
  static final int DOWNLOAD_NO_FILE = -5003;
  static final int DOWNLOAD_FORMAT_ERROR = -5004;
  static final int DOWNLOAD_DISCONNECT = -5005;
  static final int DOWNLOAD_HLS_KEY_ERROR = -5006;
  static final int DOWNLOAD_PATH_ERROR = -5007;
  //endregion

  //region creators
  
  //endregion

  //region getters
  
  //endregion

  //region setters
  
  //endregion

  //region methods
  
  static Future<com_tencent_rtmp_downloader_TXVodDownloadManager> getInstance() async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: com.tencent.rtmp.downloader.TXVodDownloadManager::getInstance([])');
    }
  
    // invoke native method
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('com.tencent.rtmp.downloader.TXVodDownloadManager::getInstance', );
  
  
    // handle native call
  
  
    // convert native result to dart side object
    if (__result__ == null) {
      return null;
    } else {
      final __return__ = com_tencent_rtmp_downloader_TXVodDownloadManager()..refId = __result__..tag__ = 'tencent_live_fluttify';
      return __return__;
    }
  }
  
  
  Future<void> setDownloadPath(String var1) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: com.tencent.rtmp.downloader.TXVodDownloadManager@$refId::setDownloadPath([\'var1\':$var1])');
    }
  
    // invoke native method
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('com.tencent.rtmp.downloader.TXVodDownloadManager::setDownloadPath', {"var1": var1, "__this__": this});
  
  
    // handle native call
  
  
    // convert native result to dart side object
    if (__result__ == null) {
      return null;
    } else {
      final __return__ = __result__;
      return __return__;
    }
  }
  
  
  Future<void> setHeaders(Map<String,String> var1) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: com.tencent.rtmp.downloader.TXVodDownloadManager@$refId::setHeaders([\'var1\':$var1])');
    }
  
    // invoke native method
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('com.tencent.rtmp.downloader.TXVodDownloadManager::setHeaders', {"var1": var1, "__this__": this});
  
  
    // handle native call
  
  
    // convert native result to dart side object
    if (__result__ == null) {
      return null;
    } else {
      final __return__ = __result__;
      return __return__;
    }
  }
  
  
  Future<void> setListener(com_tencent_rtmp_downloader_ITXVodDownloadListener var1) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: com.tencent.rtmp.downloader.TXVodDownloadManager@$refId::setListener([])');
    }
  
    // invoke native method
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('com.tencent.rtmp.downloader.TXVodDownloadManager::setListener', {"__this__": this});
  
  
    // handle native call
    MethodChannel('com.tencent.rtmp.downloader.TXVodDownloadManager::setListener::Callback@$refId', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify')))
        .setMethodCallHandler((methodCall) async {
          try {
            final args = methodCall.arguments as Map;
            switch (methodCall.method) {
              case 'Callback::com.tencent.rtmp.downloader.ITXVodDownloadListener::onDownloadStart':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: onDownloadStart([\'var1\':${args['var1']}])');
                }
          
                // handle the native call
                var1?.onDownloadStart(TypeOpTencentLiveFluttifyAndroid((args['var1'] as Object))?.as__<com_tencent_rtmp_downloader_TXVodDownloadMediaInfo>());
                break;
              case 'Callback::com.tencent.rtmp.downloader.ITXVodDownloadListener::onDownloadProgress':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: onDownloadProgress([\'var1\':${args['var1']}])');
                }
          
                // handle the native call
                var1?.onDownloadProgress(TypeOpTencentLiveFluttifyAndroid((args['var1'] as Object))?.as__<com_tencent_rtmp_downloader_TXVodDownloadMediaInfo>());
                break;
              case 'Callback::com.tencent.rtmp.downloader.ITXVodDownloadListener::onDownloadStop':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: onDownloadStop([\'var1\':${args['var1']}])');
                }
          
                // handle the native call
                var1?.onDownloadStop(TypeOpTencentLiveFluttifyAndroid((args['var1'] as Object))?.as__<com_tencent_rtmp_downloader_TXVodDownloadMediaInfo>());
                break;
              case 'Callback::com.tencent.rtmp.downloader.ITXVodDownloadListener::onDownloadFinish':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: onDownloadFinish([\'var1\':${args['var1']}])');
                }
          
                // handle the native call
                var1?.onDownloadFinish(TypeOpTencentLiveFluttifyAndroid((args['var1'] as Object))?.as__<com_tencent_rtmp_downloader_TXVodDownloadMediaInfo>());
                break;
              case 'Callback::com.tencent.rtmp.downloader.ITXVodDownloadListener::onDownloadError':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: onDownloadError([\'var1\':${args['var1']}, \'var2\':${args['var2']}, \'var3\':${args['var3']}])');
                }
          
                // handle the native call
                var1?.onDownloadError(TypeOpTencentLiveFluttifyAndroid((args['var1'] as Object))?.as__<com_tencent_rtmp_downloader_TXVodDownloadMediaInfo>(), args['var2'], args['var3']);
                break;
              case 'Callback::com.tencent.rtmp.downloader.ITXVodDownloadListener::hlsKeyVerify':
                // print log
                if (fluttifyLogEnabled) {
                  debugPrint('fluttify-dart-callback: hlsKeyVerify([\'var1\':${args['var1']}, \'var2\':${args['var2']}, \'var3\':${args['var3']}])');
                }
          
                // handle the native call
                var1?.hlsKeyVerify(TypeOpTencentLiveFluttifyAndroid((args['var1'] as Object))?.as__<com_tencent_rtmp_downloader_TXVodDownloadMediaInfo>(), args['var2'], args['var3']);
                break;
              default:
                break;
            }
          } catch (e) {
            debugPrint(e);
            throw e;
          }
        });
  
    // convert native result to dart side object
    if (__result__ == null) {
      return null;
    } else {
      final __return__ = __result__;
      return __return__;
    }
  }
  
  
  Future<com_tencent_rtmp_downloader_TXVodDownloadMediaInfo> startDownloadUrl(String var1) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: com.tencent.rtmp.downloader.TXVodDownloadManager@$refId::startDownloadUrl([\'var1\':$var1])');
    }
  
    // invoke native method
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('com.tencent.rtmp.downloader.TXVodDownloadManager::startDownloadUrl', {"var1": var1, "__this__": this});
  
  
    // handle native call
  
  
    // convert native result to dart side object
    if (__result__ == null) {
      return null;
    } else {
      final __return__ = com_tencent_rtmp_downloader_TXVodDownloadMediaInfo()..refId = __result__..tag__ = 'tencent_live_fluttify';
      return __return__;
    }
  }
  
  
  Future<com_tencent_rtmp_downloader_TXVodDownloadMediaInfo> startDownload(com_tencent_rtmp_downloader_TXVodDownloadDataSource var1) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: com.tencent.rtmp.downloader.TXVodDownloadManager@$refId::startDownload([])');
    }
  
    // invoke native method
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('com.tencent.rtmp.downloader.TXVodDownloadManager::startDownload', {"var1": var1, "__this__": this});
  
  
    // handle native call
  
  
    // convert native result to dart side object
    if (__result__ == null) {
      return null;
    } else {
      final __return__ = com_tencent_rtmp_downloader_TXVodDownloadMediaInfo()..refId = __result__..tag__ = 'tencent_live_fluttify';
      return __return__;
    }
  }
  
  
  Future<void> stopDownload(com_tencent_rtmp_downloader_TXVodDownloadMediaInfo var1) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: com.tencent.rtmp.downloader.TXVodDownloadManager@$refId::stopDownload([])');
    }
  
    // invoke native method
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('com.tencent.rtmp.downloader.TXVodDownloadManager::stopDownload', {"var1": var1, "__this__": this});
  
  
    // handle native call
  
  
    // convert native result to dart side object
    if (__result__ == null) {
      return null;
    } else {
      final __return__ = __result__;
      return __return__;
    }
  }
  
  
  Future<bool> deleteDownloadFile(String var1) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: com.tencent.rtmp.downloader.TXVodDownloadManager@$refId::deleteDownloadFile([\'var1\':$var1])');
    }
  
    // invoke native method
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('com.tencent.rtmp.downloader.TXVodDownloadManager::deleteDownloadFile', {"var1": var1, "__this__": this});
  
  
    // handle native call
  
  
    // convert native result to dart side object
    if (__result__ == null) {
      return null;
    } else {
      final __return__ = __result__;
      return __return__;
    }
  }
  
  //endregion
}

extension com_tencent_rtmp_downloader_TXVodDownloadManager_Batch on List<com_tencent_rtmp_downloader_TXVodDownloadManager> {
  //region getters
  
  //endregion

  //region setters
  
  //endregion

  //region methods
  
  static Future<List<com_tencent_rtmp_downloader_TXVodDownloadManager>> getInstance_batch() async {
    if (false) {
      return Future.error('all args must have same length!');
    }
  
    // invoke native method
    final resultBatch = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('com.tencent.rtmp.downloader.TXVodDownloadManager::getInstance_batch', );
  
  
    // convert native result to dart side object
    if (resultBatch == null) {
      return null;
    } else {
      final typedResult = (resultBatch as List).cast<String>().map((__result__) => com_tencent_rtmp_downloader_TXVodDownloadManager()..refId = __result__..tag__ = 'tencent_live_fluttify').toList();
      return typedResult;
    }
  }
  
  
  Future<List<void>> setDownloadPath_batch(List<String> var1) async {
    if (false) {
      return Future.error('all args must have same length!');
    }
  
    // invoke native method
    final resultBatch = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('com.tencent.rtmp.downloader.TXVodDownloadManager::setDownloadPath_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "__this__": this[__i__]}]);
  
  
    // convert native result to dart side object
    if (resultBatch == null) {
      return null;
    } else {
      final typedResult = (resultBatch as List).cast<String>().map((__result__) => __result__).toList();
      return typedResult;
    }
  }
  
  
  Future<List<void>> setHeaders_batch(List<Map<String,String>> var1) async {
    if (false) {
      return Future.error('all args must have same length!');
    }
  
    // invoke native method
    final resultBatch = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('com.tencent.rtmp.downloader.TXVodDownloadManager::setHeaders_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "__this__": this[__i__]}]);
  
  
    // convert native result to dart side object
    if (resultBatch == null) {
      return null;
    } else {
      final typedResult = (resultBatch as List).cast<String>().map((__result__) => __result__).toList();
      return typedResult;
    }
  }
  
  
  Future<List<com_tencent_rtmp_downloader_TXVodDownloadMediaInfo>> startDownloadUrl_batch(List<String> var1) async {
    if (false) {
      return Future.error('all args must have same length!');
    }
  
    // invoke native method
    final resultBatch = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('com.tencent.rtmp.downloader.TXVodDownloadManager::startDownloadUrl_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "__this__": this[__i__]}]);
  
  
    // convert native result to dart side object
    if (resultBatch == null) {
      return null;
    } else {
      final typedResult = (resultBatch as List).cast<String>().map((__result__) => com_tencent_rtmp_downloader_TXVodDownloadMediaInfo()..refId = __result__..tag__ = 'tencent_live_fluttify').toList();
      return typedResult;
    }
  }
  
  
  Future<List<com_tencent_rtmp_downloader_TXVodDownloadMediaInfo>> startDownload_batch(List<com_tencent_rtmp_downloader_TXVodDownloadDataSource> var1) async {
    if (false) {
      return Future.error('all args must have same length!');
    }
  
    // invoke native method
    final resultBatch = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('com.tencent.rtmp.downloader.TXVodDownloadManager::startDownload_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "__this__": this[__i__]}]);
  
  
    // convert native result to dart side object
    if (resultBatch == null) {
      return null;
    } else {
      final typedResult = (resultBatch as List).cast<String>().map((__result__) => com_tencent_rtmp_downloader_TXVodDownloadMediaInfo()..refId = __result__..tag__ = 'tencent_live_fluttify').toList();
      return typedResult;
    }
  }
  
  
  Future<List<void>> stopDownload_batch(List<com_tencent_rtmp_downloader_TXVodDownloadMediaInfo> var1) async {
    if (false) {
      return Future.error('all args must have same length!');
    }
  
    // invoke native method
    final resultBatch = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('com.tencent.rtmp.downloader.TXVodDownloadManager::stopDownload_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "__this__": this[__i__]}]);
  
  
    // convert native result to dart side object
    if (resultBatch == null) {
      return null;
    } else {
      final typedResult = (resultBatch as List).cast<String>().map((__result__) => __result__).toList();
      return typedResult;
    }
  }
  
  
  Future<List<bool>> deleteDownloadFile_batch(List<String> var1) async {
    if (false) {
      return Future.error('all args must have same length!');
    }
  
    // invoke native method
    final resultBatch = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('com.tencent.rtmp.downloader.TXVodDownloadManager::deleteDownloadFile_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {"var1": var1[__i__], "__this__": this[__i__]}]);
  
  
    // convert native result to dart side object
    if (resultBatch == null) {
      return null;
    } else {
      final typedResult = (resultBatch as List).cast<bool>().map((__result__) => __result__).toList();
      return typedResult;
    }
  }
  
  //endregion
}