// 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/ios/ios.export.g.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';

import 'package:foundation_fluttify/foundation_fluttify.dart';

class TXLiveBase extends NSObject  {
  //region constants
  static const String name__ = 'TXLiveBase';

  
  //endregion

  //region creators
  static Future<TXLiveBase> create__({ bool init = true /* ios only */ }) async {
    final refId = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('ObjectFactory::createTXLiveBase', {'init': init});
    final object = TXLiveBase()..refId = refId..tag__ = 'tencent_live_fluttify';
    return object;
  }
  
  static Future<List<TXLiveBase>> create_batch__(int length, { bool init = true /* ios only */ }) async {
    if (false) {
      return Future.error('all args must have same length!');
    }
    final List resultBatch = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('ObjectFactory::create_batchTXLiveBase', {'length': length, 'init': init});
  
    final List<TXLiveBase> typedResult = resultBatch.map((result) => TXLiveBase()..refId = result..tag__ = 'tencent_live_fluttify').toList();
    return typedResult;
  }
  
  //endregion

  //region getters
  
  //endregion

  //region setters
  Future<void> set_delegate(TXLiveBaseDelegate delegate) async {
    await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('TXLiveBase::set_delegate', <String, dynamic>{'__this__': this, });
  
    MethodChannel('TXLiveBaseDelegate::Callback', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify')))
      .setMethodCallHandler((methodCall) async {
        try {
          final args = methodCall.arguments as Map;
          switch (methodCall.method) {
            case 'Callback::TXLiveBaseDelegate::onLog_LogLevel_WhichModule':
              // print log
              if (fluttifyLogEnabled) {
                debugPrint('fluttify-dart-callback: onLog_LogLevel_WhichModule([\'log\':${args['log']}, \'level\':${args['level']}, \'module\':${args['module']}])');
              }
          
              // handle the native call
              delegate?.onLog_LogLevel_WhichModule(args['log'], args['level'], args['module']);
              break;
            default:
              break;
          }
        } catch (e) {
          debugPrint(e);
          throw e;
        }
      });
  }
  
  //endregion

  //region methods
  
  static Future<TXLiveBase> sharedInstance() async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: TXLiveBase::sharedInstance([])');
    }
  
    // invoke native method
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('TXLiveBase::sharedInstance', );
  
  
    // handle native call
  
  
    // convert native result to dart side object
    if (__result__ == null) {
      return null;
    } else {
      final __return__ = TXLiveBase()..refId = __result__..tag__ = 'tencent_live_fluttify';
      return __return__;
    }
  }
  
  
  static Future<void> setLogLevel(TX_Enum_Type_LogLevel level) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: TXLiveBase::setLogLevel([])');
    }
  
    // invoke native method
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('TXLiveBase::setLogLevel', {"level": level.toValue()});
  
  
    // handle native call
  
  
    // convert native result to dart side object
    if (__result__ == null) {
      return null;
    } else {
      final __return__ = __result__;
      return __return__;
    }
  }
  
  
  static Future<void> setConsoleEnabled(bool enabled) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: TXLiveBase::setConsoleEnabled([\'enabled\':$enabled])');
    }
  
    // invoke native method
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('TXLiveBase::setConsoleEnabled', {"enabled": enabled});
  
  
    // handle native call
  
  
    // convert native result to dart side object
    if (__result__ == null) {
      return null;
    } else {
      final __return__ = __result__;
      return __return__;
    }
  }
  
  
  static Future<void> setAppVersion(String verNum) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: TXLiveBase::setAppVersion([\'verNum\':$verNum])');
    }
  
    // invoke native method
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('TXLiveBase::setAppVersion', {"verNum": verNum});
  
  
    // handle native call
  
  
    // convert native result to dart side object
    if (__result__ == null) {
      return null;
    } else {
      final __return__ = __result__;
      return __return__;
    }
  }
  
  
  static Future<void> setAudioSessionDelegate(TXLiveAudioSessionDelegate delegate) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: TXLiveBase::setAudioSessionDelegate([])');
    }
  
    // invoke native method
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('TXLiveBase::setAudioSessionDelegate', );
  
  
    // handle native call
    MethodChannel('TXLiveAudioSessionDelegate::Callback', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify')))
        .setMethodCallHandler((methodCall) async {
          try {
            final args = methodCall.arguments as Map;
            switch (methodCall.method) {
          
              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__;
    }
  }
  
  
  static Future<String> getSDKVersionStr() async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: TXLiveBase::getSDKVersionStr([])');
    }
  
    // invoke native method
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('TXLiveBase::getSDKVersionStr', );
  
  
    // handle native call
  
  
    // convert native result to dart side object
    if (__result__ == null) {
      return null;
    } else {
      final __return__ = __result__;
      return __return__;
    }
  }
  
  
  static Future<String> getPituSDKVersion() async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: TXLiveBase::getPituSDKVersion([])');
    }
  
    // invoke native method
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('TXLiveBase::getPituSDKVersion', );
  
  
    // handle native call
  
  
    // convert native result to dart side object
    if (__result__ == null) {
      return null;
    } else {
      final __return__ = __result__;
      return __return__;
    }
  }
  
  
  static Future<void> setAppID(String appID) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: TXLiveBase::setAppID([\'appID\':$appID])');
    }
  
    // invoke native method
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('TXLiveBase::setAppID', {"appID": appID});
  
  
    // handle native call
  
  
    // convert native result to dart side object
    if (__result__ == null) {
      return null;
    } else {
      final __return__ = __result__;
      return __return__;
    }
  }
  
  
  static Future<void> setLicenceURL_key(String url, String key) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: TXLiveBase::setLicenceURL([\'url\':$url, \'key\':$key])');
    }
  
    // invoke native method
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('TXLiveBase::setLicenceURL_key', {"url": url, "key": key});
  
  
    // handle native call
  
  
    // convert native result to dart side object
    if (__result__ == null) {
      return null;
    } else {
      final __return__ = __result__;
      return __return__;
    }
  }
  
  
  static Future<String> getLicenceInfo() async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: TXLiveBase::getLicenceInfo([])');
    }
  
    // invoke native method
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('TXLiveBase::getLicenceInfo', );
  
  
    // handle native call
  
  
    // convert native result to dart side object
    if (__result__ == null) {
      return null;
    } else {
      final __return__ = __result__;
      return __return__;
    }
  }
  
  //endregion
}

extension TXLiveBase_Batch on List<TXLiveBase> {
  //region getters
  
  //endregion

  //region setters
  
  //endregion

  //region methods
  
  static Future<List<TXLiveBase>> sharedInstance_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('TXLiveBase::sharedInstance_batch', );
  
  
    // convert native result to dart side object
    if (resultBatch == null) {
      return null;
    } else {
      final typedResult = (resultBatch as List).cast<String>().map((__result__) => TXLiveBase()..refId = __result__..tag__ = 'tencent_live_fluttify').toList();
      return typedResult;
    }
  }
  
  
  static Future<List<void>> setLogLevel_batch(List<TX_Enum_Type_LogLevel> level) 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('TXLiveBase::setLogLevel_batch', [for (int __i__ = 0; __i__ < level.length; __i__++) {"level": level[__i__].toValue()}]);
  
  
    // 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;
    }
  }
  
  
  static Future<List<void>> setConsoleEnabled_batch(List<bool> enabled) 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('TXLiveBase::setConsoleEnabled_batch', [for (int __i__ = 0; __i__ < enabled.length; __i__++) {"enabled": enabled[__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;
    }
  }
  
  
  static Future<List<void>> setAppVersion_batch(List<String> verNum) 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('TXLiveBase::setAppVersion_batch', [for (int __i__ = 0; __i__ < verNum.length; __i__++) {"verNum": verNum[__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;
    }
  }
  
  
  static Future<List<String>> getSDKVersionStr_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('TXLiveBase::getSDKVersionStr_batch', );
  
  
    // 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;
    }
  }
  
  
  static Future<List<String>> getPituSDKVersion_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('TXLiveBase::getPituSDKVersion_batch', );
  
  
    // 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;
    }
  }
  
  
  static Future<List<void>> setAppID_batch(List<String> appID) 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('TXLiveBase::setAppID_batch', [for (int __i__ = 0; __i__ < appID.length; __i__++) {"appID": appID[__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;
    }
  }
  
  
  static Future<List<void>> setLicenceURL_key_batch(List<String> url, List<String> key) async {
    if (url.length != key.length) {
      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('TXLiveBase::setLicenceURL_key_batch', [for (int __i__ = 0; __i__ < url.length; __i__++) {"url": url[__i__], "key": key[__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;
    }
  }
  
  
  static Future<List<String>> getLicenceInfo_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('TXLiveBase::getLicenceInfo_batch', );
  
  
    // 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;
    }
  }
  
  //endregion
}