// 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_TXBitrateItem extends java_lang_Object  {
  //region constants
  static const String name__ = 'com.tencent.rtmp.TXBitrateItem';

  
  //endregion

  //region creators
  static Future<com_tencent_rtmp_TXBitrateItem> create__() async {
    final refId = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('ObjectFactory::createcom_tencent_rtmp_TXBitrateItem__', );
    final object = com_tencent_rtmp_TXBitrateItem()..refId = refId..tag__ = 'tencent_live_fluttify';
    return object;
  }
  
  static Future<List<com_tencent_rtmp_TXBitrateItem>> create_batch__(int length) 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_batchcom_tencent_rtmp_TXBitrateItem__', {'length': length});
  
    final List<com_tencent_rtmp_TXBitrateItem> typedResult = resultBatch.map((result) => com_tencent_rtmp_TXBitrateItem()..refId = result..tag__ = 'tencent_live_fluttify').toList();
    return typedResult;
  }
  
  //endregion

  //region getters
  Future<int> get_index() async {
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod("com.tencent.rtmp.TXBitrateItem::get_index", {'__this__': this});
    return __result__ == null ? null : (__result__);
  }
  
  Future<int> get_width() async {
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod("com.tencent.rtmp.TXBitrateItem::get_width", {'__this__': this});
    return __result__ == null ? null : (__result__);
  }
  
  Future<int> get_height() async {
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod("com.tencent.rtmp.TXBitrateItem::get_height", {'__this__': this});
    return __result__ == null ? null : (__result__);
  }
  
  Future<int> get_bitrate() async {
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod("com.tencent.rtmp.TXBitrateItem::get_bitrate", {'__this__': this});
    return __result__ == null ? null : (__result__);
  }
  
  //endregion

  //region setters
  Future<void> set_index(int index) async {
    await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('com.tencent.rtmp.TXBitrateItem::set_index', <String, dynamic>{'__this__': this, "index": index});
  
  
  }
  
  Future<void> set_width(int width) async {
    await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('com.tencent.rtmp.TXBitrateItem::set_width', <String, dynamic>{'__this__': this, "width": width});
  
  
  }
  
  Future<void> set_height(int height) async {
    await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('com.tencent.rtmp.TXBitrateItem::set_height', <String, dynamic>{'__this__': this, "height": height});
  
  
  }
  
  Future<void> set_bitrate(int bitrate) async {
    await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('com.tencent.rtmp.TXBitrateItem::set_bitrate', <String, dynamic>{'__this__': this, "bitrate": bitrate});
  
  
  }
  
  //endregion

  //region methods
  
  Future<int> compareTo(com_tencent_rtmp_TXBitrateItem var1) async {
    // print log
    if (fluttifyLogEnabled) {
      debugPrint('fluttify-dart: com.tencent.rtmp.TXBitrateItem@$refId::compareTo([])');
    }
  
    // invoke native method
    final __result__ = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod('com.tencent.rtmp.TXBitrateItem::compareTo', {"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_TXBitrateItem_Batch on List<com_tencent_rtmp_TXBitrateItem> {
  //region getters
  Future<List<int>> get_index_batch() async {
    final resultBatch = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod("com.tencent.rtmp.TXBitrateItem::get_index_batch", [for (final __item__ in this) {'__this__': __item__}]);
  
    final typedResult = (resultBatch as List).cast<int>().map((__result__) => __result__).toList();
    return typedResult;
  }
  
  Future<List<int>> get_width_batch() async {
    final resultBatch = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod("com.tencent.rtmp.TXBitrateItem::get_width_batch", [for (final __item__ in this) {'__this__': __item__}]);
  
    final typedResult = (resultBatch as List).cast<int>().map((__result__) => __result__).toList();
    return typedResult;
  }
  
  Future<List<int>> get_height_batch() async {
    final resultBatch = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod("com.tencent.rtmp.TXBitrateItem::get_height_batch", [for (final __item__ in this) {'__this__': __item__}]);
  
    final typedResult = (resultBatch as List).cast<int>().map((__result__) => __result__).toList();
    return typedResult;
  }
  
  Future<List<int>> get_bitrate_batch() async {
    final resultBatch = await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec('tencent_live_fluttify'))).invokeMethod("com.tencent.rtmp.TXBitrateItem::get_bitrate_batch", [for (final __item__ in this) {'__this__': __item__}]);
  
    final typedResult = (resultBatch as List).cast<int>().map((__result__) => __result__).toList();
    return typedResult;
  }
  
  //endregion

  //region setters
  Future<void> set_index_batch(List<int> index) async {
    await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec())).invokeMethod('com.tencent.rtmp.TXBitrateItem::set_index_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "index": index[__i__]}]);
  
  
  }
  
  Future<void> set_width_batch(List<int> width) async {
    await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec())).invokeMethod('com.tencent.rtmp.TXBitrateItem::set_width_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "width": width[__i__]}]);
  
  
  }
  
  Future<void> set_height_batch(List<int> height) async {
    await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec())).invokeMethod('com.tencent.rtmp.TXBitrateItem::set_height_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "height": height[__i__]}]);
  
  
  }
  
  Future<void> set_bitrate_batch(List<int> bitrate) async {
    await MethodChannel('com.fluttify/tencent_live_fluttify', StandardMethodCodec(FluttifyMessageCodec())).invokeMethod('com.tencent.rtmp.TXBitrateItem::set_bitrate_batch', [for (int __i__ = 0; __i__ < this.length; __i__++) {'__this__': this[__i__], "bitrate": bitrate[__i__]}]);
  
  
  }
  
  //endregion

  //region methods
  
  Future<List<int>> compareTo_batch(List<com_tencent_rtmp_TXBitrateItem> 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.TXBitrateItem::compareTo_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<int>().map((__result__) => __result__).toList();
      return typedResult;
    }
  }
  
  //endregion
}