//*****************************************************************
//             Generate by vsc-wisdom-flutter-kit
//*****************************************************************

///[http://yapi.wisdomcity.com.cn/project/40/interface/api/10094](http://yapi.wisdomcity.com.cn/project/40/interface/api/10094)
///
///update 2020-9-29 17:2:18
///
///住户抄表单元统计页面
// ignore: library_names
library meterReading_house_unitTotal.get;

import 'response_model.dart';
import 'package:dio/dio.dart';

///[http://yapi.wisdomcity.com.cn/project/40/interface/api/10094](http://yapi.wisdomcity.com.cn/project/40/interface/api/10094)
///
///update 2020-9-29 17:2:18
///
///住户抄表单元统计页面
class Interface {
  Interface._();

  static const String path = '/app/admin/meterReading/house/unitTotal';

  static const String method = 'get';

  static Future<ResponseModel<$DataModel>> request(
    Dio dio, {
    Options? options,
    Map<String, dynamic>? pathParameters,
    Map<String, dynamic>? queryParameters,
    data,
    CancelToken? cancelToken,
    ProgressCallback? onSendProgress,
    ProgressCallback? onReceiveProgress,
  }) async {
    final res = await dio.request(
      _path(pathParameters ?? {}),
      data: data,
      queryParameters: queryParameters,
      cancelToken: cancelToken,
      options: Options(method: 'get'),
      onSendProgress: onSendProgress,
      onReceiveProgress: onReceiveProgress,
    );

    return ResponseModel(
      json: res.data,
      to: (v) => v.toJson(),
      from: (v) => $DataModel.fromJson(v),
    );
  }

  static String _path(Map<String, dynamic> pathParameters) {
    String back = path;
    for (final key in pathParameters.keys) {
      back = back.replaceAll('{$key}', pathParameters[key].toString());
    }
    return back;
  }
}

///http://yapi.wisdomcity.com.cn/project/40/interface/api/10094
///
///
///
///`communityNoTranscribe` 小区未抄表总数
///
///`communityHasTranscribe` 小区已经抄表总数
///
///`meterHouseUnitDtos` 各个单元统计
///
// ignore: camel_case_types
class $DataModel {
  ///`communityNoTranscribe` 小区未抄表总数
  num? communityNoTranscribe;

  ///`communityHasTranscribe` 小区已经抄表总数
  num? communityHasTranscribe;

  ///`meterHouseUnitDtos` 各个单元统计
  List<$JuniorMeterHouseUnitDtosModel>? meterHouseUnitDtos;

  ///http://yapi.wisdomcity.com.cn/project/40/interface/api/10094
  ///
  ///
  ///
  ///`communityNoTranscribe` 小区未抄表总数
  ///
  ///`communityHasTranscribe` 小区已经抄表总数
  ///
  ///`meterHouseUnitDtos` 各个单元统计
  $DataModel({
    this.communityNoTranscribe,
    this.communityHasTranscribe,
    this.meterHouseUnitDtos,
  });

  $DataModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json);
    this.communityNoTranscribe = map['communityNoTranscribe'];
    this.communityHasTranscribe = map['communityHasTranscribe'];
    if (map['meterHouseUnitDtos'] != null)
      this.meterHouseUnitDtos = List.of(map['meterHouseUnitDtos'])
          .map((e) => $JuniorMeterHouseUnitDtosModel.fromJson(e ?? {}))
          .toList();
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();
    json['communityNoTranscribe'] = this.communityNoTranscribe;
    json['communityHasTranscribe'] = this.communityHasTranscribe;
    json['meterHouseUnitDtos'] =
        this.meterHouseUnitDtos?.map((e) => e.toJson()).toList();
    return Map.from(json);
  }
}

///http://yapi.wisdomcity.com.cn/project/40/interface/api/10094
///
///
///
///`buildId`
///
///`buildName`
///
///`unitId`
///
///`unitName`
///
///`unitNoTranscribe` 单元未抄表总数
///
///`unitEleNoTranscribe` 单元电表未抄表总数
///
///`unitWaterNoTranscribe` 单元水表未抄表总数
///
///`unitHasTranscribe` 单元已经抄表总数
///
// ignore: camel_case_types
class $JuniorMeterHouseUnitDtosModel {
  ///`buildId`
  late String buildId;

  ///`buildName`
  late String buildName;

  ///`unitId`
  late String unitId;

  ///`unitName`
  late String unitName;

  ///`unitNoTranscribe` 单元未抄表总数
  late num unitNoTranscribe;

  ///`unitEleNoTranscribe` 单元电表未抄表总数
  late num unitEleNoTranscribe;

  ///`unitWaterNoTranscribe` 单元水表未抄表总数
  late num unitWaterNoTranscribe;

  ///`unitHasTranscribe` 单元已经抄表总数
  late num unitHasTranscribe;

  ///http://yapi.wisdomcity.com.cn/project/40/interface/api/10094
  ///
  ///
  ///
  ///`buildId`
  ///
  ///`buildName`
  ///
  ///`unitId`
  ///
  ///`unitName`
  ///
  ///`unitNoTranscribe` 单元未抄表总数
  ///
  ///`unitEleNoTranscribe` 单元电表未抄表总数
  ///
  ///`unitWaterNoTranscribe` 单元水表未抄表总数
  ///
  ///`unitHasTranscribe` 单元已经抄表总数
  $JuniorMeterHouseUnitDtosModel({
    required this.buildId,
    required this.buildName,
    required this.unitId,
    required this.unitName,
    required this.unitNoTranscribe,
    required this.unitEleNoTranscribe,
    required this.unitWaterNoTranscribe,
    required this.unitHasTranscribe,
  });

  $JuniorMeterHouseUnitDtosModel.fromJson(json) {
    Map<String, dynamic> map = Map.from(json);
    this.buildId = map['buildId'];
    this.buildName = map['buildName'];
    this.unitId = map['unitId'];
    this.unitName = map['unitName'];
    this.unitNoTranscribe = map['unitNoTranscribe'];
    this.unitEleNoTranscribe = map['unitEleNoTranscribe'];
    this.unitWaterNoTranscribe = map['unitWaterNoTranscribe'];
    this.unitHasTranscribe = map['unitHasTranscribe'];
  }

  Map<String, dynamic> toJson() {
    Map<String, dynamic> json = Map<String, dynamic>();
    json['buildId'] = this.buildId;
    json['buildName'] = this.buildName;
    json['unitId'] = this.unitId;
    json['unitName'] = this.unitName;
    json['unitNoTranscribe'] = this.unitNoTranscribe;
    json['unitEleNoTranscribe'] = this.unitEleNoTranscribe;
    json['unitWaterNoTranscribe'] = this.unitWaterNoTranscribe;
    json['unitHasTranscribe'] = this.unitHasTranscribe;
    return Map.from(json);
  }
}
